Gerd Hoffmann | 2b96203 | 2013-05-30 15:41:48 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This are the qemu firmware config interface defines and structs. |
| 3 | * Copyed over from qemu soure tree, include/hw/nvram/fw_cfg.h |
| 4 | */ |
| 5 | |
| 6 | #define FW_CFG_SIGNATURE 0x00 |
| 7 | #define FW_CFG_ID 0x01 |
| 8 | #define FW_CFG_UUID 0x02 |
| 9 | #define FW_CFG_RAM_SIZE 0x03 |
| 10 | #define FW_CFG_NOGRAPHIC 0x04 |
| 11 | #define FW_CFG_NB_CPUS 0x05 |
| 12 | #define FW_CFG_MACHINE_ID 0x06 |
| 13 | #define FW_CFG_KERNEL_ADDR 0x07 |
| 14 | #define FW_CFG_KERNEL_SIZE 0x08 |
| 15 | #define FW_CFG_KERNEL_CMDLINE 0x09 |
| 16 | #define FW_CFG_INITRD_ADDR 0x0a |
| 17 | #define FW_CFG_INITRD_SIZE 0x0b |
| 18 | #define FW_CFG_BOOT_DEVICE 0x0c |
| 19 | #define FW_CFG_NUMA 0x0d |
| 20 | #define FW_CFG_BOOT_MENU 0x0e |
| 21 | #define FW_CFG_MAX_CPUS 0x0f |
| 22 | #define FW_CFG_KERNEL_ENTRY 0x10 |
| 23 | #define FW_CFG_KERNEL_DATA 0x11 |
| 24 | #define FW_CFG_INITRD_DATA 0x12 |
| 25 | #define FW_CFG_CMDLINE_ADDR 0x13 |
| 26 | #define FW_CFG_CMDLINE_SIZE 0x14 |
| 27 | #define FW_CFG_CMDLINE_DATA 0x15 |
| 28 | #define FW_CFG_SETUP_ADDR 0x16 |
| 29 | #define FW_CFG_SETUP_SIZE 0x17 |
| 30 | #define FW_CFG_SETUP_DATA 0x18 |
| 31 | #define FW_CFG_FILE_DIR 0x19 |
| 32 | |
| 33 | #define FW_CFG_FILE_FIRST 0x20 |
| 34 | #define FW_CFG_FILE_SLOTS 0x10 |
| 35 | #define FW_CFG_MAX_ENTRY (FW_CFG_FILE_FIRST+FW_CFG_FILE_SLOTS) |
| 36 | |
| 37 | #define FW_CFG_WRITE_CHANNEL 0x4000 |
| 38 | #define FW_CFG_ARCH_LOCAL 0x8000 |
| 39 | #define FW_CFG_ENTRY_MASK ~(FW_CFG_WRITE_CHANNEL | FW_CFG_ARCH_LOCAL) |
| 40 | |
Gerd Hoffmann | e851a68 | 2013-11-13 12:56:30 +0100 | [diff] [blame] | 41 | #define FW_CFG_ACPI_TABLES (FW_CFG_ARCH_LOCAL + 0) |
| 42 | #define FW_CFG_SMBIOS_ENTRIES (FW_CFG_ARCH_LOCAL + 1) |
| 43 | #define FW_CFG_IRQ0_OVERRIDE (FW_CFG_ARCH_LOCAL + 2) |
| 44 | #define FW_CFG_E820_TABLE (FW_CFG_ARCH_LOCAL + 3) |
| 45 | #define FW_CFG_HPET (FW_CFG_ARCH_LOCAL + 4) |
| 46 | |
Gerd Hoffmann | 2b96203 | 2013-05-30 15:41:48 +0200 | [diff] [blame] | 47 | #define FW_CFG_INVALID 0xffff |
| 48 | |
| 49 | typedef struct FWCfgFile { |
| 50 | uint32_t size; /* file size */ |
| 51 | uint16_t select; /* write this to 0x510 to read it */ |
| 52 | uint16_t reserved; |
| 53 | char name[56]; |
| 54 | } FWCfgFile; |
| 55 | |
| 56 | typedef struct FWCfgFiles { |
| 57 | uint32_t count; |
| 58 | FWCfgFile f[]; |
| 59 | } FWCfgFiles; |
Gerd Hoffmann | baa7820 | 2013-11-06 14:36:17 +0100 | [diff] [blame] | 60 | |
| 61 | typedef struct FwCfgE820Entry { |
| 62 | uint64_t address; |
| 63 | uint64_t length; |
| 64 | uint32_t type; |
| 65 | } FwCfgE820Entry __attribute((__aligned__(4))); |
Gerd Hoffmann | e851a68 | 2013-11-13 12:56:30 +0100 | [diff] [blame] | 66 | |
| 67 | |
| 68 | #define SMBIOS_FIELD_ENTRY 0 |
| 69 | #define SMBIOS_TABLE_ENTRY 1 |
| 70 | |
| 71 | typedef struct FwCfgSmbios { |
| 72 | uint16_t length; |
| 73 | uint8_t headertype; |
| 74 | uint8_t tabletype; |
| 75 | uint16_t fieldoffset; |
| 76 | } FwCfgSmbios; |