]> git.zerfleddert.de Git - linexec-j720/blob - setup.h
1bc06c88164d47c74745bbe036630f63a648d26a
[linexec-j720] / setup.h
1 /*
2 * linux/include/asm/setup.h
3 *
4 * Copyright (C) 1997-1999 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 * Structure passed to kernel to tell it about the
11 * hardware it's running on. See linux/Documentation/arm/Setup
12 * for more info.
13 *
14 * NOTE:
15 * This file contains two ways to pass information from the boot
16 * loader to the kernel. The old struct param_struct is deprecated,
17 * but it will be kept in the kernel for 5 years from now
18 * (2001). This will allow boot loaders to convert to the new struct
19 * tag way.
20 */
21 #ifndef __ASMARM_SETUP_H
22 #define __ASMARM_SETUP_H
23
24 #define u32 UINT32
25 #define u16 UINT16
26 #define u8 UINT8
27
28
29 /*#ifndef CONFIG_ACCEPT_GPL
30 #error This file covered by GPL but CONFIG_ACCEPT_GPL undefined.
31 #endif*/
32
33 /*
34 * Usage:
35 * - do not go blindly adding fields, add them at the end
36 * - when adding fields, don't rely on the address until
37 * a patch from me has been released
38 * - unused fields should be zero (for future expansion)
39 * - this structure is relatively short-lived - only
40 * guaranteed to contain useful data in setup_arch()
41 */
42 #define COMMAND_LINE_SIZE 1024
43
44 /* This is the old deprecated way to pass parameters to the kernel */
45 struct param_struct {
46 union {
47 struct {
48 unsigned long page_size; /* 0 */
49 unsigned long nr_pages; /* 4 */
50 unsigned long ramdisk_size; /* 8 */
51 unsigned long flags; /* 12 */
52 #define FLAG_READONLY 1
53 #define FLAG_RDLOAD 4
54 #define FLAG_RDPROMPT 8
55 unsigned long rootdev; /* 16 */
56 unsigned long video_num_cols; /* 20 */
57 unsigned long video_num_rows; /* 24 */
58 unsigned long video_x; /* 28 */
59 unsigned long video_y; /* 32 */
60 unsigned long memc_control_reg; /* 36 */
61 unsigned char sounddefault; /* 40 */
62 unsigned char adfsdrives; /* 41 */
63 unsigned char bytes_per_char_h; /* 42 */
64 unsigned char bytes_per_char_v; /* 43 */
65 unsigned long pages_in_bank[4]; /* 44 */
66 unsigned long pages_in_vram; /* 60 */
67 unsigned long initrd_start; /* 64 */
68 unsigned long initrd_size; /* 68 */
69 unsigned long rd_start; /* 72 */
70 unsigned long system_rev; /* 76 */
71 unsigned long system_serial_low; /* 80 */
72 unsigned long system_serial_high; /* 84 */
73 unsigned long mem_fclk_21285; /* 88 */
74 } s;
75 char unused[256];
76 } u1;
77 union {
78 char paths[8][128];
79 struct {
80 unsigned long magic;
81 char n[1024 - sizeof(unsigned long)];
82 } s;
83 } u2;
84 char commandline[COMMAND_LINE_SIZE];
85 };
86
87
88
89 /*
90 * The new way of passing information: a list of tagged entries
91 */
92
93 /* The list ends with an ATAG_NONE node. */
94 #define ATAG_NONE 0x00000000
95
96 struct tag_header {
97 u32 size;
98 u32 tag;
99 };
100
101 /* The list must start with an ATAG_CORE node */
102 #define ATAG_CORE 0x54410001
103
104 struct tag_core {
105 u32 flags; /* bit 0 = read-only */
106 u32 pagesize;
107 u32 rootdev;
108 };
109
110 /* it is allowed to have multiple ATAG_MEM nodes */
111 #define ATAG_MEM 0x54410002
112
113 struct tag_mem32 {
114 u32 size;
115 u32 start; /* physical start address */
116 };
117
118 /* VGA text type displays */
119 #define ATAG_VIDEOTEXT 0x54410003
120
121 struct tag_videotext {
122 u8 x;
123 u8 y;
124 u16 video_page;
125 u8 video_mode;
126 u8 video_cols;
127 u16 video_ega_bx;
128 u8 video_lines;
129 u8 video_isvga;
130 u16 video_points;
131 };
132
133 /* describes how the ramdisk will be used in kernel */
134 #define ATAG_RAMDISK 0x54410004
135
136 struct tag_ramdisk {
137 u32 flags; /* bit 0 = load, bit 1 = prompt */
138 u32 size; /* decompressed ramdisk size in _kilo_ bytes */
139 u32 start; /* starting block of floppy-based RAM disk image */
140 };
141
142 /* describes where the compressed ramdisk image lives */
143 #define ATAG_INITRD 0x54410005
144
145 #define ATAG_INITRD2 0x54420005
146
147 struct tag_initrd {
148 u32 start; /* physical start address */
149 u32 size; /* size of compressed ramdisk image in bytes */
150 };
151
152 /* board serial number. "64 bits should be enough for everybody" */
153 #define ATAG_SERIAL 0x54410006
154
155 struct tag_serialnr {
156 u32 low;
157 u32 high;
158 };
159
160 /* board revision */
161 #define ATAG_REVISION 0x54410007
162
163 struct tag_revision {
164 u32 rev;
165 };
166
167 /* initial values for vesafb-type framebuffers. see struct screen_info
168 * in include/linux/tty.h
169 */
170 #define ATAG_VIDEOLFB 0x54410008
171
172 struct tag_videolfb {
173 u16 lfb_width;
174 u16 lfb_height;
175 u16 lfb_depth;
176 u16 lfb_linelength;
177 u32 lfb_base;
178 u32 lfb_size;
179 u8 red_size;
180 u8 red_pos;
181 u8 green_size;
182 u8 green_pos;
183 u8 blue_size;
184 u8 blue_pos;
185 u8 rsvd_size;
186 u8 rsvd_pos;
187 };
188
189 /* command line: \0 terminated string */
190 #define ATAG_CMDLINE 0x54410009
191
192 struct tag_cmdline {
193 char cmdline[1]; /* this is the minimum size */
194 };
195
196 /* acorn RiscPC specific information */
197 #define ATAG_ACORN 0x41000101
198
199 struct tag_acorn {
200 u32 memc_control_reg;
201 u32 vram_pages;
202 u8 sounddefault;
203 u8 adfsdrives;
204 };
205
206 #define ATAG_PTABLE 0x53410001
207
208 /* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
209 #define ATAG_MEMCLK 0x41000402
210
211 struct tag_memclk {
212 u32 fmemclk;
213 };
214
215 struct tag {
216 struct tag_header hdr;
217 union {
218 struct tag_core core;
219 struct tag_mem32 mem;
220 struct tag_videotext videotext;
221 struct tag_ramdisk ramdisk;
222 struct tag_initrd initrd;
223 struct tag_serialnr serialnr;
224 struct tag_revision revision;
225 struct tag_videolfb videolfb;
226 struct tag_cmdline cmdline;
227 // struct tag_ptable ptable;
228
229 /*
230 * Acorn specific
231 */
232 struct tag_acorn acorn;
233
234 /*
235 * DC21285 specific
236 */
237 struct tag_memclk memclk;
238
239 } u;
240 };
241
242 struct tagtable {
243 u32 tag;
244 int (*parse)(const struct tag *);
245 };
246
247 #define __tag __attribute__((unused, __section__(".taglist")))
248 #define __tagtable(tag, fn) \
249 static struct tagtable __tagtable_##fn __tag = { tag, fn }
250
251 #define tag_member_present(tag,member) \
252 ((unsigned long)(&((struct tag *)0L)->member + 1) \
253 <= (tag)->hdr.size * 4)
254
255 #define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
256 #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
257
258 #define for_each_tag(t,base) \
259 for (t = base; t->hdr.size; t = tag_next(t))
260
261 /*
262 * Memory map description
263 */
264 #define NR_BANKS 8
265
266 struct meminfo {
267 int nr_banks;
268 unsigned long end;
269 struct {
270 unsigned long start;
271 unsigned long size;
272 int node;
273 } bank[NR_BANKS];
274 };
275
276 extern struct meminfo meminfo;
277
278 #endif
Impressum, Datenschutz