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