summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiao Yan <yanmiaobest@gmail.com>2016-05-23 02:37:15 (GMT)
committerBin Meng <bmeng.cn@gmail.com>2016-05-23 07:18:00 (GMT)
commit2e82e745a4cf6bad10d9fe5a53db6592f40ff903 (patch)
treef998e79cd2a89b2417f4a8497ee2059d1e89ff93 /include
parentfcf5c04193b48c3f5e2d337a85d28c4026f90ac3 (diff)
downloadu-boot-2e82e745a4cf6bad10d9fe5a53db6592f40ff903.tar.xz
x86: qemu: move x86 specific operations out of qfw core
The original implementation of qfw includes several x86 specific operations, like directly calling outb/inb and using some inline assembly code which prevents it being ported to other architectures. This patch adds callback functions and moves those to arch/x86/ Signed-off-by: Miao Yan <yanmiaobest@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/qemu_fw_cfg.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/qemu_fw_cfg.h b/include/qemu_fw_cfg.h
index f718e09..b0b3b59 100644
--- a/include/qemu_fw_cfg.h
+++ b/include/qemu_fw_cfg.h
@@ -7,11 +7,6 @@
#ifndef __FW_CFG__
#define __FW_CFG__
-#define FW_CONTROL_PORT 0x510
-#define FW_DATA_PORT 0x511
-#define FW_DMA_PORT_LOW 0x514
-#define FW_DMA_PORT_HIGH 0x518
-
#include <linux/list.h>
enum qemu_fwcfg_items {
@@ -97,6 +92,12 @@ struct fw_cfg_dma_access {
__be64 address;
};
+struct fw_cfg_arch_ops {
+ void (*arch_read_pio)(uint16_t selector, uint32_t size,
+ void *address);
+ void (*arch_read_dma)(struct fw_cfg_dma_access *dma);
+};
+
struct bios_linker_entry {
__le32 command;
union {
@@ -148,8 +149,10 @@ struct bios_linker_entry {
/**
* Initialize QEMU fw_cfg interface
+ *
+ * @ops: arch specific read operations
*/
-void qemu_fwcfg_init(void);
+void qemu_fwcfg_init(struct fw_cfg_arch_ops *ops);
void qemu_fwcfg_read_entry(uint16_t entry, uint32_t length, void *address);
int qemu_fwcfg_read_firmware_list(void);