blob: 308ad7d6f98b77098dd3c831b8831f9731f49211 [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;
Fabio Estevam1a1f2be2011-11-09 19:13:43 +010015struct pt_regs;
Marc Zyngierabcee5f2011-09-08 09:06:10 +010016struct smp_operations;
17#ifdef CONFIG_SMP
18#define smp_ops(ops) (&(ops))
19#else
20#define smp_ops(ops) (struct smp_operations *)NULL
21#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
23struct machine_desc {
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 unsigned int nr; /* architecture number */
Linus Torvalds1da177e2005-04-16 15:20:36 -070025 const char *name; /* architecture name */
Nicolas Pitre2bb98392011-07-05 22:38:10 -040026 unsigned long atag_offset; /* tagged list (relative) */
Uwe Kleine-König7b482c82011-12-20 22:56:45 +010027 const char *const *dt_compat; /* array of device tree
Grant Likely93c02ab2011-04-28 14:27:21 -060028 * 'compatible' strings */
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
Nicolas Pitred71e3eb2010-10-14 22:37:52 -040030 unsigned int nr_irqs; /* number of IRQs */
31
Nicolas Pitre4fddcae2011-07-05 22:28:08 -040032#ifdef CONFIG_ZONE_DMA
33 unsigned long dma_zone_size; /* size of DMA-able area */
34#endif
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 unsigned int video_start; /* start of video RAM */
37 unsigned int video_end; /* end of video RAM */
38
Russell Kingb44c3502011-11-01 14:27:33 +000039 unsigned char reserve_lp0 :1; /* never has lp0 */
40 unsigned char reserve_lp1 :1; /* never has lp1 */
41 unsigned char reserve_lp2 :1; /* never has lp2 */
42 char restart_mode; /* default restart mode */
Marc Zyngierabcee5f2011-09-08 09:06:10 +010043 struct smp_operations *smp; /* SMP operations */
Russell King0744a3e2010-12-20 10:37:50 +000044 void (*fixup)(struct tag *, char **,
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 struct meminfo *);
Russell King98c672c2010-05-22 18:18:57 +010046 void (*reserve)(void);/* reserve mem blocks */
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 void (*map_io)(void);/* IO mapping function */
Russell Kingdec12e62010-12-16 13:49:34 +000048 void (*init_early)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 void (*init_irq)(void);
Stephen Warren6bb27d72012-11-08 12:40:59 -070050 void (*init_time)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 void (*init_machine)(void);
Shawn Guo90de4132012-04-25 22:24:44 +080052 void (*init_late)(void);
eric miao52108642010-12-13 09:42:34 +010053#ifdef CONFIG_MULTI_IRQ_HANDLER
54 void (*handle_irq)(struct pt_regs *);
55#endif
Russell Kinga5287212011-11-04 15:05:24 +000056 void (*restart)(char, const char *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070057};
58
59/*
Russell King8ff14432010-12-20 10:18:36 +000060 * Current machine - only accessible during boot.
61 */
62extern struct machine_desc *machine_desc;
63
64/*
Grant Likely62913192011-04-28 14:27:21 -060065 * Machine type table - also only accessible during boot
66 */
67extern struct machine_desc __arch_info_begin[], __arch_info_end[];
68#define for_each_machine_desc(p) \
69 for (p = __arch_info_begin; p < __arch_info_end; p++)
70
71/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070072 * Set of macros to define architecture features. This is built into
73 * a table by the linker.
74 */
Russell Kingf339ab32005-10-28 14:29:43 +010075#define MACHINE_START(_type,_name) \
76static const struct machine_desc __mach_desc_##_type \
David Rientjesb91d8a12007-05-11 16:18:55 -070077 __used \
Ben Dooks9d0fd1e2005-09-20 16:45:20 +010078 __attribute__((__section__(".arch.info.init"))) = { \
Russell Kingf339ab32005-10-28 14:29:43 +010079 .nr = MACH_TYPE_##_type, \
Linus Torvalds1da177e2005-04-16 15:20:36 -070080 .name = _name,
81
Linus Torvalds1da177e2005-04-16 15:20:36 -070082#define MACHINE_END \
83};
84
Grant Likely85cad1b2011-07-25 09:52:11 -060085#define DT_MACHINE_START(_name, _namestr) \
86static const struct machine_desc __mach_desc_##_name \
87 __used \
88 __attribute__((__section__(".arch.info.init"))) = { \
89 .nr = ~0, \
90 .name = _namestr,
91
Linus Torvalds1da177e2005-04-16 15:20:36 -070092#endif