summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/emulation/qemu-i440fx/fw_cfg.c12
-rw-r--r--src/mainboard/emulation/qemu-i440fx/fw_cfg.h2
2 files changed, 12 insertions, 2 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c
index 9b394f2e00..364221eacc 100644
--- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c
+++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c
@@ -42,12 +42,22 @@ static int fw_cfg_present(void)
return fw_cfg_detected;
}
-void fw_cfg_get(int entry, void *dst, int dstlen)
+static void fw_cfg_select(uint16_t 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(uint16_t 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;
diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.h b/src/mainboard/emulation/qemu-i440fx/fw_cfg.h
index b5cdb9292c..91b758c46d 100644
--- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.h
+++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.h
@@ -14,7 +14,7 @@
#define FW_CFG_H
#include "fw_cfg_if.h"
-void fw_cfg_get(int entry, void *dst, int dstlen);
+void fw_cfg_get(uint16_t entry, void *dst, int dstlen);
int fw_cfg_check_file(FWCfgFile *file, const char *name);
int fw_cfg_max_cpus(void);
unsigned long fw_cfg_smbios_tables(int *handle, unsigned long *current);