diff options
author | Himanshu Sahdev <himanshusah@hcl.com> | 2019-09-12 12:02:54 +0530 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-09-24 10:29:28 +0000 |
commit | 8dc95ddbd4a9354eec124393f996a36c3a7329e2 (patch) | |
tree | 3fff8bba4d47a5ff42f16825851545d540af4174 /src/mainboard/emulation/qemu-i440fx/fw_cfg_if.h | |
parent | df02f7aed8c2f959485d891c339f23628282a99c (diff) |
emulation/qemu-i440fx: use fw_cfg_dma for fw_cfg_read
- configure DMA fw_cfg
- add support to read using fw_cfg_dma
- provide fw config version id info in logs
BUG=N/A
TEST=Build and boot using qemu-i440fx.
Change-Id: I0be5355b124af40aba62c0840790d46ed0fe80a2
Signed-off-by: Himanshu Sahdev <himanshusah@hcl.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35365
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/mainboard/emulation/qemu-i440fx/fw_cfg_if.h')
-rw-r--r-- | src/mainboard/emulation/qemu-i440fx/fw_cfg_if.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg_if.h b/src/mainboard/emulation/qemu-i440fx/fw_cfg_if.h index de67f021ea..dad6ca9e7f 100644 --- a/src/mainboard/emulation/qemu-i440fx/fw_cfg_if.h +++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg_if.h @@ -67,11 +67,20 @@ enum fw_cfg_enum { #define FW_CFG_INVALID 0xffff +/* width in bytes of fw_cfg control register */ +#define FW_CFG_CTL_SIZE 0x02 + +/* fw_cfg "file name" is up to 56 characters (including terminating nul) */ +#define FW_CFG_MAX_FILE_PATH 56 + +/* size in bytes of fw_cfg signature */ +#define FW_CFG_SIG_SIZE 4 + typedef struct FWCfgFile { uint32_t size; /* file size */ uint16_t select; /* write this to 0x510 to read it */ uint16_t reserved; - char name[56]; + char name[FW_CFG_MAX_FILE_PATH]; } FWCfgFile; typedef struct FWCfgFiles { @@ -96,4 +105,26 @@ typedef struct FwCfgSmbios { uint16_t fieldoffset; } FwCfgSmbios; +/* FW_CFG_ID bits */ +#define FW_CFG_VERSION 0x01 +#define FW_CFG_VERSION_DMA 0x02 + +/* FW_CFG_DMA_CONTROL bits */ +#define FW_CFG_DMA_CTL_ERROR 0x01 +#define FW_CFG_DMA_CTL_READ 0x02 +#define FW_CFG_DMA_CTL_SKIP 0x04 +#define FW_CFG_DMA_CTL_SELECT 0x08 +#define FW_CFG_DMA_CTL_WRITE 0x10 + +#define FW_CFG_DMA_SIGNATURE 0x51454d5520434647ULL /* "QEMU CFG" */ + +/* Control as first field allows for different structures selected by this + * field, which might be useful in the future + */ +typedef struct FwCfgDmaAccess { + uint32_t control; + uint32_t length; + uint64_t address; +} FwCfgDmaAccess; + #endif /* FW_CFG_IF_H */ |