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