Hi,
we're using a imx8mm (4x Cortex A53) with Linux. So, our device tree dts includes imx8mm.dtsi (https://elixir.bootlin.com/linux/v6.11/source/arch/arm64/boot/dts/freescale/imx8mm.dtsi) which defines all four A53 cores.
Now our HW department has asked if they can simply replace the imx8mm with a single-core imx8mm (like e.g. the MIMX8MM1CVTKZAA), which are pin compatible, but have only one core. Is it safe to use the same imx8mm.dtsi? If so, will the Linux kernel simply ignore the non-existent other three cores?
Or is there maybe a dedicated .dtsi file for single core?
Or do we need to modify imx8mm.dtsi?
Kind regards,
Markus
Solved! Go to Solution.
The iMX's u-boot automatically modifies the Linux device tree to disable the number of cores based on the fuses of different chips.
All you need to do is solder the different chips—it's that simple.
I'm using the lf-5.10.72-2.2.3 code for this demonstration to illustrate that this code was available several years ago, around October 2022.
else if (is_imx8mms() || is_imx8mmsl())
disable_cpu_nodes(blob, 3);
#elif defined(CONFIG_IMX8MM)
if (is_imx8mml() || is_imx8mmdl() || is_imx8mmsl())
disable_vpu_nodes(blob);
if (is_imx8mmd() || is_imx8mmdl())
disable_cpu_nodes(blob, 2);
else if (is_imx8mms() || is_imx8mmsl())
disable_cpu_nodes(blob, 3);
The iMX's u-boot automatically modifies the Linux device tree to disable the number of cores based on the fuses of different chips.
All you need to do is solder the different chips—it's that simple.
I'm using the lf-5.10.72-2.2.3 code for this demonstration to illustrate that this code was available several years ago, around October 2022.
else if (is_imx8mms() || is_imx8mmsl())
disable_cpu_nodes(blob, 3);
#elif defined(CONFIG_IMX8MM)
if (is_imx8mml() || is_imx8mmdl() || is_imx8mmsl())
disable_vpu_nodes(blob);
if (is_imx8mmd() || is_imx8mmdl())
disable_cpu_nodes(blob, 2);
else if (is_imx8mms() || is_imx8mmsl())
disable_cpu_nodes(blob, 3);
Thanks for the hint with imx u-boot!
We're using mainline u-boot, but this of course helps for inspiration
Kind regards,
Markus
Mainline u-boot also has this code.
https://github.com/u-boot/u-boot/blob/master/arch/arm/mach-imx/imx8m/soc.c#L1415
#elif IS_ENABLED(CONFIG_IMX8MM)
if (is_imx8mml() || is_imx8mmdl() || is_imx8mmsl())
disable_vpu_nodes(blob);
if (is_imx8mmd() || is_imx8mmdl())
disable_cpu_nodes(blob, nodes_path, 2, 4);
else if (is_imx8mms() || is_imx8mmsl())
disable_cpu_nodes(blob, nodes_path, 3, 4);
Ok, interesting.
So, in addition to removing the CPU nodes in the DT, one would also need to change the cooling maps node.
Kind regards,
Markus
Hello,
Leave the 4 cores device tree as it is without remove the unused/non-existent cores in 1 core device is not the best option, could cause from a simple warning to a system hang.
We do not have a special device tree for single core device but I suggest you remove the non-existent cores in your device tree for the new part number.
Best regards.
@JorgeCas @, could you please comment on your answer to confirm that the code for dynamically modifying the DTB in the NXP IMX BSP is valid and correct
Hello,
You are right.
U-boot code will change the CPU node status to "disabled" based on CPU information mentioned in fuses.
Just make sure that source code includes this feature.
Best regards.
disable_cpu_nodes does two things: delete the cpu node and disable the thermal nodes related to the deleted cpu node.
It is not change the CPU node status to "disabled" you mentioned.
rc = fdt_del_node(blob, nodeoff);
https://github.com/u-boot/u-boot/blob/master/arch/arm/mach-imx/fdt.c
int disable_cpu_nodes(void *blob, const char * const *nodes_path, u32 num_disabled_cores,
u32 max_cores)
{
u32 i = 0;
int rc;
int nodeoff;
if (max_cores == 0 || (num_disabled_cores > (max_cores - 1)))
return -EINVAL;
i = max_cores - num_disabled_cores;
for (; i < max_cores; i++) {
nodeoff = fdt_path_offset(blob, nodes_path[i]);
if (nodeoff < 0)
continue; /* Not found, skip it */
debug("Found %s node\n", nodes_path[i]);
rc = fdt_del_node(blob, nodeoff);
if (rc < 0) {
printf("Unable to delete node %s, err=%s\n",
nodes_path[i], fdt_strerror(rc));
} else {
printf("Delete node %s\n", nodes_path[i]);
}
}
disable_thermal_cpu_nodes(blob, num_disabled_cores, max_cores);
return 0;
}
Thanks for the answer, Jorge!
So, we'll plan to use a dedicated device tree there, based on imx8mm.dtsi with the three missing cores removed as CPU nodes.
Kind regards,
Markus