2 * linux/arch/nds32/include/asm/setup.h
4 * Copyright (C) 1997-1999 Russell King
5 * Copyright (C) 2008 Andes Technology Corporation
6 * Copyright (C) 2013 Ken Kuo (ken_kuo@andestech.com)
8 * SPDX-License-Identifier: GPL-2.0
10 * Structure passed to kernel to tell it about the
11 * hardware it's running on. See Documentation/arm/Setup
14 #ifndef __ASMNDS32_SETUP_H
15 #define __ASMNDS32_SETUP_H
17 #define COMMAND_LINE_SIZE 256
19 /* The list ends with an ATAG_NONE node. */
20 #define ATAG_NONE 0x00000000
27 /* The list must start with an ATAG_CORE node */
28 #define ATAG_CORE 0x54410001
31 u32 flags; /* bit 0 = read-only */
36 /* it is allowed to have multiple ATAG_MEM nodes */
37 #define ATAG_MEM 0x54410002
41 u32 start; /* physical start address */
44 /* VGA text type displays */
45 #define ATAG_VIDEOTEXT 0x54410003
47 struct tag_videotext {
59 /* describes how the ramdisk will be used in kernel */
60 #define ATAG_RAMDISK 0x54410004
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 */
69 * this one accidentally used virtual addresses - as such,
71 * describes where the compressed ramdisk image lives (virtual address)
73 #define ATAG_INITRD 0x54410005
75 /* describes where the compressed ramdisk image lives (physical address) */
76 #define ATAG_INITRD2 0x54420005
79 u32 start; /* physical start address */
80 u32 size; /* size of compressed ramdisk image in bytes */
83 /* board serial number. "64 bits should be enough for everybody" */
84 #define ATAG_SERIAL 0x54410006
92 #define ATAG_REVISION 0x54410007
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 {
120 /* command line: \0 terminated string */
121 #define ATAG_CMDLINE 0x54410009
124 char cmdline[COMMAND_LINE_SIZE];
128 struct tag_header hdr;
130 struct tag_core core;
131 struct tag_mem32 mem;
132 struct tag_videotext videotext;
133 struct tag_ramdisk ramdisk;
134 struct tag_initrd initrd;
135 struct tag_serialnr serialnr;
136 struct tag_revision revision;
137 struct tag_videolfb videolfb;
138 struct tag_cmdline cmdline;
144 int (*parse)(const struct tag *);
147 #define tag_member_present(tag, member) \
148 ((unsigned long)(&((struct tag *)0L)->member + 1) \
149 <= (tag)->hdr.size * 4)
151 #define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
152 #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
154 #define for_each_tag(t, base) \
155 for (t = base; t->hdr.size; t = tag_next(t))
159 #define __tag __used __attribute__((__section__(".taglist")))
160 #define __tagtable(tag, fn) \
161 static struct tagtable __tagtable_##fn __tag = { tag, fn }
164 * Memory map description
178 * Early command line parameters.
180 struct early_params {
182 void (*fn)(char **p);
185 #define __early_param(name, fn) \
186 static struct early_params __early_##fn __used \
187 __attribute__((__section__("__early_param"))) = { name, fn }