blob: 6ea1a1e3f35994e0d3e132765dd8fa599a797bac [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;
Marc Zyngier6fbb9222012-11-08 11:10:01 -080017struct 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 Torvalds1da177e2005-04-16 15:20:36 -070023
24struct machine_desc {
Linus Torvalds1da177e2005-04-16 15:20:36 -070025 unsigned int nr; /* architecture number */
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 const char *name; /* architecture name */
Nicolas Pitre2bb98392011-07-05 22:38:10 -040027 unsigned long atag_offset; /* tagged list (relative) */
Uwe Kleine-König7b482c82011-12-20 22:56:45 +010028 const char *const *dt_compat; /* array of device tree
Grant Likely93c02ab2011-04-28 14:27:21 -060029 * 'compatible' strings */
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
Michael Bohan519e4202012-06-01 13:25:10 -070031 unsigned int nr_irqs; /* number of IRQs */
Nicolas Pitred71e3eb2010-10-14 22:37:52 -040032
Nicolas Pitre4fddcae2011-07-05 22:28:08 -040033#ifdef CONFIG_ZONE_DMA
34 unsigned long dma_zone_size; /* size of DMA-able area */
35#endif
36
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 unsigned int video_start; /* start of video RAM */
38 unsigned int video_end; /* end of video RAM */
39
Russell Kingb44c3502011-11-01 14:27:33 +000040 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 Zyngier6fbb9222012-11-08 11:10:01 -080044 struct smp_operations *smp; /* SMP operations */
Russell King0744a3e2010-12-20 10:37:50 +000045 void (*fixup)(struct tag *, char **,
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 struct meminfo *);
Russell King98c672c2010-05-22 18:18:57 +010047 void (*reserve)(void);/* reserve mem blocks */
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 void (*map_io)(void);/* IO mapping function */
Larry Basself81fb562011-10-14 10:40:11 -070049 void (*init_very_early)(void);
Russell Kingdec12e62010-12-16 13:49:34 +000050 void (*init_early)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 void (*init_irq)(void);
52 struct sys_timer *timer; /* system tick timer */
53 void (*init_machine)(void);
eric miao52108642010-12-13 09:42:34 +010054#ifdef CONFIG_MULTI_IRQ_HANDLER
55 void (*handle_irq)(struct pt_regs *);
56#endif
Russell Kinga5287212011-11-04 15:05:24 +000057 void (*restart)(char, const char *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070058};
59
60/*
Russell King8ff14432010-12-20 10:18:36 +000061 * Current machine - only accessible during boot.
62 */
63extern struct machine_desc *machine_desc;
64
65/*
Grant Likely62913192011-04-28 14:27:21 -060066 * Machine type table - also only accessible during boot
67 */
68extern 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 Torvalds1da177e2005-04-16 15:20:36 -070073 * Set of macros to define architecture features. This is built into
74 * a table by the linker.
75 */
Russell Kingf339ab32005-10-28 14:29:43 +010076#define MACHINE_START(_type,_name) \
77static const struct machine_desc __mach_desc_##_type \
David Rientjesb91d8a12007-05-11 16:18:55 -070078 __used \
Ben Dooks9d0fd1e2005-09-20 16:45:20 +010079 __attribute__((__section__(".arch.info.init"))) = { \
Russell Kingf339ab32005-10-28 14:29:43 +010080 .nr = MACH_TYPE_##_type, \
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 .name = _name,
82
Linus Torvalds1da177e2005-04-16 15:20:36 -070083#define MACHINE_END \
84};
85
Grant Likely85cad1b2011-07-25 09:52:11 -060086#define DT_MACHINE_START(_name, _namestr) \
87static const struct machine_desc __mach_desc_##_name \
88 __used \
89 __attribute__((__section__(".arch.info.init"))) = { \
90 .nr = ~0, \
91 .name = _namestr,
92
Linus Torvalds1da177e2005-04-16 15:20:36 -070093#endif