TF-A boot only can handle 2 GB RAM? Does Op-tee or other TF-A DT causing this?
I have a STM32MP257F custom board with a MT53E1G32D2FW-046 WT:C (4GB) memory.
But when I'm booting the TF-A, then I get this message. Notice that this processor passes the DDR data(stm32mp_ddr_test_data_bus(void)) and DDR rw(stm32mp_ddr_test_rw_access(void)) test! So I don't think that the assembly was bad.
ERROR: DDR addr bus test: can't access memory @ 0x100000000
BACKTRACE: START: stm32mp2_ddr_setupThis means that my CPU cannot access the address 0x100000000. This limit is exactly 4GB.
If we looking at the code. That means that the offset variable must be 0x80000000, which is 2GB. The function stm32mp_ddr_test_addr_bus(size_t size) is beging called with size = 4294967296 = 4GB.
uintptr_t stm32mp_ddr_test_addr_bus(size_t size)
{
size_t addressmask = size - 1U;
size_t offset;
size_t testoffset = 0U;
/* Write the default pattern at each of the power-of-two offsets. */
for (offset = sizeof(u_register_t); (offset & addressmask) != 0U;
offset <<= 1U) {
mmio_write_pattern(STM32MP_DDR_BASE + offset, DDR_PATTERN);
}
/* Check for address bits stuck high. */
mmio_write_pattern(STM32MP_DDR_BASE + testoffset, DDR_ANTIPATTERN);
for (offset = sizeof(u_register_t); (offset & addressmask) != 0U;
offset <<= 1U) {
if (mmio_read_pattern(STM32MP_DDR_BASE + offset) != DDR_PATTERN) {
return STM32MP_DDR_BASE + offset;
}
}I'm using the TF-A tree:
/dts-v1/;
#include <dt-bindings/pinctrl/stm32-pinfunc.h>
#include <dt-bindings/clock/stm32mp25-clksrc.h>
#include "stm32mp25-mx.dtsi"
#include "stm32mp257.dtsi"
#include "stm32mp25xf.dtsi"
#include "stm32mp257f-firmware-mx-rcc.dtsi"
#include "stm32mp25xxak-pinctrl.dtsi"
/*#include "stm32mp25-ddr.dtsi"*/
/* USER CODE BEGIN includes */
include "stm32mp25-lpddr4-1x32Gbits-1x32bits-1200MHz.dtsi"
/* USER CODE END includes */
/ {
model = "STMicroelectronics custom STM32CubeMX board - openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11";
compatible = "st,stm32mp257f-firmware-mx", "st,stm32mp257";
memory@80000000 {
device_type = "memory";
reg = <0x0 0x80000000 0x00000001 0x00000000>;
/* USER CODE BEGIN memory */
/* USER CODE END memory */
};
/* USER CODE BEGIN root */
aliases{
serial0 = &usart6;
};
chosen{
stdout-path = "serial0:115200n8";
};
/* USER CODE END root */
}; /*root*/Questions:
- Does Op-tee causing this issue?
- Can I use a different memory setup in the tf-a device tree? For example:
memory@80000000 {
device_type = "memory";
reg = <0x0 0x80000000 0x0 0x80000000>; // första 2 GB
};
memory@100000000 {
device_type = "memory";
reg = <0x1 0x00000000 0x0 0x80000000>; // andra 2 GB
};3. Other solution?
