Hello Team,
I have been looking at the remoteproc and rpmsg Linux driver implementation for the imx8mm SoC together with the rpmsg_lite_str_echo_rtos example distributed with the SDK of cortex M4 co-processor.
In the device tree I noticed the following entries. (I only copied entries relavent to this question)
reserved-memory {
vdev0vring0: vdev0vring0@b8000000 {
compatible = "shared-dma-pool";
reg = <0 0xb8000000 0 0x8000>;
no-map;
};
vdev0vring1: vdev0vring1@b8008000 {
compatible = "shared-dma-pool";
reg = <0 0xb8008000 0 0x8000>;
no-map;
};
rsc-table {
reg = <0 0xb80ff000 0 0x1000>;
no-map;
};
}
imx8mm-cm4 {
compatible = "fsl,imx8mm-cm4";
rsc-da = <0xb8000000>;
clocks = <&clk IMX8MM_CLK_M4_DIV>;
mbox-names = "tx", "rx", "rxdb";
mboxes = <&mu 0 1
&mu 1 1
&mu 3 1>;
memory-region = <&vdev0vring0>, <&vdev0vring1>, <&vdevbuffer>;
syscon = <&src>;
};
When looking at the reserved-memory for m4, it seems that two vrings are placed at 0xb8000000 and 0xb008000 respectively, and the place reserved for the rsc-table is 0xb80ff000.
However, in imx8mm-cm4 node, the resource table is said to be available at 0xb8000000 location.
When looking at the SDK example rpmsg_lite_str_echo_rtos, I found the following function.
void copyResourceTable(void)
{
/*
* Resource table should be copied to VDEV0_VRING_BASE + RESOURCE_TABLE_OFFSET.
* VDEV0_VRING_BASE is temperorily kept for backward compatibility, will be
* removed in future release
*/
memcpy((void *)VDEV0_VRING_BASE, &resources, sizeof(resources));
memcpy((void *)(VDEV0_VRING_BASE + RESOURCE_TABLE_OFFSET), &resources, sizeof(resources));
}
It looks like we copy the resource table to both these locations (0xb8000000 and 0xb80ff000) because of probably a mistake we made in the device tree file.
I believe the first memcpy is not required if we change the device tree such that rsc-da property is 0xb80ff000. Is my understanding correct?
Hello,
It is not for a mistake is for legacy compatibility of some changed features, you may refer to the following commit:
https://source.codeaurora.org/external/imx/linux-imx/commit/arch/arm64/boot/dts/freescale/imx8mn-evk...
Best regards,
Aldo.
Thank you for the response. However, I have one follow up question related to the rsc-da.
Shouldn't that property also change to have the same address as that of the rsc-table?