]> git.baikalelectronics.ru Git - uboot.git/commitdiff
x86: Adjust bootparam.h to be more like linux
authorSimon Glass <sjg@chromium.org>
Sun, 19 Mar 2023 19:30:06 +0000 (08:30 +1300)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 25 Mar 2023 10:07:21 +0000 (11:07 +0100)
This likely came from Linux originally, so update it to match v6.2 more.
This has no functional change.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/x86/include/asm/bootparam.h
arch/x86/lib/zimage.c

index 7a3c1f515544dd1e50eaa816396a98c2f62de9a8..ea816ca7469882be997e9c8ddd7e8f27ab63a0b4 100644 (file)
@@ -9,19 +9,54 @@
 #include <asm/ist.h>
 #include <asm/video/edid.h>
 
-/* setup data types */
-enum {
-       SETUP_NONE = 0,
-       SETUP_E820_EXT,
-       SETUP_DTB,
-};
+/* setup_data/setup_indirect types */
+#define SETUP_NONE                     0
+#define SETUP_E820_EXT                 1
+#define SETUP_DTB                      2
+#define SETUP_PCI                      3
+#define SETUP_EFI                      4
+#define SETUP_APPLE_PROPERTIES         5
+#define SETUP_JAILHOUSE                        6
+#define SETUP_CC_BLOB                  7
+#define SETUP_IMA                      8
+#define SETUP_RNG_SEED                 9
+#define SETUP_ENUM_MAX                 SETUP_RNG_SEED
+
+#define SETUP_INDIRECT                 BIT(31)
+#define SETUP_TYPE_MAX                 (SETUP_ENUM_MAX | SETUP_INDIRECT)
+
+/* ram_size flags */
+#define RAMDISK_IMAGE_START_MASK       0x07FF
+#define RAMDISK_PROMPT_FLAG            0x8000
+#define RAMDISK_LOAD_FLAG              0x4000
+
+/* loadflags */
+#define LOADED_HIGH    BIT(0)
+#define KASLR_FLAG     BIT(1)
+#define QUIET_FLAG     BIT(5)
+#define KEEP_SEGMENTS  BIT(6)
+#define CAN_USE_HEAP   BIT(7)
+
+#define XLF_KERNEL_64                  BIT(0)
+#define XLF_CAN_BE_LOADED_ABOVE_4G     BIT(1)
+#define XLF_EFI_HANDOVER_32            BIT(2)
+#define XLF_EFI_HANDOVER_64            BIT(3)
+#define XLF_EFI_KEXEC                  BIT(4)
 
 /* extensible setup data list node */
 struct setup_data {
        __u64 next;
        __u32 type;
        __u32 len;
-       __u8 data[0];
+       __u8 data[];
+};
+
+/* extensible setup indirect data node */
+struct setup_indirect {
+       __u32 type;
+       __u32 reserved;  /* Reserved, must be set to zero. */
+       __u64 len;
+       __u64 addr;
 };
 
 /**
@@ -34,9 +69,6 @@ struct setup_header {
        __u16   root_flags;
        __u32   syssize;
        __u16   ram_size;
-#define RAMDISK_IMAGE_START_MASK       0x07FF
-#define RAMDISK_PROMPT_FLAG            0x8000
-#define RAMDISK_LOAD_FLAG              0x4000
        __u16   vid_mode;
        __u16   root_dev;
        __u16   boot_flag;
@@ -44,15 +76,10 @@ struct setup_header {
        __u32   header;
        __u16   version;
        __u32   realmode_swtch;
-       __u16   start_sys;
+       __u16   start_sys_seg;
        __u16   kernel_version;
        __u8    type_of_loader;
        __u8    loadflags;
-#define LOADED_HIGH    BIT(0)
-#define KASLR_FLAG     BIT(1)
-#define QUIET_FLAG     BIT(5)
-#define KEEP_SEGMENTS  BIT(6)          /* Obsolete */
-#define CAN_USE_HEAP   BIT(7)
        __u16   setup_move_size;
        __u32   code32_start;
        __u32   ramdisk_image;
@@ -65,13 +92,8 @@ struct setup_header {
        __u32   initrd_addr_max;
        __u32   kernel_alignment;
        __u8    relocatable_kernel;
-       u8      min_alignment;
-#define XLF_KERNEL_64                  BIT(0)
-#define XLF_CAN_BE_LOADED_ABOVE_4G     BIT(1)
-#define XLF_EFI_HANDOVER_32            BIT(2)
-#define XLF_EFI_HANDOVER_64            BIT(3)
-#define XLF_EFI_KEXEC                  BIT(4)
-       u16     xloadflags;
+       __u8    min_alignment;
+       __u16   xloadflags;
        __u32   cmdline_size;
        __u32   hardware_subarch;
        __u64   hardware_subarch_data;
@@ -81,7 +103,7 @@ struct setup_header {
        __u64   pref_address;
        __u32   init_size;
        __u32   handover_offset;
-       u32     kernel_info_offset;
+       __u32   kernel_info_offset;
 } __attribute__((packed));
 
 struct sys_desc_table {
index 9cc04490307c7069b3b74e06aad97a57060a7864..a6d9151c32408bdbd031696e5714a70c6a9b0145 100644 (file)
@@ -655,7 +655,7 @@ void zimage_dump(struct boot_params *base_ptr)
                printf("%-20s  %s\n", "", "Ancient kernel, using version 100");
        print_num("Version", hdr->version);
        print_num("Real mode switch", hdr->realmode_swtch);
-       print_num("Start sys", hdr->start_sys);
+       print_num("Start sys seg", hdr->start_sys_seg);
        print_num("Kernel version", hdr->kernel_version);
        version = get_kernel_version(base_ptr, (void *)state.bzimage_addr);
        if (version)