2023-12-18 18:02:35 +03:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
/*
|
|
|
|
* Add fw_cfg device in DSDT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2024-01-25 19:34:03 +03:00
|
|
|
#include "qemu/osdep.h"
|
2023-12-18 18:02:35 +03:00
|
|
|
#include "hw/nvram/fw_cfg_acpi.h"
|
|
|
|
#include "hw/acpi/aml-build.h"
|
|
|
|
|
|
|
|
void fw_cfg_acpi_dsdt_add(Aml *scope, const MemMapEntry *fw_cfg_memmap)
|
|
|
|
{
|
|
|
|
Aml *dev = aml_device("FWCF");
|
|
|
|
aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002")));
|
|
|
|
/* device present, functioning, decoding, not shown in UI */
|
|
|
|
aml_append(dev, aml_name_decl("_STA", aml_int(0xB)));
|
|
|
|
aml_append(dev, aml_name_decl("_CCA", aml_int(1)));
|
|
|
|
|
|
|
|
Aml *crs = aml_resource_template();
|
|
|
|
aml_append(crs, aml_memory32_fixed(fw_cfg_memmap->base,
|
|
|
|
fw_cfg_memmap->size, AML_READ_WRITE));
|
|
|
|
aml_append(dev, aml_name_decl("_CRS", crs));
|
|
|
|
aml_append(scope, dev);
|
|
|
|
}
|