setup.h 6.2 KB

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