I tested the DDR initialization time on RDB2 using BSP37 and found the two most time-consuming phases were the execute_training() (about 73ms) and the init_memory_ecc_scrubber() (about 358ms).
For the execute_training(), it is necessary after a POR to set up a working environment for the DDR controller. For the init_memory_ecc_scrubber(), you can not invoke it if you do not enable the DRAM-related ECC feature. If the init_memory_ecc_scrubber() is skipped, you may save the corresponding executing time. However, in this case, you may need to manually initialize the DRAM before using it. (The init_memory_ecc_scrubber() can fill all DRAM with zero, so it is not recommend to skip this function.)
On the other hand, if you do not skip the init_memory_ecc_scrubber(), you can shrink the DRAM size to save a little time in executing the init_memory_ecc_scrubber(). For example, though the physical DRAM has a capacity of 4GB, you can just use part of DRAM as per the real requirement of your project. In this case, the time consumed by executing init_memory_ecc_scrubber() will be less.
BTW, no matter which approaches you will use, I would like to suggest configuring the corresponding parameters through the S32 DDR tool and using the tool to generate the source code, rather than modifying the source code manually.
Hope this helps.
Thanks,
Mayank S Patel