Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Russell King | 4baa992 | 2008-08-02 10:55:55 +0100 | [diff] [blame] | 2 | * arch/arm/include/asm/mach/arch.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2000 Russell King |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | */ |
| 10 | |
Jon Medhurst | b382b94 | 2013-05-21 13:40:51 +0000 | [diff] [blame] | 11 | #include <linux/types.h> |
| 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #ifndef __ASSEMBLY__ |
Robin Holt | 16d6d5b | 2013-07-08 16:01:39 -0700 | [diff] [blame] | 14 | #include <linux/reboot.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
| 16 | struct tag; |
Fabio Estevam | 1a1f2be | 2011-11-09 19:13:43 +0100 | [diff] [blame] | 17 | struct pt_regs; |
Marc Zyngier | abcee5f | 2011-09-08 09:06:10 +0100 | [diff] [blame] | 18 | struct smp_operations; |
| 19 | #ifdef CONFIG_SMP |
| 20 | #define smp_ops(ops) (&(ops)) |
Jon Medhurst | b382b94 | 2013-05-21 13:40:51 +0000 | [diff] [blame] | 21 | #define smp_init_ops(ops) (&(ops)) |
Marc Zyngier | abcee5f | 2011-09-08 09:06:10 +0100 | [diff] [blame] | 22 | #else |
| 23 | #define smp_ops(ops) (struct smp_operations *)NULL |
Jon Medhurst | b382b94 | 2013-05-21 13:40:51 +0000 | [diff] [blame] | 24 | #define smp_init_ops(ops) (bool (*)(void))NULL |
Marc Zyngier | abcee5f | 2011-09-08 09:06:10 +0100 | [diff] [blame] | 25 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
| 27 | struct machine_desc { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | unsigned int nr; /* architecture number */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | const char *name; /* architecture name */ |
Nicolas Pitre | 2bb9839 | 2011-07-05 22:38:10 -0400 | [diff] [blame] | 30 | unsigned long atag_offset; /* tagged list (relative) */ |
Uwe Kleine-König | 7b482c8 | 2011-12-20 22:56:45 +0100 | [diff] [blame] | 31 | const char *const *dt_compat; /* array of device tree |
Grant Likely | 93c02ab | 2011-04-28 14:27:21 -0600 | [diff] [blame] | 32 | * 'compatible' strings */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | |
Nicolas Pitre | d71e3eb | 2010-10-14 22:37:52 -0400 | [diff] [blame] | 34 | unsigned int nr_irqs; /* number of IRQs */ |
| 35 | |
Nicolas Pitre | 4fddcae | 2011-07-05 22:28:08 -0400 | [diff] [blame] | 36 | #ifdef CONFIG_ZONE_DMA |
Rob Herring | 364230b | 2013-08-01 15:29:29 -0500 | [diff] [blame] | 37 | phys_addr_t dma_zone_size; /* size of DMA-able area */ |
Nicolas Pitre | 4fddcae | 2011-07-05 22:28:08 -0400 | [diff] [blame] | 38 | #endif |
| 39 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | unsigned int video_start; /* start of video RAM */ |
| 41 | unsigned int video_end; /* end of video RAM */ |
| 42 | |
Russell King | b44c350 | 2011-11-01 14:27:33 +0000 | [diff] [blame] | 43 | unsigned char reserve_lp0 :1; /* never has lp0 */ |
| 44 | unsigned char reserve_lp1 :1; /* never has lp1 */ |
| 45 | unsigned char reserve_lp2 :1; /* never has lp2 */ |
Robin Holt | 16d6d5b | 2013-07-08 16:01:39 -0700 | [diff] [blame] | 46 | enum reboot_mode reboot_mode; /* default restart mode */ |
Russell King | 805604e | 2014-04-28 15:24:10 +0100 | [diff] [blame] | 47 | unsigned l2c_aux_val; /* L2 cache aux value */ |
| 48 | unsigned l2c_aux_mask; /* L2 cache aux mask */ |
| 49 | void (*l2c_write_sec)(unsigned long, unsigned); |
Masahiro Yamada | f460b6a | 2015-08-26 07:49:12 +0100 | [diff] [blame] | 50 | const struct smp_operations *smp; /* SMP operations */ |
Jon Medhurst | b382b94 | 2013-05-21 13:40:51 +0000 | [diff] [blame] | 51 | bool (*smp_init)(void); |
Laura Abbott | 1c2f87c | 2014-04-13 22:54:58 +0100 | [diff] [blame] | 52 | void (*fixup)(struct tag *, char **); |
Laura Abbott | 5a12a597 | 2014-07-15 10:03:36 -0700 | [diff] [blame] | 53 | void (*dt_fixup)(void); |
Russell King | c0b759d | 2015-04-04 10:01:10 +0100 | [diff] [blame] | 54 | long long (*pv_fixup)(void); |
Russell King | 98c672c | 2010-05-22 18:18:57 +0100 | [diff] [blame] | 55 | void (*reserve)(void);/* reserve mem blocks */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | void (*map_io)(void);/* IO mapping function */ |
Russell King | dec12e6 | 2010-12-16 13:49:34 +0000 | [diff] [blame] | 57 | void (*init_early)(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | void (*init_irq)(void); |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 59 | void (*init_time)(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | void (*init_machine)(void); |
Shawn Guo | 90de413 | 2012-04-25 22:24:44 +0800 | [diff] [blame] | 61 | void (*init_late)(void); |
eric miao | 5210864 | 2010-12-13 09:42:34 +0100 | [diff] [blame] | 62 | #ifdef CONFIG_MULTI_IRQ_HANDLER |
| 63 | void (*handle_irq)(struct pt_regs *); |
| 64 | #endif |
Robin Holt | 7b6d864 | 2013-07-08 16:01:40 -0700 | [diff] [blame] | 65 | void (*restart)(enum reboot_mode, const char *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | /* |
Russell King | 8ff1443 | 2010-12-20 10:18:36 +0000 | [diff] [blame] | 69 | * Current machine - only accessible during boot. |
| 70 | */ |
Russell King | ff69a4c | 2013-07-26 14:55:59 +0100 | [diff] [blame] | 71 | extern const struct machine_desc *machine_desc; |
Russell King | 8ff1443 | 2010-12-20 10:18:36 +0000 | [diff] [blame] | 72 | |
| 73 | /* |
Grant Likely | 6291319 | 2011-04-28 14:27:21 -0600 | [diff] [blame] | 74 | * Machine type table - also only accessible during boot |
| 75 | */ |
Russell King | ff69a4c | 2013-07-26 14:55:59 +0100 | [diff] [blame] | 76 | extern const struct machine_desc __arch_info_begin[], __arch_info_end[]; |
Grant Likely | 6291319 | 2011-04-28 14:27:21 -0600 | [diff] [blame] | 77 | #define for_each_machine_desc(p) \ |
| 78 | for (p = __arch_info_begin; p < __arch_info_end; p++) |
| 79 | |
| 80 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | * Set of macros to define architecture features. This is built into |
| 82 | * a table by the linker. |
| 83 | */ |
Russell King | f339ab3 | 2005-10-28 14:29:43 +0100 | [diff] [blame] | 84 | #define MACHINE_START(_type,_name) \ |
| 85 | static const struct machine_desc __mach_desc_##_type \ |
David Rientjes | b91d8a1 | 2007-05-11 16:18:55 -0700 | [diff] [blame] | 86 | __used \ |
Ben Dooks | 9d0fd1e | 2005-09-20 16:45:20 +0100 | [diff] [blame] | 87 | __attribute__((__section__(".arch.info.init"))) = { \ |
Russell King | f339ab3 | 2005-10-28 14:29:43 +0100 | [diff] [blame] | 88 | .nr = MACH_TYPE_##_type, \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | .name = _name, |
| 90 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | #define MACHINE_END \ |
| 92 | }; |
| 93 | |
Grant Likely | 85cad1b | 2011-07-25 09:52:11 -0600 | [diff] [blame] | 94 | #define DT_MACHINE_START(_name, _namestr) \ |
| 95 | static const struct machine_desc __mach_desc_##_name \ |
| 96 | __used \ |
| 97 | __attribute__((__section__(".arch.info.init"))) = { \ |
| 98 | .nr = ~0, \ |
| 99 | .name = _namestr, |
| 100 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | #endif |