mb/emulation/qemu-i440fx: 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>
Reviewed-on: https://review.coreboot.org/c/30846
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
Thomas Heijligen 2019-01-10 12:55:59 +01:00 committed by Patrick Georgi
parent bcd84fe149
commit a05f8a96b4
2 changed files with 12 additions and 2 deletions

View File

@ -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;

View File

@ -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);