summaryrefslogtreecommitdiffstats
path: root/hw/loongarch/acpi-build.c
diff options
context:
space:
mode:
authorStefan Hajnoczi2022-12-04 17:07:12 +0100
committerStefan Hajnoczi2022-12-04 17:07:13 +0100
commit777fa06376ce0249c76d0d852e8f7ed103a63864 (patch)
treea7b23772b798ad77a29ec04ea07a496e1f422da2 /hw/loongarch/acpi-build.c
parentMerge tag 'nvme-next-pull-request' of git://git.infradead.org/qemu-nvme into ... (diff)
parenthw/loongarch/virt: Add cfi01 pflash device (diff)
downloadqemu-777fa06376ce0249c76d0d852e8f7ed103a63864.tar.gz
qemu-777fa06376ce0249c76d0d852e8f7ed103a63864.tar.xz
qemu-777fa06376ce0249c76d0d852e8f7ed103a63864.zip
Merge tag 'pull-loongarch-20221202' of https://gitlab.com/gaosong/qemu into staging
pull for 7.2-rc4 # -----BEGIN PGP SIGNATURE----- # # iLMEAAEIAB0WIQS4/x2g0v3LLaCcbCxAov/yOSY+3wUCY4nPggAKCRBAov/yOSY+ # 36cRA/9JFWuDT0TDhu0g1x0ktvpV+1GBPzkEXR2CVhDf2bly1ka2cLEtPUpiSE8E # Osw9cEBR3qX+LyO3gA0GySUr9jsc/yRqD38OL8HGZTCmZ/qCnHJSXvy+6a0LWYQq # ZIrFat7UjiTTeErkSQ6C4bUIl6YoUUSP0X2XxO6YF5j4uhGyqA== # =sVrx # -----END PGP SIGNATURE----- # gpg: Signature made Fri 02 Dec 2022 05:12:18 EST # gpg: using RSA key B8FF1DA0D2FDCB2DA09C6C2C40A2FFF239263EDF # gpg: Good signature from "Song Gao <m17746591750@163.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: B8FF 1DA0 D2FD CB2D A09C 6C2C 40A2 FFF2 3926 3EDF * tag 'pull-loongarch-20221202' of https://gitlab.com/gaosong/qemu: hw/loongarch/virt: Add cfi01 pflash device Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/loongarch/acpi-build.c')
-rw-r--r--hw/loongarch/acpi-build.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c
index 7d5f5a757d..c2b237736d 100644
--- a/hw/loongarch/acpi-build.c
+++ b/hw/loongarch/acpi-build.c
@@ -279,6 +279,23 @@ static void build_pci_device_aml(Aml *scope, LoongArchMachineState *lams)
acpi_dsdt_add_gpex(scope, &cfg);
}
+static void build_flash_aml(Aml *scope, LoongArchMachineState *lams)
+{
+ Aml *dev, *crs;
+
+ hwaddr flash_base = VIRT_FLASH_BASE;
+ hwaddr flash_size = VIRT_FLASH_SIZE;
+
+ dev = aml_device("FLS0");
+ aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0015")));
+ aml_append(dev, aml_name_decl("_UID", aml_int(0)));
+
+ crs = aml_resource_template();
+ aml_append(crs, aml_memory32_fixed(flash_base, flash_size, AML_READ_WRITE));
+ aml_append(dev, aml_name_decl("_CRS", crs));
+ aml_append(scope, dev);
+}
+
#ifdef CONFIG_TPM
static void acpi_dsdt_add_tpm(Aml *scope, LoongArchMachineState *vms)
{
@@ -328,6 +345,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, MachineState *machine)
build_uart_device_aml(dsdt);
build_pci_device_aml(dsdt, lams);
build_la_ged_aml(dsdt, machine);
+ build_flash_aml(dsdt, lams);
#ifdef CONFIG_TPM
acpi_dsdt_add_tpm(dsdt, lams);
#endif