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