diff options
Diffstat (limited to 'board/emulation/qemu-sbsa/acpi.c')
-rw-r--r-- | board/emulation/qemu-sbsa/acpi.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/board/emulation/qemu-sbsa/acpi.c b/board/emulation/qemu-sbsa/acpi.c index ba85e08fc7d..806780947bd 100644 --- a/board/emulation/qemu-sbsa/acpi.c +++ b/board/emulation/qemu-sbsa/acpi.c @@ -10,9 +10,9 @@ #include <asm/acpi_table.h> #include <asm/armv8/sec_firmware.h> #include <configs/qemu-sbsa.h> -#include <dm/uclass.h> #include <dm/device.h> -#include "qemu-sbsa.h" +#include <dm/read.h> +#include <dm/uclass.h> #define SBSAQEMU_MADT_GIC_VBASE 0x2c020000 #define SBSAQEMU_MADT_GIC_HBASE 0x2c010000 @@ -45,13 +45,18 @@ int acpi_fill_iort(struct acpi_ctx *ctx) { u32 its_offset, smmu_offset; - u64 gic_its_base = 0; - - smc_get_gic_its_base(&gic_its_base); - if (gic_its_base == 0) - return 0; + struct udevice *dev; + int ret; + + ret = uclass_get_device_by_driver(UCLASS_IRQ, + DM_DRIVER_GET(arm_gic_v3_its), &dev); + if (ret) { + pr_err("%s: failed to get %s irq device\n", __func__, + DM_DRIVER_GET(arm_gic_v3_its)->name); + return ret; + } - u32 identifiers[] = { 0 }; + u32 identifiers[] = { dev_seq(dev) }; its_offset = acpi_iort_add_its_group(ctx, ARRAY_SIZE(identifiers), identifiers); @@ -133,7 +138,7 @@ static int sbsa_write_gtdt(struct acpi_ctx *ctx, const struct acpi_writer *entry gtdt->cnt_read_base = 0xffffffffffffffff; // FIXME: VirtualPL2Timer - header->checksum = table_compute_checksum(header, header->length); + acpi_update_checksum(header); acpi_add_table(ctx, gtdt); @@ -181,7 +186,7 @@ static int acpi_write_pptt(struct acpi_ctx *ctx, const struct acpi_writer *entry } header->length = ctx->current - ctx->tab_start; - header->checksum = table_compute_checksum(header, header->length); + acpi_update_checksum(header); acpi_inc(ctx, header->length); acpi_add_table(ctx, header); |