I guess you already read AN5122 STM32MP1 Series DDR memory routing guidelines
Component placement, DDR routing, PCB stack-up and layer usage are very complex stuff and you should carefully prepare the job to avoid painful PCB rework afterward.
You will find also some help from:
AN5168 How to configure DDR on STM32MP1 MPUs
AN5031 Getting started with STM32MP151, STM32MP153 and STM32MP157 line hardware development