iMX8MP OCRAM (map, uses)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX8MP OCRAM (map, uses)

587 Views
Timofey
Contributor I

Hi, colleagues and NXP engineers!

I have some questions on iMX8MP, the topic is OCRAM.
It's claimed it has 576kB of OCRAM p.25, section "2.2 Cortex-A53 Memory Map".
According to this section OCRAM starts from 900000h and goes up to 98FFFFh.
This range represents the claimed 576kBs. At this point, everything is clear.

Also, there is memory for BootROM (or iROM, maybe?), which is described on p.26
of the same section. Its range is from zeroes to 3FFFFh which represents 256kB.

But there is "Figure 6-2. Internal ROM and RAM memory map" on p.748, which
leads to confusion. The left side remains clear because it doesn't conflict
with p.26. But the right side "OCRAM Memory Map" is unclear to me.

The first question is why OCRAM top is lower by 10000h on p.748 compared to p.25?

I've done some research which lead to few more questions.
Second question. Let's assume iROM can't place application in 900000h because
at that moment it uses that memory region. But why I can't place my application
at 918000h (as shown in the table)? It can run only being placed at 920000h and
higher. Otherwise, it hangs.

I've done some kind of memory test by setting SP to specific locations and using
reentrant function which outputs SP and calls itself.

If I set SP to the same 920000h it goes all the way down to the (almost) 900000h.
This behavior can be explained I just rewrite the "Reserved for ROM" region and
reach the bottom of memory. This is allowed because the CPU is not in iROM at
that moment, and it is said: "If no ROM/HAB APIs are being used, the entire OCRAM
region can be used freely after the boot." (p.748)

When I set SP to 990000h (which is 576kB boundary) it goes all the way down until
it meets my code, which in that case was placed at "standard" 920000h and is about
1.5kB in size. At that moment it crashes because it's destroyed. That looks clear too.

But the highest top position I could place my application to is 970000h (the size
of my binary still was ~1.5kB). That is not clear to me. Possibly it can be explained
by assuming that iROM (by some reason) doesn't allow loading application at
addresses higher than 970000h. But why?

Third question. In addition to all that, I've noticed OCRAM region in Linux is set like
this:

ocram: ocram@900000 {
no-map;
reg = <0 0x900000 0 0x70000>;
};

its size is 70000h! Which is 448kB. And it is DTS for iMX8MP exactly (!) not the 8th,
8M or any other bunch of series.

Thus, we have:
1. It looks there is mismatch in OCRAM specification in different datasheet sections.
2. It looks the memory on the top is usable but at runtime only, application and/or
its data can't be placed there.
3. Also, application should be placed with some offset higher than claimed in OCRAM
Memory Map.
4. Unclear OCRAM Linux kernel OF Node.

After all, my guess is iROM doesn't load application to specific addresses (controls
allowed/not allowed addresses to load and place application to). But this is not
documented and does not explain why these and those addresses are not allowed and
does not explain kernel's OF node describing OCRAM.

Could someone please clarify or explain the actual iMX8MP OCRAM map and use of it?

 

p.25 — 2.2 Cortex-A53 Memory Mapp.25 — 2.2 Cortex-A53 Memory Mapp.26 — 2.2 Cortex-A53 Memory Mapp.26 — 2.2 Cortex-A53 Memory Mapp.748 — 6.1.4.1 Internal ROM/RAM memory mapp.748 — 6.1.4.1 Internal ROM/RAM memory map

0 Kudos
Reply
1 Reply

533 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

About unable to use full OCRAM memory size (576KB), please use below link for detailed info:

https://community.nxp.com/t5/i-MX-Processors/How-to-access-to-the-top-address-of-OCRAM-for-i-MX8QXP/...

https://community.nxp.com/t5/i-MX-Processors/Unable-to-access-complete-OCRAM-in-i-mx8mm/td-p/1813513

Due to ATF partition, that also the reason why the DTS definition at <imx8mp.dtsi> not set OCRAM size to 576KB.

ocram: ocram@900000 {
			no-map;
			reg = <0 0x900000 0 0x70000>;
		};

Customer can modify above OCRAM memory size to 512KB (0x80000) and leave 64KB for ATF usage.

Thanks for the attention.

Mike 

0 Kudos
Reply