@@ -1026,12 +1026,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
FWCfgIoState *ios;
FWCfgState *s;
MemoryRegion *iomem = get_system_io();
- bool dma_requested = dma_iobase && dma_as;
+ assert(dma_iobase && dma_as);
dev = qdev_new(TYPE_FW_CFG_IO);
- if (!dma_requested) {
- qdev_prop_set_bit(dev, "dma_enabled", false);
- }
object_property_add_child(OBJECT(qdev_get_machine()), TYPE_FW_CFG,
OBJECT(dev));
@@ -1042,13 +1039,10 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
memory_region_add_subregion(iomem, iobase, &ios->comb_iomem);
s = FW_CFG(dev);
-
- if (s->dma_enabled) {
- /* 64 bits for the address field */
- s->dma_as = dma_as;
- s->dma_addr = 0;
- memory_region_add_subregion(iomem, dma_iobase, &s->dma_iomem);
- }
+ /* 64 bits for the address field */
+ s->dma_as = dma_as;
+ s->dma_addr = 0;
+ memory_region_add_subregion(iomem, dma_iobase, &s->dma_iomem);
return s;
}
@@ -1185,8 +1179,6 @@ static void fw_cfg_file_slots_allocate(FWCfgState *s, Error **errp)
}
static const Property fw_cfg_io_properties[] = {
- DEFINE_PROP_BOOL("dma_enabled", FWCfgIoState, parent_obj.dma_enabled,
- true),
DEFINE_PROP_UINT16("x-file-slots", FWCfgIoState, parent_obj.file_slots,
FW_CFG_FILE_SLOTS_DFLT),
};
@@ -1207,11 +1199,9 @@ static void fw_cfg_io_realize(DeviceState *dev, Error **errp)
memory_region_init_io(&s->comb_iomem, OBJECT(s), &fw_cfg_comb_mem_ops,
FW_CFG(s), "fwcfg", FW_CFG_CTL_SIZE);
- if (FW_CFG(s)->dma_enabled) {
- memory_region_init_io(&FW_CFG(s)->dma_iomem, OBJECT(s),
- &fw_cfg_dma_mem_ops, FW_CFG(s), "fwcfg.dma",
- sizeof(dma_addr_t));
- }
+ memory_region_init_io(&FW_CFG(s)->dma_iomem, OBJECT(s),
+ &fw_cfg_dma_mem_ops, FW_CFG(s), "fwcfg.dma",
+ sizeof(dma_addr_t));
fw_cfg_common_realize(dev, errp);
}
Now than all calls to fw_cfg_init_io_dma() pass DMA arguments, the 'dma_enabled' of the TYPE_FW_CFG_IO type is not used anymore. Remove it, simplifying fw_cfg_init_io_dma() and fw_cfg_io_realize(). Note, we can not remove the equivalent in fw_cfg_mem_properties[] because it is still used in HPPA and MIPS Loongson3 machines: $ git grep -w fw_cfg_init_mem hw/hppa/machine.c:204: fw_cfg = fw_cfg_init_mem(addr, addr + 4); hw/mips/loongson3_virt.c:289: fw_cfg = fw_cfg_init_mem(cfg_addr, cfg_addr + 8, 8); Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/nvram/fw_cfg.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-)