From fbe3fcd85a25546f5ce38e201614bd85f6990254 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Fri, 8 Sep 2023 00:03:55 +0900 Subject: [PATCH] kboot: Handle ISP/SIO reserved firmware differences The iova field is different, handle it with a flag. Signed-off-by: Hector Martin --- src/kboot.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kboot.c b/src/kboot.c index 5f055297..d7818027 100644 --- a/src/kboot.c +++ b/src/kboot.c @@ -1518,7 +1518,7 @@ static int dt_vram_reserved_region(const char *dcp_alias, const char *disp_alias disp_reserved_regions_vram, ®ion, 1); } -static int dt_reserve_asc_firmware(const char *adt_path, const char *fdt_path) +static int dt_reserve_asc_firmware(const char *adt_path, const char *fdt_path, bool remap) { int ret = 0; @@ -1548,7 +1548,7 @@ static int dt_reserve_asc_firmware(const char *adt_path, const char *fdt_path) unsigned int num_maps = segments_len / sizeof(*seg); for (unsigned i = 0; i < num_maps; i++) { - u64 iova = seg->iova; + u64 iova = remap ? seg->remap : seg->iova; char node_name[64]; snprintf(node_name, sizeof(node_name), "asc-firmware@%lx", seg->phys); @@ -2159,13 +2159,13 @@ int kboot_prepare_dt(void *fdt) return -1; if (dt_disable_missing_devs("i2c", "i2c@", 8)) return -1; - if (dt_reserve_asc_firmware("/arm-io/sio", "sio")) + if (dt_reserve_asc_firmware("/arm-io/sio", "sio", true)) return -1; if (dt_set_sio_fwdata()) return -1; - if (dt_set_isp_fwdata()) + if (dt_reserve_asc_firmware("/arm-io/isp", "isp", false)) return -1; - if (dt_reserve_asc_firmware("/arm-io/isp", "isp")) + if (dt_set_isp_fwdata()) return -1; #ifndef RELEASE if (dt_transfer_virtios())