STM32MP15 ECO 5.0.0 Board bring up panic with legacy power (regulator)
STM32MP157AAA custom board with DRAM, SD- EMMC, USB and UART , Discrete power( no PMIC) . The board uses discrete oscillators for HSE and RTC, so they are set as Crystal OSC for both in CubeMX USB, UART are correctly configured (same as the default peripheral settings). DRAM is correctly setup based on the used DRAM chip. In .config the PMIC options is disabled and legacy power enabled
The CubemX settings were verified by the SOM manufacturer as being correct. This board has run a previous version of the ECO system without problems.
TF-A uses SCMI but if the file #include "stm32mp15-scmi-u-boot.dtsi" is included, errors occur.
To fix some other CubeMX generated dts file errors:
a. Add a file stm32mp157a-<board>.dsti file in the main dts file. (which CubeMX did not add as an include). This fle is empty.
b.. Add a binman entry to the stm32mp157a-<board>.dsti. Thee definition was found in stm32mp15-scmi-u-boot.dts and if not included u-boot fails with a message that bin-man was not included.
binman: binman {
multiple-images;
};
c. Removing the include file for the M4 that CubemX included (which caused a DMA2 build error)
d. Enable legacy power

e. in .config the "Enable SCMI agent SMCCC" and OP-TEE options are enabled, as well as Clock-> clock driver support =>Enable SCMI clock driver (and RCC clock driver is also enabled)
resulting dts file header:
#include <dt-bindings/pinctrl/stm32-pinfunc.h>
#include "stm32mp157.dtsi"
#include "stm32mp15xa.dtsi"
#include "stm32mp15xxaa-pinctrl.dtsi"
#include "stm32mp157a-board-u-boot.dtsi"
//#include "stm32mp15-m4-srm.dtsi"
//#include "stm32mp15-scmi-u-boot.dtsi"

After building al binaries flashing fails with
11:16:29 : File download complete
11:16:29 : Time elapsed during download operation: 00:00:02.936
11:16:29 : RUNNING Program ...
11:16:29 : PartID: :0x01
11:16:29 : Start operation done successfully at partition 0x01
11:16:29 : Memory Programming ...
11:16:29 : Opening and parsing file: fip-stm32mp157a-board-optee.bin
11:16:29 : File : fip-stm32mp157a-board-optee.bin
11:16:29 : Size : 1.20 MB
11:16:29 : Partition ID : 0x03
11:16:29 : Download in Progress:
11:16:33 : File download complete
11:16:33 : Time elapsed during download operation: 00:00:04.134
11:16:33 : RUNNING Program ...
11:16:33 : PartID: :0x03
11:16:33 : Reconnecting the device ...
UART output:
PANIC at PC : 0x2ffec8f3
Exception mode=0x00000016 at: 0x2ffec8f3
Recompiled u-boot now wbased on the trusted defconfig tree but with legacy power instead of PMIC, gives another panic:
[ttyUSB0]: PANIC at PC : 0x2ffec8f3
[ttyUSB0]: 8f3n mode=0x00000016 at: 0x2ffec
