#ifdef CONFIG_ACPI
void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg)
{
+ uint8_t io_size;
+ Aml *dev = aml_device("FWCF");
+ Aml *crs = aml_resource_template();
+
/*
* when using port i/o, the 8-bit data register *always* overlaps
* with half of the 16-bit control register. Hence, the total size
- * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the
- * DMA control register is located at FW_CFG_DMA_IO_BASE + 4
+ * of the i/o region used is FW_CFG_CTL_SIZE; And the DMA control
+ * register is located at FW_CFG_DMA_IO_BASE + 4
*/
- Object *obj = OBJECT(fw_cfg);
- uint8_t io_size = object_property_get_bool(obj, "dma_enabled", NULL) ?
- ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) :
- FW_CFG_CTL_SIZE;
- Aml *dev = aml_device("FWCF");
- Aml *crs = aml_resource_template();
+ assert(fw_cfg_dma_enabled(fw_cfg));
+ io_size = ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t);
aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002")));
}
option_rom[nb_option_roms].bootindex = 0;
- option_rom[nb_option_roms].name = "linuxboot.bin";
- if (fw_cfg_dma_enabled(fw_cfg)) {
- option_rom[nb_option_roms].name = "linuxboot_dma.bin";
- }
+ assert(fw_cfg_dma_enabled(fw_cfg));
+ option_rom[nb_option_roms].name = "linuxboot_dma.bin";
nb_option_roms++;
}