diff --git a/src/kboot.c b/src/kboot.c index e37499d07..e8d9410a1 100644 --- a/src/kboot.c +++ b/src/kboot.c @@ -1144,7 +1144,7 @@ static dart_dev_t *dt_init_dart_by_node(int node, u32 num) u32 iommu_phandle = fdt32_ld(&iommus[num * 2]); u32 iommu_stream = fdt32_ld(&iommus[num * 2 + 1]); - printf("FDT: iommu phande:%u stream:%u\n", iommu_phandle, iommu_stream); + printf("FDT: iommu phandle:%u stream:%u\n", iommu_phandle, iommu_stream); return dart_init_fdt(dt, iommu_phandle, iommu_stream, true); } @@ -1657,6 +1657,49 @@ static struct disp_mapping disp_reserved_regions_t602x[] = { {"region-id-157", "region157", true, true, false}, }; +static struct disp_mapping dcpext_reserved_regions_t602x[MAX_DCPEXT][3] = { + { + {"region-id-49", "dcp_txt", true, false, false}, + {"region-id-73", "dcpext_data", true, false, false}, + {"region-id-74", "region74", true, false, false}, + }, + { + {"region-id-49", "dcp_txt", true, false, false}, + {"region-id-88", "dcpext1_data", true, false, false}, + {"region-id-89", "region89", true, false, false}, + }, + { + {"region-id-49", "dcp_txt", true, false, false}, + {"region-id-111", "dcpext2_data", true, false, false}, + {"region-id-112", "region112", true, false, false}, + }, + { + {"region-id-49", "dcp_txt", true, false, false}, + {"region-id-119", "dcpext3_data", true, false, false}, + {"region-id-120", "region120", true, false, false}, + }, + { + {"region-id-49", "dcp_txt", true, false, false}, + {"region-id-127", "dcpext4_data", true, false, false}, + {"region-id-128", "region128", true, false, false}, + }, + { + {"region-id-49", "dcp_txt", true, false, false}, + {"region-id-135", "dcpext5_data", true, false, false}, + {"region-id-136", "region136", true, false, false}, + }, + { + {"region-id-49", "dcp_txt", true, false, false}, + {"region-id-143", "dcpext6_data", true, false, false}, + {"region-id-144", "region144", true, false, false}, + }, + { + {"region-id-49", "dcp_txt", true, false, false}, + {"region-id-151", "dcpext7_data", true, false, false}, + {"region-id-152", "region152", true, false, false}, + }, +}; + #define ARRAY_SIZE(s) (sizeof(s) / sizeof((s)[0])) static int dt_set_display(void) @@ -1709,12 +1752,23 @@ static int dt_set_display(void) ARRAY_SIZE(dcpext_reserved_regions_t600x[n])); } } else if (!fdt_node_check_compatible(dt, 0, "apple,t6020") || - !fdt_node_check_compatible(dt, 0, "apple,t6021")) { + !fdt_node_check_compatible(dt, 0, "apple,t6021") || + !fdt_node_check_compatible(dt, 0, "apple,t6022")) { + /* this is expected to return early on t6022 due to the missing dcp alias */ ret = dt_carveout_reserved_regions("dcp", "disp0", "disp0_piodma", disp_reserved_regions_t602x, ARRAY_SIZE(disp_reserved_regions_t602x)); if (ret) return ret; + + for (int n = 0; n < MAX_DCPEXT && ret == 0; n++) { + char dcpext_alias[16]; + + snprintf(dcpext_alias, sizeof(dcpext_alias), "dcpext%d", n); + ret = dt_carveout_reserved_regions(dcpext_alias, NULL, NULL, + dcpext_reserved_regions_t602x[n], + ARRAY_SIZE(dcpext_reserved_regions_t602x[n])); + } } else { printf("FDT: unknown compatible, skip display reserved-memory setup\n"); return 0; diff --git a/src/sio.c b/src/sio.c index 9fce470fd..95663d1db 100644 --- a/src/sio.c +++ b/src/sio.c @@ -64,6 +64,8 @@ static void *add_fwdata(size_t size, u32 param_id) u64 iova; void *p = alloc_mapped_data(size, &iova); + if (!p) + return NULL; struct sio_fwparam *param = &sio_fwparams[sio_num_fwparams]; param->key = param_id;