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
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
29 /* The list must start with an ATAG_CORE node */
30 #define ATAG_CORE 0x54410001
33 __u32 flags; /* bit 0 = read-only */
38 /* it is allowed to have multiple ATAG_MEM nodes */
39 #define ATAG_MEM 0x54410002
43 __u32 start; /* physical start address */
46 /* VGA text type displays */
47 #define ATAG_VIDEOTEXT 0x54410003
49 struct tag_videotext {
61 /* describes how the ramdisk will be used in kernel */
62 #define ATAG_RAMDISK 0x54410004
65 __u32 flags; /* bit 0 = load, bit 1 = prompt */
66 __u32 size; /* decompressed ramdisk size in _kilo_ bytes */
67 __u32 start; /* starting block of floppy-based RAM disk image */
70 /* describes where the compressed ramdisk image lives (virtual address) */
72 * this one accidentally used virtual addresses - as such,
75 #define ATAG_INITRD 0x54410005
77 /* describes where the compressed ramdisk image lives (physical address) */
78 #define ATAG_INITRD2 0x54420005
81 __u32 start; /* physical start address */
82 __u32 size; /* size of compressed ramdisk image in bytes */
85 /* board serial number. "64 bits should be enough for everybody" */
86 #define ATAG_SERIAL 0x54410006
94 #define ATAG_REVISION 0x54410007
100 /* initial values for vesafb-type framebuffers. see struct screen_info
101 * in include/linux/tty.h
103 #define ATAG_VIDEOLFB 0x54410008
105 struct tag_videolfb {
109 __u16 lfb_linelength;
122 /* command line: \0 terminated string */
123 #define ATAG_CMDLINE 0x54410009
126 char cmdline[1]; /* this is the minimum size */
129 /* acorn RiscPC specific information */
130 #define ATAG_ACORN 0x41000101
133 __u32 memc_control_reg;
139 /* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
140 #define ATAG_MEMCLK 0x41000402
147 struct tag_header hdr;
149 struct tag_core core;
150 struct tag_mem32 mem;
151 struct tag_videotext videotext;
152 struct tag_ramdisk ramdisk;
153 struct tag_initrd initrd;
154 struct tag_serialnr serialnr;
155 struct tag_revision revision;
156 struct tag_videolfb videolfb;
157 struct tag_cmdline cmdline;
162 struct tag_acorn acorn;
167 struct tag_memclk memclk;
173 int (*parse)(const struct tag *);
176 #define tag_member_present(tag,member) \
177 ((unsigned long)(&((struct tag *)0L)->member + 1) \
178 <= (tag)->hdr.size * 4)
180 #define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
181 #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
183 #define for_each_tag(t,base) \
184 for (t = base; t->hdr.size; t = tag_next(t))
188 #define __tag __used __attribute__((__section__(".taglist.init")))
189 #define __tagtable(tag, fn) \
190 static struct tagtable __tagtable_##fn __tag = { tag, fn }
193 * Memory map description
195 #ifdef CONFIG_ARCH_LH7A40X
209 struct membank bank[NR_BANKS];
212 extern struct meminfo meminfo;
214 #define for_each_nodebank(iter,mi,no) \
215 for (iter = 0; iter < (mi)->nr_banks; iter++) \
216 if ((mi)->bank[iter].node == no)
218 #define bank_pfn_start(bank) __phys_to_pfn((bank)->start)
219 #define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size)
220 #define bank_pfn_size(bank) ((bank)->size >> PAGE_SHIFT)
221 #define bank_phys_start(bank) (bank)->start
222 #define bank_phys_end(bank) ((bank)->start + (bank)->size)
223 #define bank_phys_size(bank) (bank)->size
226 * Early command line parameters.
228 struct early_params {
230 void (*fn)(char **p);
233 #define __early_param(name,fn) \
234 static struct early_params __early_##fn __used \
235 __attribute__((__section__(".early_param.init"))) = { name, fn }
237 #endif /* __KERNEL__ */