1 // SPDX-License-Identifier: GPL-2.0+ 2 /* 3 * Add fw_cfg device in DSDT 4 * 5 */ 6 7 #include "hw/nvram/fw_cfg_acpi.h" 8 #include "hw/acpi/aml-build.h" 9 10 void fw_cfg_acpi_dsdt_add(Aml *scope, const MemMapEntry *fw_cfg_memmap) 11 { 12 Aml *dev = aml_device("FWCF"); 13 aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002"))); 14 /* device present, functioning, decoding, not shown in UI */ 15 aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); 16 aml_append(dev, aml_name_decl("_CCA", aml_int(1))); 17 18 Aml *crs = aml_resource_template(); 19 aml_append(crs, aml_memory32_fixed(fw_cfg_memmap->base, 20 fw_cfg_memmap->size, AML_READ_WRITE)); 21 aml_append(dev, aml_name_decl("_CRS", crs)); 22 aml_append(scope, dev); 23 } 24