From 2a284d694f451ff5c24ad3433c6008d8f58b8ec4 Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Sun, 24 Sep 2023 00:59:31 +0900 Subject: [PATCH] isp: Handle high mapped VAs for t602x This is similar to some of the other hardware we've seen on this SoC... Signed-off-by: Asahi Lina --- src/isp.c | 11 +++++++++-- src/kboot.c | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/isp.c b/src/isp.c index fb34da2d..202103db 100644 --- a/src/isp.c +++ b/src/isp.c @@ -93,6 +93,8 @@ int isp_init(void) pmgr_set_mode(pmgr_base + pmgr_off, PMGR_PS_PWRGATE); + bool remap = false; + /* TODO: confirm versions */ switch (ver_rev) { case ISP_VER_T8103: @@ -123,9 +125,11 @@ int isp_init(void) } break; case ISP_VER_T6020: + remap = true; + switch (os_firmware.version) { case V13_5: - heap_top = 0xf00000; + heap_top = 0x10000f00000; break; default: printf("isp: unsupported firmware\n"); @@ -143,7 +147,10 @@ int isp_init(void) seg = adt_getprop(adt, isp_node, "segment-ranges", &segments_len); unsigned int count = segments_len / sizeof(*seg); - heap_iova = seg[count - 1].iova + seg[count - 1].size; + if (remap) + heap_iova = seg[count - 1].remap + seg[count - 1].size; + else + heap_iova = seg[count - 1].iova + seg[count - 1].size; heap_size = heap_top - heap_iova; heap_phys = top_of_memory_alloc(heap_size); diff --git a/src/kboot.c b/src/kboot.c index 5ac4ae65..e5479a5f 100644 --- a/src/kboot.c +++ b/src/kboot.c @@ -2165,7 +2165,8 @@ int kboot_prepare_dt(void *fdt) return -1; if (dt_set_sio_fwdata()) return -1; - if (dt_reserve_asc_firmware("/arm-io/isp", "/arm-io/isp0", "isp", false)) + if (dt_reserve_asc_firmware("/arm-io/isp", "/arm-io/isp0", "isp", + chip_id > 0x6020)) return -1; if (dt_set_isp_fwdata()) return -1;