arch.h 2.5 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 11 12 13 14 15
 *
 *  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.
 */

#ifndef __ASSEMBLY__

struct tag;
struct meminfo;
struct sys_timer;
16
struct pt_regs;
17 18 19 20 21 22
struct smp_operations;
#ifdef CONFIG_SMP
#define smp_ops(ops) (&(ops))
#else
#define smp_ops(ops) (struct smp_operations *)NULL
#endif
L
Linus Torvalds 已提交
23 24 25 26

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

31 32
	unsigned int		nr_irqs;	/* number of IRQs */

33 34 35 36
#ifdef CONFIG_ZONE_DMA
	unsigned long		dma_zone_size;	/* size of DMA-able area */
#endif

L
Linus Torvalds 已提交
37 38 39
	unsigned int		video_start;	/* start of video RAM	*/
	unsigned int		video_end;	/* end of video RAM	*/

40 41 42 43
	unsigned char		reserve_lp0 :1;	/* never has lp0	*/
	unsigned char		reserve_lp1 :1;	/* never has lp1	*/
	unsigned char		reserve_lp2 :1;	/* never has lp2	*/
	char			restart_mode;	/* default restart mode	*/
44
	struct smp_operations	*smp;		/* SMP operations	*/
45
	void			(*fixup)(struct tag *, char **,
L
Linus Torvalds 已提交
46
					 struct meminfo *);
47
	void			(*reserve)(void);/* reserve mem blocks	*/
L
Linus Torvalds 已提交
48
	void			(*map_io)(void);/* IO mapping function	*/
49
	void			(*init_early)(void);
L
Linus Torvalds 已提交
50 51 52
	void			(*init_irq)(void);
	struct sys_timer	*timer;		/* system tick timer	*/
	void			(*init_machine)(void);
53
	void			(*init_late)(void);
54 55 56
#ifdef CONFIG_MULTI_IRQ_HANDLER
	void			(*handle_irq)(struct pt_regs *);
#endif
57
	void			(*restart)(char, const char *);
L
Linus Torvalds 已提交
58 59
};

60 61 62 63 64
/*
 * Current machine - only accessible during boot.
 */
extern struct machine_desc *machine_desc;

65 66 67 68 69 70 71
/*
 * Machine type table - also only accessible during boot
 */
extern struct machine_desc __arch_info_begin[], __arch_info_end[];
#define for_each_machine_desc(p)			\
	for (p = __arch_info_begin; p < __arch_info_end; p++)

L
Linus Torvalds 已提交
72 73 74 75
/*
 * Set of macros to define architecture features.  This is built into
 * a table by the linker.
 */
R
Russell King 已提交
76 77
#define MACHINE_START(_type,_name)			\
static const struct machine_desc __mach_desc_##_type	\
D
David Rientjes 已提交
78
 __used							\
79
 __attribute__((__section__(".arch.info.init"))) = {	\
R
Russell King 已提交
80
	.nr		= MACH_TYPE_##_type,		\
L
Linus Torvalds 已提交
81 82 83 84 85
	.name		= _name,

#define MACHINE_END				\
};

G
Grant Likely 已提交
86 87 88 89 90 91 92
#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 已提交
93
#endif