setup.h 4.9 KB

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