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.

AM389x - Memory map configuration

Hello everyone,
I'm trying to configure the memory map on my custom board using an AM389x processor (no interleaved).
I have 1 GB DDR (512MB on EMIF0 and 512MB on EMIF1).

My previous running configuration was:

#define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */
#define PHYS_DRAM_1_SIZE 0x40000000 /* 1 GB */
#define PHYS_DRAM_2 0xC0000000 /* DRAM Bank #2 */
#define PHYS_DRAM_2_SIZE 0x40000000 /* 1 GB */
__raw_writel(0x0, DMM_LISA_MAP__0);
__raw_writel(0x0, DMM_LISA_MAP__1);
__raw_writel(0x80600100, DMM_LISA_MAP__2);
__raw_writel(0xC0600220, DMM_LISA_MAP__3);

But checking follow links
http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map#Changing_Memory_Map_For_512MB_DM816x_Board
http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/304274/1060662#1060662
https://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/294217

I think the right configuration could be:

#define PHYS_DRAM_1            0x80000000 /* DRAM Bank #1 */ 
#define PHYS_DRAM_1_SIZE 0x20000000 /* 512 MB */ 
#define PHYS_DRAM_2            0xA0000000 /* DRAM Bank #2 */ 
#define PHYS_DRAM_2_SIZE 0x20000000 /* 512 MB */
__raw_writel(0x0, DMM_LISA_MAP__0);
__raw_writel(0x0, DMM_LISA_MAP__1);
__raw_writel(0x80500100, DMM_LISA_MAP__2);
__raw_writel(0xA0500200, DMM_LISA_MAP__3);

I have a lot of doubts about the values of this constants and about the configuration in general....
What is the right configuration?
Are there other constants that I have to set?
Is the PHYS_DRAM* the physical configuration or it is used for cache purpose?
What if I want an interleaved configuration?

Thank you in advance for your help,

Simone

  • Hi Simone,

    Simone Cilli1 said:

    I think the right configuration could be:

    #define PHYS_DRAM_1            0x80000000 /* DRAM Bank #1 */ 
    #define PHYS_DRAM_1_SIZE 0x20000000 /* 512 MB */ 
    #define PHYS_DRAM_2            0xA0000000 /* DRAM Bank #2 */ 
    #define PHYS_DRAM_2_SIZE 0x20000000 /* 512 MB */
    __raw_writel(0x0, DMM_LISA_MAP__0);
    __raw_writel(0x0, DMM_LISA_MAP__1);
    __raw_writel(0x80500100, DMM_LISA_MAP__2);
    __raw_writel(0xA0500200, DMM_LISA_MAP__3);

    This looks correct configuration for me. See also AM389x TRM, section 4.3.4 Address Management Using LISA Sections, and AM389x silicon errata, advisory 2.1.48.


    You can also test your DDR with:

    BR
    Pavel

  • Hello Pavel!
    Yes that configuration seems logic to me with respect of TI documentations.
    Now I have several working configurations with and without interleaved on Sitara.

    If that configuration is correct, my doubts come from the other my processors, a DM8168 and my old AM389X (version 2.0). Both are working with this config:
    #define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */
    #define PHYS_DRAM_1_SIZE 0x40000000 /* 1 GB */
    #define PHYS_DRAM_2 0xC0000000 /* DRAM Bank #2 */
    #define PHYS_DRAM_2_SIZE 0x40000000 /* 1 GB */
    __raw_writel(0x0, DMM_LISA_MAP__0);
    __raw_writel(0x0, DMM_LISA_MAP__1);
    __raw_writel(0x80600100, DMM_LISA_MAP__2);
    __raw_writel(0xC0600220, DMM_LISA_MAP__3);


    How is it possible?
    (My HW disable the most significan bit of the physical address, so 0x20... == 0x00...)
    But, I don't have 2GB DDR, so I can't cover the memory from 0x80... to 0xFF....
    From 0x80... to 0x9F... I have 512 MB. How does it know that it should skip to the next EMIF?

    I found this phrase "On Media Controllers, the first address range is used to access DDR with cache enabled and the second address is used to access the same DDR with cache disabled." in processors.wiki.ti.com/.../EZSDK_Memory_Map.
    Could it be the explanation? Could my memory be mapped 1GB cached and 1 GB no-cached to allow a "dual mode" access to the same area?

    Thanks Pavel for your patience :)
    Simone

  • Simone,

    Simone Cilli1 said:
    #define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */
    #define PHYS_DRAM_1_SIZE 0x40000000 /* 1 GB */
    #define PHYS_DRAM_2 0xC0000000 /* DRAM Bank #2 */
    #define PHYS_DRAM_2_SIZE 0x40000000 /* 1 GB */

    This was fixed with the below u-boot patches (DM816x and DM814x)

    DM816x and DM814x TI EVMs have 1GB DDR3, and before these patches u-boot wrongly report that DDR3 is 2GB instead of 1GB.

    Simone Cilli1 said:
    __raw_writel(0x0, DMM_LISA_MAP__0);
    __raw_writel(0x0, DMM_LISA_MAP__1);
    __raw_writel(0x80600100, DMM_LISA_MAP__2);
    __raw_writel(0xC0600220, DMM_LISA_MAP__3);

    DM816x TI EVM has 1GB DDR3 and using the below settings works correct:

    DMM_LISA_MAP__0 = 0

    DMM_LISA_MAP__1 = 0

    DMM_LISA_MAP__2 = 0x80640300

    DMM_LISA_MAP__3 = 0xC0640320

    DM814x TI EVM has 1GB DDR3 and using the below settings works correct:

    DMM_LISA_MAP__0 = 0

    DMM_LISA_MAP__1 = 0

    DMM_LISA_MAP__2 = 0

    DMM_LISA_MAP__3 = 0x80640300

    BR
    Pavel

  • I found the patch but not the LISA config.
    The new configuration seems working. Great!
    I'll test it today and tomorrow...

    Where the 2 GB are managed in the DVRRDK code? I have the 03.50.00.05 version...

    Thank you Pavel! You have a really deep knowledge on TI technologies!
    Simone

    Ps. The button "Answered" doesn't exist anymore on my browser. The button has the text "Verify Answer" now ;)
  • Simone Cilli1 said:
    Where the 2 GB are managed in the DVRRDK code? I have the 03.50.00.05 version...

    See if the below e2e threads will help:

    BR
    Pavel

  • Dear Pavel,

    I'm a collegue of Simone. I think we already know.

    thanks for your help.

    We are having some different behaviour in some board with different silicon revision. (2.0 and 2.1). looking at the ref manual

    on pag 2635 : revision history. I can see there there are several change on different frequency (DMM CLK from 380 to 364 Mhz , : Changed 48 MHz to 16 MHz for SYSCLK9 ... 432Mhz for Audio etc....). I'm going to check our uboot how is configuring, but just to know is there any patched rerfernce uboot that already take care of this important change on frequency... I wonder for example if the difference we are experiencing in DMM behaviour on different silicon revision could be due to 380Mhz clock...

    Thanks

    Omar Pighi

  • Omar,

    Omar Pighi17 said:
    We are having some different behaviour in some board with different silicon revision. (2.0 and 2.1)

    The differences between 2.0 and 2.1 are described in the silicon errata document:

    Omar Pighi17 said:
    just to know is there any patched rerfernce uboot that already take care of this important change on frequency

    See the below e2e thread:

    See also the latest patches of the below u-boot branch:

    BR
    Pavel