Felix Singer has submitted this change. ( https://review.coreboot.org/c/coreboot/+/80365?usp=email )
Change subject: mb/qemu/fw_cfg: Support using DMA to select fw_cfg file ......................................................................
mb/qemu/fw_cfg: Support using DMA to select fw_cfg file
Commit 8dc95ddbd4a935 ("emulation/qemu-i440fx: use fw_cfg_dma for fw_cfg_read") adds DMA support to interface with the QEMU firmware configuration device, and uses it to read from the "files" exposed by the device. However, the file selection step still uses port-based IO.
Use DMA for fw_cfg file selection when possible, as a step towards porting this driver to other architectures.
Change-Id: I46f9915e6df04d371c7084815f16034c7e9879d4 Signed-off-by: Alper Nebi Yasak alpernebiyasak@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/80365 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Martin L Roth gaumless@gmail.com Reviewed-by: Matt DeVillier matt.devillier@gmail.com Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de --- M src/mainboard/emulation/qemu-i440fx/fw_cfg.c 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: Matt DeVillier: Looks good to me, approved build bot (Jenkins): Verified Nico Huber: Looks good to me, but someone else must approve Martin L Roth: Looks good to me, approved Felix Singer: Looks good to me, approved
diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c index a15773c..ad664a6 100644 --- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c +++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c @@ -44,7 +44,10 @@
static void fw_cfg_select(uint16_t entry) { - outw(entry, FW_CFG_PORT_CTL); + if (fw_ver & FW_CFG_VERSION_DMA) + fw_cfg_dma(FW_CFG_DMA_CTL_SELECT | entry << 16, NULL, 0); + else + outw(entry, FW_CFG_PORT_CTL); }
static void fw_cfg_read(void *dst, int dstlen)