summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-12-11 08:11:52 -0600
committerTom Rini <[email protected]>2025-12-11 08:11:52 -0600
commitdd9851d7e5dcb932734a84f93e8ca7bddbce777c (patch)
tree0a9959abd523a2687c90387b44ea11f7b77bf191
parent386f22e117c49a26498d24c1b1a2fe4f6c0af1ab (diff)
parentff7c10d89b1509d3843d2bbb37e357aa1ca55210 (diff)
Merge tag 'fsl-qoriq-next-2025-12-11' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next
CI: https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq/-/pipelines/28727 - Stop disabling device tree relocation for ls1012afrdm and ls1043a - Address error handling in ls1088a board setup - Remove offline cores from cooling device maps
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/fdt.c57
-rw-r--r--board/freescale/ls1088a/ls1088a.c7
-rw-r--r--include/configs/ls1012afrdm.h1
-rw-r--r--include/configs/ls1043a_common.h1
4 files changed, 64 insertions, 2 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index e8d2339f1a3..bd33969d569 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -12,6 +12,7 @@
#include <asm/cache.h>
#include <linux/libfdt.h>
#include <fdt_support.h>
+#include <malloc.h>
#include <phy.h>
#ifdef CONFIG_FSL_LSCH3
#include <asm/arch/fdt.h>
@@ -48,6 +49,61 @@ int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)
}
#ifdef CONFIG_MP
+static void fdt_fixup_thermal_cooling_device(void *blob, int cpu_off)
+{
+ int cnt, idx, len;
+ int map, maps;
+ int offline, phandle;
+ int ret;
+ int zone, zones;
+ u32 *tbl;
+ struct fdtdec_phandle_args dev;
+
+ zones = fdt_subnode_offset(blob, 0, "thermal-zones");
+ if (zones < 0)
+ return;
+
+ offline = fdt_get_phandle(blob, cpu_off);
+ fdt_for_each_subnode(zone, blob, zones) {
+ maps = fdt_subnode_offset(blob, zone, "cooling-maps");
+ if (maps < 0)
+ continue;
+ fdt_for_each_subnode(map, blob, maps) {
+ if (!fdt_getprop(blob, map, "cooling-device", &len))
+ continue;
+ cnt = fdtdec_parse_phandle_with_args(blob, map,
+ "cooling-device",
+ "#cooling-cells",
+ 0, -1, NULL);
+ if (cnt <= 0)
+ continue;
+ tbl = (u32 *)malloc(len);
+ if (!tbl)
+ return;
+ idx = 0;
+ for (int i = 0; i < cnt; i++) {
+ ret = fdtdec_parse_phandle_with_args(blob, map,
+ "cooling-device",
+ "#cooling-cells",
+ 0, i,
+ &dev);
+ if (ret < 0)
+ goto skip_update;
+ phandle = fdt_get_phandle(blob, dev.node);
+ if (phandle == offline)
+ continue;
+ tbl[idx++] = cpu_to_fdt32(phandle);
+ for (int j = 0; j < dev.args_count; j++)
+ tbl[idx++] = cpu_to_fdt32(dev.args[j]);
+ }
+ fdt_setprop(blob, map, "cooling-device", tbl,
+ (idx*sizeof(*tbl)));
+skip_update:
+ free(tbl);
+ }
+ }
+}
+
void ft_fixup_cpu(void *blob)
{
int off;
@@ -73,6 +129,7 @@ void ft_fixup_cpu(void *blob)
if (reg) {
core_id = fdt_read_number(reg, addr_cells);
if (!test_bit(id_to_core(core_id), &mask)) {
+ fdt_fixup_thermal_cooling_device(blob, off);
fdt_del_node(blob, off);
off = off_prev;
}
diff --git a/board/freescale/ls1088a/ls1088a.c b/board/freescale/ls1088a/ls1088a.c
index 9606434e8ff..51ec055be63 100644
--- a/board/freescale/ls1088a/ls1088a.c
+++ b/board/freescale/ls1088a/ls1088a.c
@@ -948,7 +948,14 @@ int ft_board_setup(void *blob, struct bd_info *bd)
total_memory_banks = CONFIG_NR_DRAM_BANKS + mc_memory_bank;
base = calloc(total_memory_banks, sizeof(u64));
+ if (!base)
+ return -ENOMEM;
+
size = calloc(total_memory_banks, sizeof(u64));
+ if (!size) {
+ free(base);
+ return -ENOMEM;
+ }
/* fixup DT for the two GPP DDR banks */
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
index 4243a21f1f1..8059092fac8 100644
--- a/include/configs/ls1012afrdm.h
+++ b/include/configs/ls1012afrdm.h
@@ -19,7 +19,6 @@
#undef CFG_EXTRA_ENV_SETTINGS
#define CFG_EXTRA_ENV_SETTINGS \
"verify=no\0" \
- "fdt_high=0xffffffffffffffff\0" \
"kernel_addr=0x01000000\0" \
"scriptaddr=0x80000000\0" \
"fdtheader_addr_r=0x80100000\0" \
diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h
index a02c752bbcf..4c695388d2f 100644
--- a/include/configs/ls1043a_common.h
+++ b/include/configs/ls1043a_common.h
@@ -90,7 +90,6 @@
/* Initial environment variables */
#define CFG_EXTRA_ENV_SETTINGS \
"hwconfig=fsl_ddr:bank_intlv=auto\0" \
- "fdt_high=0xffffffffffffffff\0" \
"initrd_high=0xffffffffffffffff\0" \
"kernel_addr=0x61000000\0" \
"scriptaddr=0x80000000\0" \