diff options
author | Igor Mammedov <imammedo@redhat.com> | 2018-02-28 15:23:54 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2018-03-13 23:09:50 +0200 |
commit | dd1b2037a38024b69e952c5ac41fd63b96e552ab (patch) | |
tree | 9bcd195b4a51099eeaee84409268e2abda834625 /hw/acpi | |
parent | 8612f8bd9fb667c62e9a56c67ab2e3af2798dd9c (diff) |
virt_arm: acpi: reuse common build_fadt()
Extend generic build_fadt() to support rev5.1 FADT
and reuse it for 'virt' board, it would allow to
phase out usage of AcpiFadtDescriptorRev5_1 and
later ACPI_FADT_COMMON_DEF.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi')
-rw-r--r-- | hw/acpi/aml-build.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 8f45298a3a..3fa557cea1 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1679,7 +1679,7 @@ void build_slit(GArray *table_data, BIOSLinker *linker) table_data->len - slit_start, 1, NULL, NULL); } -/* build rev1/rev3 FADT */ +/* build rev1/rev3/rev5.1 FADT */ void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f, const char *oem_id, const char *oem_table_id) { @@ -1755,7 +1755,14 @@ void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f, build_append_gas_from_struct(tbl, &f->reset_reg); /* RESET_REG */ build_append_int_noprefix(tbl, f->reset_val, 1); /* RESET_VALUE */ - build_append_int_noprefix(tbl, 0, 3); /* Reserved, ACPI 3.0 */ + /* Since ACPI 5.1 */ + if ((f->rev >= 6) || ((f->rev == 5) && f->minor_ver > 0)) { + build_append_int_noprefix(tbl, f->arm_boot_arch, 2); /* ARM_BOOT_ARCH */ + /* FADT Minor Version */ + build_append_int_noprefix(tbl, f->minor_ver, 1); + } else { + build_append_int_noprefix(tbl, 0, 3); /* Reserved upto ACPI 5.0 */ + } build_append_int_noprefix(tbl, 0, 8); /* X_FIRMWARE_CTRL */ /* XDSDT address to be filled by Guest linker at runtime */ @@ -1779,6 +1786,18 @@ void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f, build_append_gas_from_struct(tbl, &f->gpe0_blk); /* X_GPE0_BLK */ build_append_gas(tbl, AML_AS_SYSTEM_MEMORY, 0 , 0, 0, 0); /* X_GPE1_BLK */ + if (f->rev <= 4) { + goto build_hdr; + } + + /* SLEEP_CONTROL_REG */ + build_append_gas(tbl, AML_AS_SYSTEM_MEMORY, 0 , 0, 0, 0); + /* SLEEP_STATUS_REG */ + build_append_gas(tbl, AML_AS_SYSTEM_MEMORY, 0 , 0, 0, 0); + + /* TODO: extra fields need to be added to support revisions above rev5 */ + assert(f->rev == 5); + build_hdr: build_header(linker, tbl, (void *)(tbl->data + fadt_start), "FACP", tbl->len - fadt_start, f->rev, oem_id, oem_table_id); |