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