On 4/22/20 11:06 AM, Patrick DELAUNAY wrote: > Dear Marek, > >> From: Marek Vasut <[email protected]> >> Sent: vendredi 10 avril 2020 20:56 >> >> Adjust the DDR configuration dtsi such that they only generate the DRAM >> configuration node, the DDR controller node is moved into the stm32mp157-u- >> boot.dtsi itself. This permits including multiple DDR configuration dtsi >> files in >> board DT. >> >> Signed-off-by: Marek Vasut <[email protected]> >> Cc: Manivannan Sadhasivam <[email protected]> >> Cc: Patrick Delaunay <[email protected]> >> Cc: Patrice Chotard <[email protected]> >> --- >> V2: Add compatible string >> --- >> arch/arm/dts/stm32mp15-ddr.dtsi | 358 +++++++++++------- >> .../dts/stm32mp15-ddr3-1x4Gb-1066-binG.dtsi | 1 + >> .../dts/stm32mp15-ddr3-2x4Gb-1066-binG.dtsi | 1 + >> arch/arm/dts/stm32mp157-u-boot.dtsi | 25 ++ >> 4 files changed, 248 insertions(+), 137 deletions(-) >> >> diff --git a/arch/arm/dts/stm32mp15-ddr.dtsi >> b/arch/arm/dts/stm32mp15-ddr.dtsi >> index 38f29bb789..026237b088 100644 >> --- a/arch/arm/dts/stm32mp15-ddr.dtsi >> +++ b/arch/arm/dts/stm32mp15-ddr.dtsi >> @@ -2,153 +2,237 @@ >> /* >> * Copyright : STMicroelectronics 2018 >> */ >> +#include <linux/stringify.h> >> >> -/ { >> - soc { >> - ddr: ddr@5a003000 { >> - u-boot,dm-pre-reloc; >> +&ddr { >> + config-DDR_MEM_COMPATIBLE { >> + u-boot,dm-pre-reloc; >> - compatible = "st,stm32mp1-ddr"; >> + compatible = __stringify(st,DDR_MEM_COMPATIBLE); > > I have just a concern here, but only for ST ecosystem. > > As the DDR_MEM_COMPATIBLE is not generated by CubeMX tools. > > But I will manage it after..... > > 2 solution; I add a default value. > > #ifndef DDR_MEM_COMPATIBLE > #define DDR_MEM_COMPATIBLE ddr-0 > #endif
The other option would be to move the #define DDR_MEM_COMPATIBLE into board DTS, to let the board specify it's own per-DRAM-config compatible, on which it will match. E.g.: #define DDR_MEM_COMPATIBLE ddr-1gib #include "stm32mp15-ddr3-1x4Gb-1066-binG.dtsi" #define DDR_MEM_COMPATIBLE ddr-2gib #include "stm32mp15-ddr3-2x4Gb-1066-binG.dtsi" Might be a bit better, but it might also lead to a lot of duplication.

