How to configure imx8mn-evk-rpmsg.dts

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

How to configure imx8mn-evk-rpmsg.dts

388 Views
Cupcake
Contributor II

Hi

We are using a custom board with iMX8MN (the Azurewave PU551). This board have a DDR memory of 512Mbytes.

We want to use the RPMSG feature, currently it "works" with original DTS (imx8mn-evk-rpmsg.dts) but we have random crashes (after N minutes) (6 minutes with massive 100bytes exchanges, more than 37 minutes with massive 10 bytes exchanges)

When I see the content of (imx8mn-evk-rpmsg.dts) I really don't understand how it's possible that it works "a litle" as all the reserved memory mapping are out of DDR region.

 

I would like to understand how to configure this file for my plateform.

Here is the A53 memory map:

Cupcake_0-1692264299008.png

According to this, If I have 512Mbytes available, the available DDR region is between 0x4000'0000 and 0x6000'0000

In the DTS we have this:

/ {
	reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;

		m_core_reserved: m_core@0x80000000 {
			no-map;
			reg = <0 0x80000000 0 0x1000000>;
		};

		vdev0vring0: vdev0vring0@b8000000 {
			reg = <0 0xb8000000 0 0x8000>;
			no-map;
		};

		vdev0vring1: vdev0vring1@b8008000 {
			reg = <0 0xb8008000 0 0x8000>;
			no-map;
		};

		rsc_table: rsc_table@b80ff000 {
			reg = <0 0xb80ff000 0 0x1000>;
			no-map;
		};

		vdevbuffer: vdevbuffer@b8400000 {
			compatible = "shared-dma-pool";
			reg = <0 0xb8400000 0 0x100000>;
			no-map;
		};
	};
        .....
	imx8mn-cm7 {
		compatible = "fsl,imx8mn-cm7";
		rsc-da = <0xb8000000>;
		mbox-names = "tx", "rx", "rxdb";
		mboxes = <&mu 0 1
			  &mu 1 1
			  &mu 3 1>;
		memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>;
		status = "okay";
	};
};

 

First I would like to know: How to read the reg properties ?

-> On google I found: reg = <address1 length1 [address2 length2] [address3 length3] ... >

-> But here for sure it does not apply, (addresses canot be 0 everywhere)

-> I think here it's < [?] [offset] [?] [size] >. I don't know what is [?]

Is there any rules to do this mapping ? like alignement ? 

Is it discribed somewhere what is vdevbuffer, rsc_table, vdev0vring1 and vdev0vring0 ?

-> I don't find any informations about this in reference manual

 

I ask the question here, because the support don't want to help me this is not a board provided by them.

 

Thanks for any help.

0 Kudos
1 Reply

358 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport
 
I hope you are doing well.
 
imx8mn-evk-rpmsg.dts is only for i.MX8MN EVK, Customer needs to modify dts and SDK for a custom board with 512 MB RAM.
 
The customer could use 0x58000000 as a vdev0vring0 ring buffer base address.

First I would like to know: How to read the reg properties?
[Ans]: reg property can be read as below.
          reg = <address1 length1 [address2 length2] [address3 length3] ... >
Here, the address and cell size is 2 (2 words (2 x 32 bit))
[in the case where the base address can not fit in 32 bits (start at 0x1 0000 0000) ]
 
for example,           
reg = <0 0xb8000000 0 0x8000>;
here address is 0xb8000000 and size is 0x8000,  and 0's are MSB of address and size
 
Are there any rules to do this mapping? like alignment?
Is it described somewhere what is vdevbuffer, rsc_table, vdev0vring1, and vdev0vring0?
[Ans]: Yes, Linux requires a memory region aligned to 0x1000(4KB).
           Please refer to /middleware/multicore/rpmsg_lite/lib/include/platform/imx8mn_m7/rpmsg_platform.h  in SDK for more information.
 
Remoteproc & rpmsg requires a resource table in cortex-M core ELF to store information about the version, shared memory regions, and other information.
Please refer to /boards/evkmimx8mn/multicore_examples/rpmsg_lite_pingpong_rtos/linux_remote/rsc_table.h for more information.
 
One needs to change VDEV0_VRING_BASE in a board.h file of SDK for different DDR sizes.
 
One can also refer to 9.1 i.MX Linux RPROC support in AN5317.
 
I hope it helps!
 
Thanks & Regards,
Sanket Parekh
0 Kudos