no longer use deprecated ATAG_INITRD
[linexec-j720] / setup.h
CommitLineData
c5f1f439 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
ae778613 11 * hardware it's running on. See Documentation/arm/Setup
c5f1f439 12 * for more info.
c5f1f439 13 */
14#ifndef __ASMARM_SETUP_H
ae778613 15#define __ASMARM_SETUP_H
16#define u32 UINT32
17#define u16 UINT16
18#define u8 UINT8
c5f1f439 19
c5f1f439 20#define COMMAND_LINE_SIZE 1024
21
c5f1f439 22/* The list ends with an ATAG_NONE node. */
23#define ATAG_NONE 0x00000000
24
25struct tag_header {
26 u32 size;
27 u32 tag;
28};
29
30/* The list must start with an ATAG_CORE node */
31#define ATAG_CORE 0x54410001
32
33struct tag_core {
34 u32 flags; /* bit 0 = read-only */
35 u32 pagesize;
36 u32 rootdev;
37};
38
39/* it is allowed to have multiple ATAG_MEM nodes */
40#define ATAG_MEM 0x54410002
41
42struct tag_mem32 {
43 u32 size;
44 u32 start; /* physical start address */
45};
46
47/* VGA text type displays */
48#define ATAG_VIDEOTEXT 0x54410003
49
50struct tag_videotext {
51 u8 x;
52 u8 y;
53 u16 video_page;
54 u8 video_mode;
55 u8 video_cols;
56 u16 video_ega_bx;
57 u8 video_lines;
58 u8 video_isvga;
59 u16 video_points;
60};
61
62/* describes how the ramdisk will be used in kernel */
63#define ATAG_RAMDISK 0x54410004
64
65struct tag_ramdisk {
66 u32 flags; /* bit 0 = load, bit 1 = prompt */
67 u32 size; /* decompressed ramdisk size in _kilo_ bytes */
68 u32 start; /* starting block of floppy-based RAM disk image */
69};
70
ae778613 71/* describes where the compressed ramdisk image lives (virtual address) */
72/*
73 * this one accidentally used virtual addresses - as such,
74 * it's deprecated.
75 */
76#define ATAG_INITRD 0x54410005
77
78/* describes where the compressed ramdisk image lives (physical address) */
c5f1f439 79#define ATAG_INITRD2 0x54420005
80
81struct tag_initrd {
82 u32 start; /* physical start address */
83 u32 size; /* size of compressed ramdisk image in bytes */
84};
85
86/* board serial number. "64 bits should be enough for everybody" */
87#define ATAG_SERIAL 0x54410006
88
89struct tag_serialnr {
90 u32 low;
91 u32 high;
92};
93
94/* board revision */
95#define ATAG_REVISION 0x54410007
96
97struct tag_revision {
98 u32 rev;
99};
100
101/* initial values for vesafb-type framebuffers. see struct screen_info
102 * in include/linux/tty.h
103 */
104#define ATAG_VIDEOLFB 0x54410008
105
106struct tag_videolfb {
107 u16 lfb_width;
108 u16 lfb_height;
109 u16 lfb_depth;
110 u16 lfb_linelength;
111 u32 lfb_base;
112 u32 lfb_size;
113 u8 red_size;
114 u8 red_pos;
115 u8 green_size;
116 u8 green_pos;
117 u8 blue_size;
118 u8 blue_pos;
119 u8 rsvd_size;
120 u8 rsvd_pos;
121};
122
123/* command line: \0 terminated string */
124#define ATAG_CMDLINE 0x54410009
125
126struct tag_cmdline {
127 char cmdline[1]; /* this is the minimum size */
128};
129
130/* acorn RiscPC specific information */
131#define ATAG_ACORN 0x41000101
132
133struct tag_acorn {
134 u32 memc_control_reg;
135 u32 vram_pages;
136 u8 sounddefault;
137 u8 adfsdrives;
138};
139
c5f1f439 140/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
141#define ATAG_MEMCLK 0x41000402
142
143struct tag_memclk {
144 u32 fmemclk;
145};
146
147struct tag {
148 struct tag_header hdr;
149 union {
150 struct tag_core core;
151 struct tag_mem32 mem;
152 struct tag_videotext videotext;
153 struct tag_ramdisk ramdisk;
154 struct tag_initrd initrd;
155 struct tag_serialnr serialnr;
156 struct tag_revision revision;
157 struct tag_videolfb videolfb;
158 struct tag_cmdline cmdline;
c5f1f439 159
160 /*
161 * Acorn specific
162 */
163 struct tag_acorn acorn;
164
165 /*
166 * DC21285 specific
167 */
168 struct tag_memclk memclk;
c5f1f439 169 } u;
170};
171
172struct tagtable {
173 u32 tag;
174 int (*parse)(const struct tag *);
175};
176
ae778613 177#define __tag __attribute_used__ __attribute__((__section__(".taglist")))
c5f1f439 178#define __tagtable(tag, fn) \
179static struct tagtable __tagtable_##fn __tag = { tag, fn }
180
181#define tag_member_present(tag,member) \
182 ((unsigned long)(&((struct tag *)0L)->member + 1) \
183 <= (tag)->hdr.size * 4)
184
185#define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
186#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
187
188#define for_each_tag(t,base) \
189 for (t = base; t->hdr.size; t = tag_next(t))
190
191/*
192 * Memory map description
193 */
ae778613 194#ifdef CONFIG_ARCH_LH7A40X
195# define NR_BANKS 16
196#else
197# define NR_BANKS 8
198#endif
c5f1f439 199
200struct meminfo {
201 int nr_banks;
c5f1f439 202 struct {
203 unsigned long start;
204 unsigned long size;
205 int node;
206 } bank[NR_BANKS];
207};
208
ae778613 209/*
210 * Early command line parameters.
211 */
212struct early_params {
213 const char *arg;
214 void (*fn)(char **p);
215};
216
217#define __early_param(name,fn) \
218static struct early_params __early_##fn __attribute_used__ \
219__attribute__((__section__("__early_param"))) = { name, fn }
c5f1f439 220
221#endif
Impressum, Datenschutz