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.

AM335x DDR3 Problem

Other Parts Discussed in Thread: AM3358, TEST2

Hi,

I have designed a custom board based on BeagleBone Black .  

It has AM3358 and Memory is AS4C256M16D3L-12BIN(Alliance) instead of  Micron.

I have a problem on u-boot-spl process whit uart0.  it occurs after DDR initialization(sdram_init() function).

Writing Double Words(32bit) at address 0x80000000 is OK. Writing 1Word(16bit) at address 0x80000000 is OK. 

But When Writing 1Byte(8bit) at address 0x80000000, it writes wrong value.

I tried DDR PHY register configuration. But It's not improved. 

Dose anybody has  good solutions? 

Regards

Kiyoji

  • Hi Biser,

    Yes I have already done these wiki. Writing 32bit value to 0x80000000~0x9FFFFFFC is fine. The problem is a byte writing.

    After config_ddr() function, I executed a code below.

    ulong ddata = 0;
    writel(0x0, 0x80000000);
    writeb(0x0, 0x80000000);
    ddata = readl(0x80000000);

    But ddata value is 0x00001200.  Why? It should be 0x0.

    Now I am thinking of removing this DDR3 to change Micron device.

    Best Regards,

    Kiyoji 

  • I'm not a SW expert, but from what I see you write byte and read long. Can you try writing a more recognizable value, like 0xAA or 0x55?

  • Hi Biser,

    OK I tried writing another vlue.

     ulong ddata_ul = 0;
     uchar ddata_uc0 = 0;
     uchar ddata_uc1 = 0;
     writel(0x0, 0x80000000);  // fill zero into address 0x80000000〜0x80000003
     writeb(0xAA, 0x80000000); // write 0xAA to address 0x80000000
     ddata_ul = readl(0x80000000);  // read from address 0x80000000. ddata_ul should be 0x000000AA.
     ddata_uc0 = readb(0x80000000);  // read from address 0x80000000. ddata_uc0 should be 0xAA.
     ddata_uc1 = readb(0x80000001);  // read from address 0x80000001. ddata_uc1 should be 0x00.
     printf("Test1 : ddata_ul=0x%x, ddata_uc0=0x%x, ddata_uc1=0x%x\n", (unsigned int)ddata_ul, (unsigned int)ddata_uc0, (unsigned int)ddata_uc1);
     
     writel(0x0, 0x80000000);  // fill zero into address 0x80000000〜0x80000003
     writeb(0x55, 0x80000000); // write 0x55 to address 0x80000000
     ddata_ul = readl(0x80000000);  // read from address 0x80000000. ddata_ul should be 0x00000055.
     ddata_uc0 = readb(0x80000000);  // read from address 0x80000000. ddata_uc0 should be 0x55.
     ddata_uc1 = readb(0x80000001);  // read from address 0x80000001. ddata_uc1 should be 0x00.
     printf("Test2 : ddata_ul=0x%x, ddata_uc0=0x%x, ddata_uc1=0x%x\n", (unsigned int)ddata_ul, (unsigned int)ddata_uc0, (unsigned int)ddata_uc1);
     
     writel(0x123455aa, 0x80000000);  // write 0x123455AA to address 0x80000000
     ddata_ul = readl(0x80000000);  // read from address 0x80000000. ddata_ul should be 0x123455AA.
     ddata_uc0 = readb(0x80000000);  // read from address 0x80000000. ddata_uc0 should be 0xAA.
     ddata_uc1 = readb(0x80000001);  // read from address 0x80000001. ddata_uc1 should be 0x55.
     printf("Test3 : ddata_ul=0x%x, ddata_uc0=0x%x, ddata_uc1=0x%x\n", (unsigned int)ddata_ul, (unsigned int)ddata_uc0, (unsigned int)ddata_uc1); 

    Result is

    Test1 : ddata_ul=0x1200, ddata_uc0=0x0, ddata_uc1=0x12
    Test2 : ddata_ul=0xed00, ddata_uc0=0x0, ddata_uc1=0xed
    Test3 : ddata_ul=0x123455aa, ddata_uc0=0xaa, ddata_uc1=0x55  

    Good result is only test3 on our custom board. Same test on BBB was all good.

    Best regards,

    Kiyoji

  • Can you boot to u-boot prompt?

  • Loading u-boot-spl.bin into internal SRAM with uart is OK. SPL runs until DDR3 initialization.
    Then I checked DDR3 and I found this problem. Because SPL stoped at reading EEPROM after DDR3 initialization.

    Best Regards,
    Kiyoji
  • This probably means that DDR is not working properly. This can be due either to a schematic error, bad PCB layout, bad PCB assembly, or wrong DDR configuration. I suggest you follow the step-by-step tutorial I referred above to eliminate the possibility of wrong DDR configuration.