Add linux-next specific files for 20110831
[linux-2.6/next.git] / arch / arm / include / asm / setup.h
bloba3ca303a08011eae1d54788a5bbca888bb63974c
1 /*
2 * linux/include/asm/setup.h
4 * Copyright (C) 1997-1999 Russell King
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.
10 * Structure passed to kernel to tell it about the
11 * hardware it's running on. See Documentation/arm/Setup
12 * for more info.
14 #ifndef __ASMARM_SETUP_H
15 #define __ASMARM_SETUP_H
17 #include <linux/types.h>
19 #define COMMAND_LINE_SIZE 1024
21 /* The list ends with an ATAG_NONE node. */
22 #define ATAG_NONE 0x00000000
24 struct tag_header {
25 __u32 size;
26 __u32 tag;
29 /* The list must start with an ATAG_CORE node */
30 #define ATAG_CORE 0x54410001
32 struct tag_core {
33 __u32 flags; /* bit 0 = read-only */
34 __u32 pagesize;
35 __u32 rootdev;
38 /* it is allowed to have multiple ATAG_MEM nodes */
39 #define ATAG_MEM 0x54410002
41 struct tag_mem32 {
42 __u32 size;
43 __u32 start; /* physical start address */
46 #define ATAG_MEM64 0x54420002
48 struct tag_mem64 {
49 __u64 size;
50 __u64 start; /* physical start address */
53 /* VGA text type displays */
54 #define ATAG_VIDEOTEXT 0x54410003
56 struct tag_videotext {
57 __u8 x;
58 __u8 y;
59 __u16 video_page;
60 __u8 video_mode;
61 __u8 video_cols;
62 __u16 video_ega_bx;
63 __u8 video_lines;
64 __u8 video_isvga;
65 __u16 video_points;
68 /* describes how the ramdisk will be used in kernel */
69 #define ATAG_RAMDISK 0x54410004
71 struct tag_ramdisk {
72 __u32 flags; /* bit 0 = load, bit 1 = prompt */
73 __u32 size; /* decompressed ramdisk size in _kilo_ bytes */
74 __u32 start; /* starting block of floppy-based RAM disk image */
77 /* describes where the compressed ramdisk image lives (virtual address) */
79 * this one accidentally used virtual addresses - as such,
80 * it's deprecated.
82 #define ATAG_INITRD 0x54410005
84 /* describes where the compressed ramdisk image lives (physical address) */
85 #define ATAG_INITRD2 0x54420005
87 struct tag_initrd {
88 __u32 start; /* physical start address */
89 __u32 size; /* size of compressed ramdisk image in bytes */
92 /* board serial number. "64 bits should be enough for everybody" */
93 #define ATAG_SERIAL 0x54410006
95 struct tag_serialnr {
96 __u32 low;
97 __u32 high;
100 /* board revision */
101 #define ATAG_REVISION 0x54410007
103 struct tag_revision {
104 __u32 rev;
107 /* initial values for vesafb-type framebuffers. see struct screen_info
108 * in include/linux/tty.h
110 #define ATAG_VIDEOLFB 0x54410008
112 struct tag_videolfb {
113 __u16 lfb_width;
114 __u16 lfb_height;
115 __u16 lfb_depth;
116 __u16 lfb_linelength;
117 __u32 lfb_base;
118 __u32 lfb_size;
119 __u8 red_size;
120 __u8 red_pos;
121 __u8 green_size;
122 __u8 green_pos;
123 __u8 blue_size;
124 __u8 blue_pos;
125 __u8 rsvd_size;
126 __u8 rsvd_pos;
129 /* command line: \0 terminated string */
130 #define ATAG_CMDLINE 0x54410009
132 struct tag_cmdline {
133 char cmdline[1]; /* this is the minimum size */
136 /* acorn RiscPC specific information */
137 #define ATAG_ACORN 0x41000101
139 struct tag_acorn {
140 __u32 memc_control_reg;
141 __u32 vram_pages;
142 __u8 sounddefault;
143 __u8 adfsdrives;
146 /* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
147 #define ATAG_MEMCLK 0x41000402
149 struct tag_memclk {
150 __u32 fmemclk;
153 struct tag {
154 struct tag_header hdr;
155 union {
156 struct tag_core core;
157 struct tag_mem32 mem;
158 struct tag_mem64 mem64;
159 struct tag_videotext videotext;
160 struct tag_ramdisk ramdisk;
161 struct tag_initrd initrd;
162 struct tag_serialnr serialnr;
163 struct tag_revision revision;
164 struct tag_videolfb videolfb;
165 struct tag_cmdline cmdline;
168 * Acorn specific
170 struct tag_acorn acorn;
173 * DC21285 specific
175 struct tag_memclk memclk;
176 } u;
179 struct tagtable {
180 __u32 tag;
181 int (*parse)(const struct tag *);
184 #define tag_member_present(tag,member) \
185 ((unsigned long)(&((struct tag *)0L)->member + 1) \
186 <= (tag)->hdr.size * 4)
188 #define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
189 #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
191 #define for_each_tag(t,base) \
192 for (t = base; t->hdr.size; t = tag_next(t))
194 #ifdef __KERNEL__
196 #define __tag __used __attribute__((__section__(".taglist.init")))
197 #define __tagtable(tag, fn) \
198 static const struct tagtable __tagtable_##fn __tag = { tag, fn }
201 * Memory map description
203 #ifdef CONFIG_ARCH_EP93XX
204 # define NR_BANKS 16
205 #else
206 # define NR_BANKS 8
207 #endif
209 struct membank {
210 phys_addr_t start;
211 unsigned long size;
212 unsigned int highmem;
215 struct meminfo {
216 int nr_banks;
217 struct membank bank[NR_BANKS];
220 extern struct meminfo meminfo;
222 #define for_each_bank(iter,mi) \
223 for (iter = 0; iter < (mi)->nr_banks; iter++)
225 #define bank_pfn_start(bank) __phys_to_pfn((bank)->start)
226 #define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size)
227 #define bank_pfn_size(bank) ((bank)->size >> PAGE_SHIFT)
228 #define bank_phys_start(bank) (bank)->start
229 #define bank_phys_end(bank) ((bank)->start + (bank)->size)
230 #define bank_phys_size(bank) (bank)->size
232 extern int arm_add_memory(phys_addr_t start, unsigned long size);
233 extern void early_print(const char *str, ...);
234 extern void dump_machine_table(void);
236 #endif /* __KERNEL__ */
238 #endif