Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  *  linux/include/asm/setup.h
0004  *
0005  *  Copyright (C) 1997-1999 Russell King
0006  *
0007  * This program is free software; you can redistribute it and/or modify
0008  * it under the terms of the GNU General Public License version 2 as
0009  * published by the Free Software Foundation.
0010  *
0011  *  Structure passed to kernel to tell it about the
0012  *  hardware it's running on.  See Documentation/arm/setup.rst
0013  *  for more info.
0014  */
0015 #ifndef _UAPI__ASMARM_SETUP_H
0016 #define _UAPI__ASMARM_SETUP_H
0017 
0018 #include <linux/types.h>
0019 
0020 #define COMMAND_LINE_SIZE 1024
0021 
0022 /* The list ends with an ATAG_NONE node. */
0023 #define ATAG_NONE   0x00000000
0024 
0025 struct tag_header {
0026     __u32 size;
0027     __u32 tag;
0028 };
0029 
0030 /* The list must start with an ATAG_CORE node */
0031 #define ATAG_CORE   0x54410001
0032 
0033 struct tag_core {
0034     __u32 flags;        /* bit 0 = read-only */
0035     __u32 pagesize;
0036     __u32 rootdev;
0037 };
0038 
0039 /* it is allowed to have multiple ATAG_MEM nodes */
0040 #define ATAG_MEM    0x54410002
0041 
0042 struct tag_mem32 {
0043     __u32   size;
0044     __u32   start;  /* physical start address */
0045 };
0046 
0047 /* VGA text type displays */
0048 #define ATAG_VIDEOTEXT  0x54410003
0049 
0050 struct tag_videotext {
0051     __u8        x;
0052     __u8        y;
0053     __u16       video_page;
0054     __u8        video_mode;
0055     __u8        video_cols;
0056     __u16       video_ega_bx;
0057     __u8        video_lines;
0058     __u8        video_isvga;
0059     __u16       video_points;
0060 };
0061 
0062 /* describes how the ramdisk will be used in kernel */
0063 #define ATAG_RAMDISK    0x54410004
0064 
0065 struct tag_ramdisk {
0066     __u32 flags;    /* bit 0 = load, bit 1 = prompt */
0067     __u32 size; /* decompressed ramdisk size in _kilo_ bytes */
0068     __u32 start;    /* starting block of floppy-based RAM disk image */
0069 };
0070 
0071 /* describes where the compressed ramdisk image lives (virtual address) */
0072 /*
0073  * this one accidentally used virtual addresses - as such,
0074  * it's deprecated.
0075  */
0076 #define ATAG_INITRD 0x54410005
0077 
0078 /* describes where the compressed ramdisk image lives (physical address) */
0079 #define ATAG_INITRD2    0x54420005
0080 
0081 struct tag_initrd {
0082     __u32 start;    /* physical start address */
0083     __u32 size; /* size of compressed ramdisk image in bytes */
0084 };
0085 
0086 /* board serial number. "64 bits should be enough for everybody" */
0087 #define ATAG_SERIAL 0x54410006
0088 
0089 struct tag_serialnr {
0090     __u32 low;
0091     __u32 high;
0092 };
0093 
0094 /* board revision */
0095 #define ATAG_REVISION   0x54410007
0096 
0097 struct tag_revision {
0098     __u32 rev;
0099 };
0100 
0101 /* initial values for vesafb-type framebuffers. see struct screen_info
0102  * in include/linux/tty.h
0103  */
0104 #define ATAG_VIDEOLFB   0x54410008
0105 
0106 struct tag_videolfb {
0107     __u16       lfb_width;
0108     __u16       lfb_height;
0109     __u16       lfb_depth;
0110     __u16       lfb_linelength;
0111     __u32       lfb_base;
0112     __u32       lfb_size;
0113     __u8        red_size;
0114     __u8        red_pos;
0115     __u8        green_size;
0116     __u8        green_pos;
0117     __u8        blue_size;
0118     __u8        blue_pos;
0119     __u8        rsvd_size;
0120     __u8        rsvd_pos;
0121 };
0122 
0123 /* command line: \0 terminated string */
0124 #define ATAG_CMDLINE    0x54410009
0125 
0126 struct tag_cmdline {
0127     char    cmdline[1]; /* this is the minimum size */
0128 };
0129 
0130 /* acorn RiscPC specific information */
0131 #define ATAG_ACORN  0x41000101
0132 
0133 struct tag_acorn {
0134     __u32 memc_control_reg;
0135     __u32 vram_pages;
0136     __u8 sounddefault;
0137     __u8 adfsdrives;
0138 };
0139 
0140 /* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
0141 #define ATAG_MEMCLK 0x41000402
0142 
0143 struct tag_memclk {
0144     __u32 fmemclk;
0145 };
0146 
0147 struct tag {
0148     struct tag_header hdr;
0149     union {
0150         struct tag_core     core;
0151         struct tag_mem32    mem;
0152         struct tag_videotext    videotext;
0153         struct tag_ramdisk  ramdisk;
0154         struct tag_initrd   initrd;
0155         struct tag_serialnr serialnr;
0156         struct tag_revision revision;
0157         struct tag_videolfb videolfb;
0158         struct tag_cmdline  cmdline;
0159 
0160         /*
0161          * Acorn specific
0162          */
0163         struct tag_acorn    acorn;
0164 
0165         /*
0166          * DC21285 specific
0167          */
0168         struct tag_memclk   memclk;
0169     } u;
0170 };
0171 
0172 struct tagtable {
0173     __u32 tag;
0174     int (*parse)(const struct tag *);
0175 };
0176 
0177 #define tag_member_present(tag,member)              \
0178     ((unsigned long)(&((struct tag *)0L)->member + 1)   \
0179         <= (tag)->hdr.size * 4)
0180 
0181 #define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
0182 #define tag_size(type)  ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
0183 
0184 #define for_each_tag(t,base)        \
0185     for (t = base; t->hdr.size; t = tag_next(t))
0186 
0187 
0188 #endif /* _UAPI__ASMARM_SETUP_H */