blob: b44f46ffcfadd57ef41e2033ceeb6db1caf85444 [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;
16
17struct machine_desc {
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 unsigned int nr; /* architecture number */
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 const char *name; /* architecture name */
Russell Kingf9bd6ea2005-07-04 10:43:36 +010020 unsigned long boot_params; /* tagged list */
Grant Likely93c02ab2011-04-28 14:27:21 -060021 const char **dt_compat; /* array of device tree
22 * 'compatible' strings */
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Nicolas Pitred71e3eb2010-10-14 22:37:52 -040024 unsigned int nr_irqs; /* number of IRQs */
25
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 unsigned int video_start; /* start of video RAM */
27 unsigned int video_end; /* end of video RAM */
28
29 unsigned int reserve_lp0 :1; /* never has lp0 */
30 unsigned int reserve_lp1 :1; /* never has lp1 */
31 unsigned int reserve_lp2 :1; /* never has lp2 */
32 unsigned int soft_reboot :1; /* soft reboot */
33 void (*fixup)(struct machine_desc *,
34 struct tag *, char **,
35 struct meminfo *);
Russell King98c672c2010-05-22 18:18:57 +010036 void (*reserve)(void);/* reserve mem blocks */
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 void (*map_io)(void);/* IO mapping function */
Larry Basself81fb562011-10-14 10:40:11 -070038 void (*init_very_early)(void);
Russell Kingdec12e62010-12-16 13:49:34 +000039 void (*init_early)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 void (*init_irq)(void);
41 struct sys_timer *timer; /* system tick timer */
42 void (*init_machine)(void);
eric miao52108642010-12-13 09:42:34 +010043#ifdef CONFIG_MULTI_IRQ_HANDLER
44 void (*handle_irq)(struct pt_regs *);
45#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070046};
47
48/*
Russell King8ff14432010-12-20 10:18:36 +000049 * Current machine - only accessible during boot.
50 */
51extern struct machine_desc *machine_desc;
52
53/*
Grant Likely62913192011-04-28 14:27:21 -060054 * Machine type table - also only accessible during boot
55 */
56extern struct machine_desc __arch_info_begin[], __arch_info_end[];
57#define for_each_machine_desc(p) \
58 for (p = __arch_info_begin; p < __arch_info_end; p++)
59
60/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070061 * Set of macros to define architecture features. This is built into
62 * a table by the linker.
63 */
Russell Kingf339ab32005-10-28 14:29:43 +010064#define MACHINE_START(_type,_name) \
65static const struct machine_desc __mach_desc_##_type \
David Rientjesb91d8a12007-05-11 16:18:55 -070066 __used \
Ben Dooks9d0fd1e2005-09-20 16:45:20 +010067 __attribute__((__section__(".arch.info.init"))) = { \
Russell Kingf339ab32005-10-28 14:29:43 +010068 .nr = MACH_TYPE_##_type, \
Linus Torvalds1da177e2005-04-16 15:20:36 -070069 .name = _name,
70
Linus Torvalds1da177e2005-04-16 15:20:36 -070071#define MACHINE_END \
72};
73
Grant Likely8c0d0e32011-07-25 09:52:11 -060074#define DT_MACHINE_START(_name, _namestr) \
75static const struct machine_desc __mach_desc_##_name \
76 __used \
77 __attribute__((__section__(".arch.info.init"))) = { \
78 .nr = ~0, \
79 .name = _namestr,
80
Linus Torvalds1da177e2005-04-16 15:20:36 -070081#endif