This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM572x DDR3 size detection in U-boot

Hi,

TI,I am using the u-boot from ti-u-boot-2016.05 branch,and I want to make the u-boot works on the board with 1G DDR3(EMIF1:512MiB,EMIF2:512MiB) or 2G DDR3(EMIF1:1GiB,EMIF2:1GiB).

Now the problem is that the ddr3 on beagle_x15 board is 2GiB(the default configuration on the u-boot is 2GiB too),when I use the u-boot boot up the board that has 2GiB DDR3,the capacity detection is ok,and it will show me that the ddr is 2GiB.But when it use it boot up the board that with 1GiB,it also shows me that the ddr is 2GiB.So I change the struct dmm_lisa_map_regs on the board/ti/am57xx/board.c file like that:

static const struct dmm_lisa_map_regs beagle_x15_lisa_regs = {
+#if 0
.dmm_lisa_map_3 = 0x80740300,
.is_ma_present = 0x1
+#endif
+#if 1
+ /* 1G DDR3 (EMIF1 -- 512MiB; EMIF2 -- 512MiB) */
+ .dmm_lisa_map_0 = 0x00000000,
+ .dmm_lisa_map_1 = 0x80640300,
+ .dmm_lisa_map_2 = 0x80640300,
+ .dmm_lisa_map_3 = 0xFF020100,
+ .is_ma_present = 0x1
+#endif
};

After do that,I got the right result。

I don't want to use two u-boot,which is one for 1GiB DDR3,and the other one for 2GiB DDR3.How should I do ?How to modify the u-boot ?so the u-boot works on 1GiB ddr3,and it shows me that the capacity of ddr is 1GiB.When it  works on 2GiB ddr3,and it shows me that the capacity of ddr is 2GiB.

BR,

vefone