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