Booting sama5d2 with lpddr2

I'm having a SAMA5D26C with a LPDDR2 EDB1332BDBH-1. The CPU boots successfully ROMBOOT and is able to load at91bootstrap from QSPI memory. I get debug output from at91bootstrap, but I fail to load linux.

Investigating this further show me that the RAM initalization works fine but the CPU hangs when trying to load the device tree from flash into RAM.

So I add this loop:

volatile char * ptr = (char *)0x20000000;
while(1) {
    dbg_info("ptr: %x value: %c\n", ptr, *ptr);
    ptr += 1;
}

That gives me output as expected:

ptr: 0x20000000 value: U
ptr: 0x20000001 value: U
...

Up until:

...
ptr: 0x203ffffe value: U
ptr: 0x203fffff value:
ptr: 0x203fffff value:
ptr: 0x203fffff value:
ptr: 0x203fffff value:
ptr: 0x203fffff value:
ptr: 0x203fffff value:

It seems as I can't access memory above 4MB even though my RAM size is 128 MB. I've verified that I can write and read the written value from RAM for a value below 4MB.

Why isn't all physical memory accessible and and how come ptr isn't increased after 0x203ffffff?

Parents
  • Hello!

    I think your problem comes from bus Matrix H64MX/H32MX, you can check this by configuring security extensions of bus matrix.

    Read more in chapter 17. Matrix (H64MX/H32MX) of SAMA5D2 Series Datasheet, 17.12 TrustZone Extension to AHB and APB.

    "The slave is an Internal Memory containing one region. The Slave region Max Size is 4 Mbytes." - page 166 of SAMA5D2 Series DATASHEET.

    In chapter 17.12 it is explained how to configure security and access for different areas of memory.

    My first experience with this SoC family SAMA5D2 was the same, I had a problem to access memory regions via External bus interface.

Reply
  • Hello!

    I think your problem comes from bus Matrix H64MX/H32MX, you can check this by configuring security extensions of bus matrix.

    Read more in chapter 17. Matrix (H64MX/H32MX) of SAMA5D2 Series Datasheet, 17.12 TrustZone Extension to AHB and APB.

    "The slave is an Internal Memory containing one region. The Slave region Max Size is 4 Mbytes." - page 166 of SAMA5D2 Series DATASHEET.

    In chapter 17.12 it is explained how to configure security and access for different areas of memory.

    My first experience with this SoC family SAMA5D2 was the same, I had a problem to access memory regions via External bus interface.

Children