]> git.sur5r.net Git - u-boot/blobdiff - arch/x86/include/asm/fw_cfg.h
x86: Rename PORT_RESET to IO_PORT_RESET
[u-boot] / arch / x86 / include / asm / fw_cfg.h
index 2acf43eb8163645ec93e08b55ecc23b40f2efbd4..e9450c619687f246fdb5f6d2d46305ab06751cb2 100644 (file)
@@ -47,11 +47,23 @@ enum qemu_fwcfg_items {
        FW_CFG_INVALID          = 0xffff,
 };
 
+enum {
+       BIOS_LINKER_LOADER_COMMAND_ALLOCATE     = 0x1,
+       BIOS_LINKER_LOADER_COMMAND_ADD_POINTER  = 0x2,
+       BIOS_LINKER_LOADER_COMMAND_ADD_CHECKSUM = 0x3,
+};
+
+enum {
+       BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH = 0x1,
+       BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG = 0x2,
+};
+
 #define FW_CFG_FILE_SLOTS      0x10
 #define FW_CFG_MAX_ENTRY       (FW_CFG_FILE_FIRST + FW_CFG_FILE_SLOTS)
 #define FW_CFG_ENTRY_MASK       ~(FW_CFG_WRITE_CHANNEL | FW_CFG_ARCH_LOCAL)
 
 #define FW_CFG_MAX_FILE_PATH   56
+#define BIOS_LINKER_LOADER_FILESZ FW_CFG_MAX_FILE_PATH
 
 #define QEMU_FW_CFG_SIGNATURE  (('Q' << 24) | ('E' << 16) | ('M' << 8) | 'U')
 
@@ -81,6 +93,55 @@ struct fw_cfg_dma_access {
        __be64 address;
 };
 
+struct bios_linker_entry {
+       __le32 command;
+       union {
+               /*
+                * COMMAND_ALLOCATE - allocate a table from @alloc.file
+                * subject to @alloc.align alignment (must be power of 2)
+                * and @alloc.zone (can be HIGH or FSEG) requirements.
+                *
+                * Must appear exactly once for each file, and before
+                * this file is referenced by any other command.
+                */
+               struct {
+                       char file[BIOS_LINKER_LOADER_FILESZ];
+                       __le32 align;
+                       uint8_t zone;
+               } alloc;
+
+               /*
+                * COMMAND_ADD_POINTER - patch the table (originating from
+                * @dest_file) at @pointer.offset, by adding a pointer to the
+                * table originating from @src_file. 1,2,4 or 8 byte unsigned
+                * addition is used depending on @pointer.size.
+                */
+               struct {
+                       char dest_file[BIOS_LINKER_LOADER_FILESZ];
+                       char src_file[BIOS_LINKER_LOADER_FILESZ];
+                       __le32 offset;
+                       uint8_t size;
+               } pointer;
+
+               /*
+                * COMMAND_ADD_CHECKSUM - calculate checksum of the range
+                * specified by @cksum_start and @cksum_length fields,
+                * and then add the value at @cksum.offset.
+                * Checksum simply sums -X for each byte X in the range
+                * using 8-bit math.
+                */
+               struct {
+                       char file[BIOS_LINKER_LOADER_FILESZ];
+                       __le32 offset;
+                       __le32 start;
+                       __le32 length;
+               } cksum;
+
+               /* padding */
+               char pad[124];
+       };
+} __packed;
+
 /**
  * Initialize QEMU fw_cfg interface
  */