blob: 441efc491b50aa0f402bf60fbe6ecd6020456875 [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
Jon Medhurstb382b942013-05-21 13:40:51 +000011#include <linux/types.h>
12
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#ifndef __ASSEMBLY__
Robin Holt16d6d5b2013-07-08 16:01:39 -070014#include <linux/reboot.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
16struct tag;
17struct meminfo;
Fabio Estevam1a1f2be2011-11-09 19:13:43 +010018struct pt_regs;
Marc Zyngierabcee5f2011-09-08 09:06:10 +010019struct smp_operations;
20#ifdef CONFIG_SMP
21#define smp_ops(ops) (&(ops))
Jon Medhurstb382b942013-05-21 13:40:51 +000022#define smp_init_ops(ops) (&(ops))
Marc Zyngierabcee5f2011-09-08 09:06:10 +010023#else
24#define smp_ops(ops) (struct smp_operations *)NULL
Jon Medhurstb382b942013-05-21 13:40:51 +000025#define smp_init_ops(ops) (bool (*)(void))NULL
Marc Zyngierabcee5f2011-09-08 09:06:10 +010026#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
28struct machine_desc {
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 unsigned int nr; /* architecture number */
Linus Torvalds1da177e2005-04-16 15:20:36 -070030 const char *name; /* architecture name */
Nicolas Pitre2bb98392011-07-05 22:38:10 -040031 unsigned long atag_offset; /* tagged list (relative) */
Uwe Kleine-König7b482c82011-12-20 22:56:45 +010032 const char *const *dt_compat; /* array of device tree
Grant Likely93c02ab2011-04-28 14:27:21 -060033 * 'compatible' strings */
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Nicolas Pitred71e3eb2010-10-14 22:37:52 -040035 unsigned int nr_irqs; /* number of IRQs */
36
Nicolas Pitre4fddcae2011-07-05 22:28:08 -040037#ifdef CONFIG_ZONE_DMA
38 unsigned long dma_zone_size; /* size of DMA-able area */
39#endif
40
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 unsigned int video_start; /* start of video RAM */
42 unsigned int video_end; /* end of video RAM */
43
Russell Kingb44c3502011-11-01 14:27:33 +000044 unsigned char reserve_lp0 :1; /* never has lp0 */
45 unsigned char reserve_lp1 :1; /* never has lp1 */
46 unsigned char reserve_lp2 :1; /* never has lp2 */
Robin Holt16d6d5b2013-07-08 16:01:39 -070047 enum reboot_mode reboot_mode; /* default restart mode */
Marc Zyngierabcee5f2011-09-08 09:06:10 +010048 struct smp_operations *smp; /* SMP operations */
Jon Medhurstb382b942013-05-21 13:40:51 +000049 bool (*smp_init)(void);
Russell King0744a3e2010-12-20 10:37:50 +000050 void (*fixup)(struct tag *, char **,
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 struct meminfo *);
Russell King98c672c2010-05-22 18:18:57 +010052 void (*reserve)(void);/* reserve mem blocks */
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 void (*map_io)(void);/* IO mapping function */
Russell Kingdec12e62010-12-16 13:49:34 +000054 void (*init_early)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070055 void (*init_irq)(void);
Stephen Warren6bb27d72012-11-08 12:40:59 -070056 void (*init_time)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070057 void (*init_machine)(void);
Shawn Guo90de4132012-04-25 22:24:44 +080058 void (*init_late)(void);
eric miao52108642010-12-13 09:42:34 +010059#ifdef CONFIG_MULTI_IRQ_HANDLER
60 void (*handle_irq)(struct pt_regs *);
61#endif
Robin Holt7b6d8642013-07-08 16:01:40 -070062 void (*restart)(enum reboot_mode, const char *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070063};
64
65/*
Russell King8ff14432010-12-20 10:18:36 +000066 * Current machine - only accessible during boot.
67 */
68extern struct machine_desc *machine_desc;
69
70/*
Grant Likely62913192011-04-28 14:27:21 -060071 * Machine type table - also only accessible during boot
72 */
73extern struct machine_desc __arch_info_begin[], __arch_info_end[];
74#define for_each_machine_desc(p) \
75 for (p = __arch_info_begin; p < __arch_info_end; p++)
76
77/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 * Set of macros to define architecture features. This is built into
79 * a table by the linker.
80 */
Russell Kingf339ab32005-10-28 14:29:43 +010081#define MACHINE_START(_type,_name) \
82static const struct machine_desc __mach_desc_##_type \
David Rientjesb91d8a12007-05-11 16:18:55 -070083 __used \
Ben Dooks9d0fd1e2005-09-20 16:45:20 +010084 __attribute__((__section__(".arch.info.init"))) = { \
Russell Kingf339ab32005-10-28 14:29:43 +010085 .nr = MACH_TYPE_##_type, \
Linus Torvalds1da177e2005-04-16 15:20:36 -070086 .name = _name,
87
Linus Torvalds1da177e2005-04-16 15:20:36 -070088#define MACHINE_END \
89};
90
Grant Likely85cad1b2011-07-25 09:52:11 -060091#define DT_MACHINE_START(_name, _namestr) \
92static const struct machine_desc __mach_desc_##_name \
93 __used \
94 __attribute__((__section__(".arch.info.init"))) = { \
95 .nr = ~0, \
96 .name = _namestr,
97
Linus Torvalds1da177e2005-04-16 15:20:36 -070098#endif