[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/31] fw_cfg: move boards to fw_cfg_init_io() / fw_c
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 22/31] fw_cfg: move boards to fw_cfg_init_io() / fw_cfg_init_mem() |
Date: |
Tue, 23 Dec 2014 13:54:18 +0000 |
From: Laszlo Ersek <address@hidden>
This allows us to drop the fw_cfg_init() shim and to enforce the possible
mappings at compile time.
Signed-off-by: Laszlo Ersek <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
hw/i386/pc.c | 4 ++--
hw/nvram/fw_cfg.c | 14 --------------
hw/ppc/mac_newworld.c | 2 +-
hw/ppc/mac_oldworld.c | 2 +-
hw/sparc/sun4m.c | 2 +-
hw/sparc64/sun4u.c | 2 +-
include/hw/nvram/fw_cfg.h | 2 --
7 files changed, 6 insertions(+), 22 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index a3ddb5e..e07f1fa 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -649,7 +649,7 @@ static FWCfgState *bochs_bios_init(void)
int i, j;
unsigned int apic_id_limit = pc_apic_id_limit(max_cpus);
- fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
+ fw_cfg = fw_cfg_init_io(BIOS_CFG_IOPORT);
/* FW_CFG_MAX_CPUS is a bit confusing/problematic on x86:
*
* SeaBIOS needs FW_CFG_MAX_CPUS for CPU hotplug, but the CPU hotplug
@@ -1170,7 +1170,7 @@ FWCfgState *xen_load_linux(const char *kernel_filename,
assert(kernel_filename != NULL);
- fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
+ fw_cfg = fw_cfg_init_io(BIOS_CFG_IOPORT);
rom_set_fw(fw_cfg);
load_linux(fw_cfg, kernel_filename, initrd_filename,
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index ab7bfff..c48bc6e 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -632,20 +632,6 @@ FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr
data_addr)
}
-FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
- hwaddr crl_addr, hwaddr data_addr)
-{
- if (ctl_port + 1 == data_port && crl_addr == 0 && data_addr == 0) {
- return fw_cfg_init_io(ctl_port);
- }
- if (ctl_port == 0 && data_port == 0 && crl_addr != 0 && data_addr != 0) {
- return fw_cfg_init_mem(crl_addr, data_addr);
- }
- assert(false);
- return NULL;
-}
-
-
FWCfgState *fw_cfg_find(void)
{
return FW_CFG(object_resolve_path(FW_CFG_PATH, NULL));
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index ee1ed8a..b60a832 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -454,7 +454,7 @@ static void ppc_core99_init(MachineState *machine)
pmac_format_nvram_partition(nvr, 0x2000);
/* No PCI init: the BIOS will do it */
- fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2);
+ fw_cfg = fw_cfg_init_mem(CFG_ADDR, CFG_ADDR + 2);
fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)max_cpus);
fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 15109c2..c7224d7 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -313,7 +313,7 @@ static void ppc_heathrow_init(MachineState *machine)
/* No PCI init: the BIOS will do it */
- fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2);
+ fw_cfg = fw_cfg_init_mem(CFG_ADDR, CFG_ADDR + 2);
fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)max_cpus);
fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index df259ad..ecd9dc1 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -1084,7 +1084,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
ecc_init(hwdef->ecc_base, slavio_irq[28],
hwdef->ecc_version);
- fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2);
+ fw_cfg = fw_cfg_init_mem(CFG_ADDR, CFG_ADDR + 2);
fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)max_cpus);
fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index acac8f9..3ff5bd8 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -892,7 +892,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
graphic_width, graphic_height, graphic_depth,
(uint8_t *)&nd_table[0].macaddr);
- fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
+ fw_cfg = fw_cfg_init_io(BIOS_CFG_IOPORT);
fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)max_cpus);
fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index fcc88ea..a99586e 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -78,8 +78,6 @@ void fw_cfg_add_file_callback(FWCfgState *s, const char
*filename,
void *data, size_t len);
void *fw_cfg_modify_file(FWCfgState *s, const char *filename, void *data,
size_t len);
-FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
- hwaddr crl_addr, hwaddr data_addr);
FWCfgState *fw_cfg_init_io(uint32_t iobase);
FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr);
--
1.9.1
- [Qemu-devel] [PULL 20/31] target-arm: add cpu feature EL3 to CPUs with Security Extensions, (continued)
- [Qemu-devel] [PULL 20/31] target-arm: add cpu feature EL3 to CPUs with Security Extensions, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 15/31] target-arm: Add arm_boot_info secure_boot control, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 14/31] target-arm: Add ARMCPU secure property, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 12/31] target-arm: Add virt machine secure property, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 01/31] audio: Don't free hw resources until after hw backend is stopped, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 09/31] target-arm: Add vexpress machine secure property, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 02/31] target-arm: Merge EL3 CP15 register lists, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 27/31] fw_cfg_mem: expose the "data_width" property with fw_cfg_init_mem_wide(), Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 29/31] hw/loader: split out load_image_gzipped_buffer(), Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 24/31] fw_cfg_mem: flip ctl_mem_ops and data_mem_ops to DEVICE_BIG_ENDIAN, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 22/31] fw_cfg: move boards to fw_cfg_init_io() / fw_cfg_init_mem(),
Peter Maydell <=
- [Qemu-devel] [PULL 18/31] target-arm: Breakout integratorcp and versatilepb cpu init, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 16/31] target-arm: Enable CPU has_el3 prop during VE init, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 07/31] target-arm: Add vexpress a9 & a15 machine objects, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 19/31] target-arm: Disable EL3 on unsupported machines, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 06/31] target-arm: Add vexpress class and machine types, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 11/31] target-arm: Add virt class and machine types, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 05/31] vl.c: add HMP help to machine, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 04/31] vl.c: simplified machine_set_property, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 21/31] fw_cfg: hard separation between the MMIO and I/O port mappings, Peter Maydell, 2014/12/23
- Re: [Qemu-devel] [PULL 00/31] target-arm queue, Peter Maydell, 2014/12/23