Thomas Heijligen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30846
Change subject: mb/emulation/qemu-i449fx: prepare fw_cfg for romstage usage ......................................................................
mb/emulation/qemu-i449fx: prepare fw_cfg for romstage usage
Add separate functions for selecting the port and reading the port. Romstage can now read incremental from the data port.
Change-Id: I0ffde3bc2a4415a8af99af2275d16f6609099e37 Signed-off-by: Thomas Heijligen thomas.heijligen@secunet.com --- M src/mainboard/emulation/qemu-i440fx/fw_cfg.c 1 file changed, 11 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/30846/1
diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c index 9b394f2..957e9d2 100644 --- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c +++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c @@ -42,12 +42,22 @@ return fw_cfg_detected; }
-void fw_cfg_get(int entry, void *dst, int dstlen) +static void fw_cfg_select(int entry) { outw(entry, FW_CFG_PORT_CTL); +} + +static void fw_cfg_read(void *dst, int dstlen) +{ insb(FW_CFG_PORT_DATA, dst, dstlen); }
+void fw_cfg_get(int entry, void *dst, int dstlen) +{ + fw_cfg_select(entry); + fw_cfg_read(dst, dstlen); +} + static void fw_cfg_init_file(void) { u32 i, size, count = 0;