Delete platform directory from sun4i target
[AROS.git] / arch / arm-sun4i / boot / atags.h
blob42f6045f56734207464471dba0bc098325693525
1 /*
2 Copyright © 2014, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
9 #ifndef ATAGS_H_
10 #define ATAGS_H_
12 #include <inttypes.h>
14 typedef uint16_t uint16_t;
15 typedef uint8_t uint8_t;
17 #define COMMAND_LINE_SIZE 1024
19 /* The list ends with an ATAG_NONE node. */
20 #define ATAG_NONE 0x00000000
22 struct tag_header {
23 uint32_t size;
24 uint32_t tag;
27 /* The list must start with an ATAG_CORE node */
28 #define ATAG_CORE 0x54410001
30 struct tag_core {
31 uint32_t flags; /* bit 0 = read-only */
32 uint32_t pagesize;
33 uint32_t rootdev;
36 /* it is allowed to have multiple ATAG_MEM nodes */
37 #define ATAG_MEM 0x54410002
39 struct tag_mem32 {
40 uint32_t size;
41 uint32_t start; /* physical start address */
44 /* VGA text type displays */
45 #define ATAG_VIDEOTEXT 0x54410003
47 struct tag_videotext {
48 uint8_t x;
49 uint8_t y;
50 uint16_t video_page;
51 uint8_t video_mode;
52 uint8_t video_cols;
53 uint16_t video_ega_bx;
54 uint8_t video_lines;
55 uint8_t video_isvga;
56 uint16_t video_points;
59 /* describes how the ramdisk will be used in kernel */
60 #define ATAG_RAMDISK 0x54410004
62 struct tag_ramdisk {
63 uint32_t flags; /* bit 0 = load, bit 1 = prompt */
64 uint32_t size; /* decompressed ramdisk size in _kilo_ bytes */
65 uint32_t start; /* starting block of floppy-based RAM disk image */
68 /* describes where the compressed ramdisk image lives (virtual address) */
70 * this one accidentally used virtual addresses - as such,
71 * it's deprecated.
73 #define ATAG_INITRD 0x54410005
75 /* describes where the compressed ramdisk image lives (physical address) */
76 #define ATAG_INITRD2 0x54420005
78 struct tag_initrd {
79 uint32_t start; /* physical start address */
80 uint32_t size; /* size of compressed ramdisk image in bytes */
83 /* board serial number. "64 bits should be enough for everybody" */
84 #define ATAG_SERIAL 0x54410006
86 struct tag_serialnr {
87 uint32_t low;
88 uint32_t high;
91 /* board revision */
92 #define ATAG_REVISION 0x54410007
94 struct tag_revision {
95 uint32_t rev;
98 /* initial values for vesafb-type framebuffers. see struct screen_info
99 * in include/linux/tty.h
101 #define ATAG_VIDEOLFB 0x54410008
103 struct tag_videolfb {
104 uint16_t lfb_width;
105 uint16_t lfb_height;
106 uint16_t lfb_depth;
107 uint16_t lfb_linelength;
108 uint32_t lfb_base;
109 uint32_t lfb_size;
110 uint8_t red_size;
111 uint8_t red_pos;
112 uint8_t green_size;
113 uint8_t green_pos;
114 uint8_t blue_size;
115 uint8_t blue_pos;
116 uint8_t rsvd_size;
117 uint8_t rsvd_pos;
120 /* command line: \0 terminated string */
121 #define ATAG_CMDLINE 0x54410009
123 struct tag_cmdline {
124 char cmdline[1]; /* this is the minimum size */
127 /* acorn RiscPC specific information */
128 #define ATAG_ACORN 0x41000101
130 struct tag_acorn {
131 uint32_t memc_control_reg;
132 uint32_t vram_pages;
133 uint8_t sounddefault;
134 uint8_t adfsdrives;
137 /* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
138 #define ATAG_MEMCLK 0x41000402
140 struct tag_memclk {
141 uint32_t fmemclk;
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;
158 * Acorn specific
160 struct tag_acorn acorn;
163 * DC21285 specific
165 struct tag_memclk memclk;
166 } u;
169 #define tag_member_present(tag,member) \
170 ((unsigned long)(&((struct tag *)0L)->member + 1) \
171 <= (tag)->hdr.size * 4)
173 #define tag_next(t) ((struct tag *)((uint32_t *)(t) + (t)->hdr.size))
174 #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
176 #define for_each_tag(t,base) \
177 for (t = base; t->hdr.size; t = tag_next(t))
180 #endif /* ATAGS_H_ */