blob: 669a626b1f58f9b2ee2004afef98ae88ddcaf03f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Russell King4baa9922008-08-02 10:55:55 +01002 * arch/arm/include/asm/mach/arch.h
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
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
13struct tag;
14struct meminfo;
15struct sys_timer;
Fabio Estevam1a1f2be2011-11-09 19:13:43 +010016struct pt_regs;
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18struct machine_desc {
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 unsigned int nr; /* architecture number */
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 const char *name; /* architecture name */
Nicolas Pitre2bb98392011-07-05 22:38:10 -040021 unsigned long atag_offset; /* tagged list (relative) */
Uwe Kleine-König7b482c82011-12-20 22:56:45 +010022 const char *const *dt_compat; /* array of device tree
Grant Likely93c02ab2011-04-28 14:27:21 -060023 * 'compatible' strings */
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
Michael Bohan519e4202012-06-01 13:25:10 -070025 unsigned int nr_irqs; /* number of IRQs */
Nicolas Pitred71e3eb2010-10-14 22:37:52 -040026
Nicolas Pitre4fddcae2011-07-05 22:28:08 -040027#ifdef CONFIG_ZONE_DMA
28 unsigned long dma_zone_size; /* size of DMA-able area */
29#endif
30
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 unsigned int video_start; /* start of video RAM */
32 unsigned int video_end; /* end of video RAM */
33
Russell Kingb44c3502011-11-01 14:27:33 +000034 unsigned char reserve_lp0 :1; /* never has lp0 */
35 unsigned char reserve_lp1 :1; /* never has lp1 */
36 unsigned char reserve_lp2 :1; /* never has lp2 */
37 char restart_mode; /* default restart mode */
Russell King0744a3e2010-12-20 10:37:50 +000038 void (*fixup)(struct tag *, char **,
Linus Torvalds1da177e2005-04-16 15:20:36 -070039 struct meminfo *);
Russell King98c672c2010-05-22 18:18:57 +010040 void (*reserve)(void);/* reserve mem blocks */
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 void (*map_io)(void);/* IO mapping function */
Larry Basself81fb562011-10-14 10:40:11 -070042 void (*init_very_early)(void);
Russell Kingdec12e62010-12-16 13:49:34 +000043 void (*init_early)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 void (*init_irq)(void);
45 struct sys_timer *timer; /* system tick timer */
46 void (*init_machine)(void);
eric miao52108642010-12-13 09:42:34 +010047#ifdef CONFIG_MULTI_IRQ_HANDLER
48 void (*handle_irq)(struct pt_regs *);
49#endif
Russell Kinga5287212011-11-04 15:05:24 +000050 void (*restart)(char, const char *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051};
52
53/*
Russell King8ff14432010-12-20 10:18:36 +000054 * Current machine - only accessible during boot.
55 */
56extern struct machine_desc *machine_desc;
57
58/*
Grant Likely62913192011-04-28 14:27:21 -060059 * Machine type table - also only accessible during boot
60 */
61extern struct machine_desc __arch_info_begin[], __arch_info_end[];
62#define for_each_machine_desc(p) \
63 for (p = __arch_info_begin; p < __arch_info_end; p++)
64
65/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 * Set of macros to define architecture features. This is built into
67 * a table by the linker.
68 */
Russell Kingf339ab32005-10-28 14:29:43 +010069#define MACHINE_START(_type,_name) \
70static const struct machine_desc __mach_desc_##_type \
David Rientjesb91d8a12007-05-11 16:18:55 -070071 __used \
Ben Dooks9d0fd1e2005-09-20 16:45:20 +010072 __attribute__((__section__(".arch.info.init"))) = { \
Russell Kingf339ab32005-10-28 14:29:43 +010073 .nr = MACH_TYPE_##_type, \
Linus Torvalds1da177e2005-04-16 15:20:36 -070074 .name = _name,
75
Linus Torvalds1da177e2005-04-16 15:20:36 -070076#define MACHINE_END \
77};
78
Grant Likely85cad1b2011-07-25 09:52:11 -060079#define DT_MACHINE_START(_name, _namestr) \
80static const struct machine_desc __mach_desc_##_name \
81 __used \
82 __attribute__((__section__(".arch.info.init"))) = { \
83 .nr = ~0, \
84 .name = _namestr,
85
Linus Torvalds1da177e2005-04-16 15:20:36 -070086#endif