AnsweredAssumed Answered

How to assign 4GB memory addresses to DDR in uboot

Question asked by Min Zhao on Jul 7, 2014
Latest reply on Jul 14, 2014 by Yiping Wang

Hi,

We have designed a product using p2020 cpu referring to the design of p2020rdb-pc board.

We changed the chip of DDR to 4GB.

My ddr is 2 rank, I have modify the following codes in p1_p2_rdb_pc.h:

#define CONFIG_SYS_SDRAM_SIZE_LAWLAW_SIZE_4G
#define CONFIG_CHIP_SELECTS_PER_CTRL 2

 

But I don't understand the following cods in board/freescale/p1_p2_rdb_pc/ tlb.c:

 

#if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_SPL)

#ifdef CONFIG_SYS_INIT_L2_ADDR

  /* L2SRAM */

  SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,

       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,

       0, 8, BOOKE_PAGESZ_256K, 1),

  SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,

       CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,

       MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,

       0, 12, BOOKE_PAGESZ_256K, 1),

#else

  /* *I*G - eSDHC/eSPI/NAND boot */

  SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE, CONFIG_SYS_DDR_SDRAM_BASE,

  MAS3_SX|MAS3_SW|MAS3_SR, 0,

  0, 8, BOOKE_PAGESZ_1G, 1),

 

#if defined(CONFIG_P1020MBG) || defined(CONFIG_P1020RDB_PD)

  /* 2G DDR on P1020MBG, map the second 1G */

  SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE + 0x40000000,

  CONFIG_SYS_DDR_SDRAM_BASE + 0x40000000,

  MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,

  0, 9, BOOKE_PAGESZ_1G, 1),

#endif /* P1020MBG */

#endif /* not L2 SRAM */

#endif /* RAMBOOT/SPL */

 

I found config_sys_init_l2_addr has been defined in p1_p2_rdb_pc.h. So did that mean there don't set tlb_entry 8 for ddr to p2020rdb-pc?

If I want to assign 4GB memory map to DDR, how should I modify the above codes in tlb.c?

 

Best regards,

Min Zhao

Outcomes