IMX8MP On chip RAM memory access

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

IMX8MP On chip RAM memory access

1,181 Views
Samhitha_Kashyap
Contributor III

Hello,

I want to learn how I can access the OCRAM  to read and data to the memory.

Can anyone advice how I could achieve that on Linux cortex A-53?

On-Chip RAM - OCRAM (576 KB)

start address: 0x00900000 => reserved for ROM

start address: 0x00918000  =>OCRAM FREE AREA

end address: 0x0097FFFF

https://www.nxp.com/webapp/Download?colCode=IMX8MPRM 

 

Thank you!

IMX8MPLUS 

0 Kudos
5 Replies

1,094 Views
Samhitha_Kashyap
Contributor III

Hi Sanket,

Would it be possible to verify how much memory the Linux utilizes and the rest can be used for the user application.

If it is possible, how could I verify the same and allocate the rest of the memory for my application. 

Thanks & Regards,

Samhitha Kashyap

0 Kudos

1,081 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @Samhitha_Kashyap ,

I hope you are doing well.
 
You can determine how much memory in the OCRAM, Linux kernel Reserved for itself by looking into the dtsi file (reserved memory node) of the soc
in the case of imx8mp, it is 448 KB.
 
resmem: reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;

		ocram: ocram@900000 {
			no-map;
			reg = <0 0x900000 0 0x70000>;
		};
 
      .....
      .....
 
}
 
So here 0x70000 ( 448K) bytes are reserved for Linux usage. and cannot be virtually mapped to the userspace as specified by the no-map property.
after 0x7000 bytes you can use it for other applications.
But you need to make sure that any  M7 core Application not using OCRAM. which can be determined by looking into the Linker script of a particular application.
 
Thanks & Regards
Sanket Parekh
 
0 Kudos

1,056 Views
Samhitha_Kashyap
Contributor III

Hi @Sanket_Parekh,

Thanks for the response, it was helpful! 

Would it be possible for me to modify the device tree to support DMA within the 448 KB OCRAM space, if I can't use it for the user application?

 

Thanks & Regards,
Samhitha Kashyap

0 Kudos

1,018 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @Samhitha_Kashyap,

Please note that the NXP does not recommend the modification in the node for 448 KB OCRAM Space as it is used by other drivers.
One can use memory regions after 0x970000 to Support DMA using the compatible = "shared-dma-pool" property.

 

Thanks & Regards

Sanket Parekh

0 Kudos

1,151 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @Samhitha_Kashyap 

I hope you are doing well.

To access OCRAM First you need to ensure that you don't try to access the region that is used by ATF.

in the case of u-boot, one can use md/mw command to access OCRAM directly.

It is not recommended to use OCRAM in userspace as Linux itself uses it.

Thanks & Regards

Sanket Parekh

0 Kudos