arch.h 2.8 KB
Newer Older
L
Linus Torvalds 已提交
1
/*
2
 *  arch/arm/include/asm/mach/arch.h
L
Linus Torvalds 已提交
3 4 5 6 7 8 9 10
 *
 *  Copyright (C) 2000 Russell King
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

11 12
#include <linux/types.h>

L
Linus Torvalds 已提交
13
#ifndef __ASSEMBLY__
14
#include <linux/reboot.h>
L
Linus Torvalds 已提交
15 16

struct tag;
17
struct pt_regs;
18 19 20
struct smp_operations;
#ifdef CONFIG_SMP
#define smp_ops(ops) (&(ops))
21
#define smp_init_ops(ops) (&(ops))
22 23
#else
#define smp_ops(ops) (struct smp_operations *)NULL
24
#define smp_init_ops(ops) (bool (*)(void))NULL
25
#endif
L
Linus Torvalds 已提交
26 27 28 29

struct machine_desc {
	unsigned int		nr;		/* architecture number	*/
	const char		*name;		/* architecture name	*/
30
	unsigned long		atag_offset;	/* tagged list (relative) */
31
	const char *const 	*dt_compat;	/* array of device tree
32
						 * 'compatible' strings	*/
L
Linus Torvalds 已提交
33

34 35
	unsigned int		nr_irqs;	/* number of IRQs */

36
#ifdef CONFIG_ZONE_DMA
37
	phys_addr_t		dma_zone_size;	/* size of DMA-able area */
38 39
#endif

L
Linus Torvalds 已提交
40 41 42
	unsigned int		video_start;	/* start of video RAM	*/
	unsigned int		video_end;	/* end of video RAM	*/

43 44 45
	unsigned char		reserve_lp0 :1;	/* never has lp0	*/
	unsigned char		reserve_lp1 :1;	/* never has lp1	*/
	unsigned char		reserve_lp2 :1;	/* never has lp2	*/
46
	enum reboot_mode	reboot_mode;	/* default restart mode	*/
47 48 49
	unsigned		l2c_aux_val;	/* L2 cache aux value	*/
	unsigned		l2c_aux_mask;	/* L2 cache aux mask	*/
	void			(*l2c_write_sec)(unsigned long, unsigned);
50
	const struct smp_operations	*smp;	/* SMP operations	*/
51
	bool			(*smp_init)(void);
L
Laura Abbott 已提交
52
	void			(*fixup)(struct tag *, char **);
53
	void			(*dt_fixup)(void);
54
	long long		(*pv_fixup)(void);
55
	void			(*reserve)(void);/* reserve mem blocks	*/
L
Linus Torvalds 已提交
56
	void			(*map_io)(void);/* IO mapping function	*/
57
	void			(*init_early)(void);
L
Linus Torvalds 已提交
58
	void			(*init_irq)(void);
S
Stephen Warren 已提交
59
	void			(*init_time)(void);
L
Linus Torvalds 已提交
60
	void			(*init_machine)(void);
61
	void			(*init_late)(void);
62 63 64
#ifdef CONFIG_MULTI_IRQ_HANDLER
	void			(*handle_irq)(struct pt_regs *);
#endif
65
	void			(*restart)(enum reboot_mode, const char *);
L
Linus Torvalds 已提交
66 67
};

68 69 70
/*
 * Current machine - only accessible during boot.
 */
71
extern const struct machine_desc *machine_desc;
72

73 74 75
/*
 * Machine type table - also only accessible during boot
 */
76
extern const struct machine_desc __arch_info_begin[], __arch_info_end[];
77 78 79
#define for_each_machine_desc(p)			\
	for (p = __arch_info_begin; p < __arch_info_end; p++)

L
Linus Torvalds 已提交
80 81 82 83
/*
 * Set of macros to define architecture features.  This is built into
 * a table by the linker.
 */
R
Russell King 已提交
84 85
#define MACHINE_START(_type,_name)			\
static const struct machine_desc __mach_desc_##_type	\
D
David Rientjes 已提交
86
 __used							\
87
 __attribute__((__section__(".arch.info.init"))) = {	\
R
Russell King 已提交
88
	.nr		= MACH_TYPE_##_type,		\
L
Linus Torvalds 已提交
89 90 91 92 93
	.name		= _name,

#define MACHINE_END				\
};

G
Grant Likely 已提交
94 95 96 97 98 99 100
#define DT_MACHINE_START(_name, _namestr)		\
static const struct machine_desc __mach_desc_##_name	\
 __used							\
 __attribute__((__section__(".arch.info.init"))) = {	\
	.nr		= ~0,				\
	.name		= _namestr,

L
Linus Torvalds 已提交
101
#endif