setup.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * linux/include/asm/setup.h
  4. *
  5. * Copyright (C) 1997-1999 Russell King
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * Structure passed to kernel to tell it about the
  12. * hardware it's running on. See Documentation/arm/Setup
  13. * for more info.
  14. */
  15. #ifndef _UAPI__ASMARM_SETUP_H
  16. #define _UAPI__ASMARM_SETUP_H
  17. #include <linux/types.h>
  18. #define COMMAND_LINE_SIZE 1024
  19. /* The list ends with an ATAG_NONE node. */
  20. #define ATAG_NONE 0x00000000
  21. struct tag_header {
  22. __u32 size;
  23. __u32 tag;
  24. };
  25. /* The list must start with an ATAG_CORE node */
  26. #define ATAG_CORE 0x54410001
  27. struct tag_core {
  28. __u32 flags; /* bit 0 = read-only */
  29. __u32 pagesize;
  30. __u32 rootdev;
  31. };
  32. /* it is allowed to have multiple ATAG_MEM nodes */
  33. #define ATAG_MEM 0x54410002
  34. struct tag_mem32 {
  35. __u32 size;
  36. __u32 start; /* physical start address */
  37. };
  38. /* VGA text type displays */
  39. #define ATAG_VIDEOTEXT 0x54410003
  40. struct tag_videotext {
  41. __u8 x;
  42. __u8 y;
  43. __u16 video_page;
  44. __u8 video_mode;
  45. __u8 video_cols;
  46. __u16 video_ega_bx;
  47. __u8 video_lines;
  48. __u8 video_isvga;
  49. __u16 video_points;
  50. };
  51. /* describes how the ramdisk will be used in kernel */
  52. #define ATAG_RAMDISK 0x54410004
  53. struct tag_ramdisk {
  54. __u32 flags; /* bit 0 = load, bit 1 = prompt */
  55. __u32 size; /* decompressed ramdisk size in _kilo_ bytes */
  56. __u32 start; /* starting block of floppy-based RAM disk image */
  57. };
  58. /* describes where the compressed ramdisk image lives (virtual address) */
  59. /*
  60. * this one accidentally used virtual addresses - as such,
  61. * it's deprecated.
  62. */
  63. #define ATAG_INITRD 0x54410005
  64. /* describes where the compressed ramdisk image lives (physical address) */
  65. #define ATAG_INITRD2 0x54420005
  66. struct tag_initrd {
  67. __u32 start; /* physical start address */
  68. __u32 size; /* size of compressed ramdisk image in bytes */
  69. };
  70. /* board serial number. "64 bits should be enough for everybody" */
  71. #define ATAG_SERIAL 0x54410006
  72. struct tag_serialnr {
  73. __u32 low;
  74. __u32 high;
  75. };
  76. /* board revision */
  77. #define ATAG_REVISION 0x54410007
  78. struct tag_revision {
  79. __u32 rev;
  80. };
  81. /* initial values for vesafb-type framebuffers. see struct screen_info
  82. * in include/linux/tty.h
  83. */
  84. #define ATAG_VIDEOLFB 0x54410008
  85. struct tag_videolfb {
  86. __u16 lfb_width;
  87. __u16 lfb_height;
  88. __u16 lfb_depth;
  89. __u16 lfb_linelength;
  90. __u32 lfb_base;
  91. __u32 lfb_size;
  92. __u8 red_size;
  93. __u8 red_pos;
  94. __u8 green_size;
  95. __u8 green_pos;
  96. __u8 blue_size;
  97. __u8 blue_pos;
  98. __u8 rsvd_size;
  99. __u8 rsvd_pos;
  100. };
  101. /* command line: \0 terminated string */
  102. #define ATAG_CMDLINE 0x54410009
  103. struct tag_cmdline {
  104. char cmdline[1]; /* this is the minimum size */
  105. };
  106. /* acorn RiscPC specific information */
  107. #define ATAG_ACORN 0x41000101
  108. struct tag_acorn {
  109. __u32 memc_control_reg;
  110. __u32 vram_pages;
  111. __u8 sounddefault;
  112. __u8 adfsdrives;
  113. };
  114. /* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
  115. #define ATAG_MEMCLK 0x41000402
  116. struct tag_memclk {
  117. __u32 fmemclk;
  118. };
  119. struct tag {
  120. struct tag_header hdr;
  121. union {
  122. struct tag_core core;
  123. struct tag_mem32 mem;
  124. struct tag_videotext videotext;
  125. struct tag_ramdisk ramdisk;
  126. struct tag_initrd initrd;
  127. struct tag_serialnr serialnr;
  128. struct tag_revision revision;
  129. struct tag_videolfb videolfb;
  130. struct tag_cmdline cmdline;
  131. /*
  132. * Acorn specific
  133. */
  134. struct tag_acorn acorn;
  135. /*
  136. * DC21285 specific
  137. */
  138. struct tag_memclk memclk;
  139. } u;
  140. };
  141. struct tagtable {
  142. __u32 tag;
  143. int (*parse)(const struct tag *);
  144. };
  145. #define tag_member_present(tag,member) \
  146. ((unsigned long)(&((struct tag *)0L)->member + 1) \
  147. <= (tag)->hdr.size * 4)
  148. #define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
  149. #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
  150. #define for_each_tag(t,base) \
  151. for (t = base; t->hdr.size; t = tag_next(t))
  152. #endif /* _UAPI__ASMARM_SETUP_H */