This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: the macro RPMSG_VRING_SIZE in RTOS SDK is incompatible when LINUX SDK use 4k page size(CONFIG_ARM64_4K_PAGES)

Part Number: TDA4VM

Hi, TI,

We tried to use 4k page size in linux, and found that if 4k page size(CONFIG_ARM64_4K_PAGES) is configed in LINUX, the macro RPMSG_VRING_SIZE must be changed in TI RTOS to run vx_app_arm_ipc.out success.

It is because the offset between rx vring address and tx vring address from linux has changed from 64k to 16k.

As a result, if we change the page size config in linux, we have to modify RTOS SDK, and re-compile the RTOS binary.


RTOS modifed file (version: ti-processor-sdk-rtos-j721e-evm-08_00_00_12):

    vision_apps\apps\basic_demos\app_rtos\rtos_linux\app_ipc_rsctable.h

    delete:    #define RPMSG_VRING_SIZE (0x10000)

    add:        #define RPMSG_VRING_SIZE (0x4000)

Is the above analysis right? If so, could the RTOS team add this in the RTOS documentation, or implement the code in a more general way, which can be compatible with 4k/64k page size in linux.

Thanks!

 

  • Hi Xueming,

    I see that you are using SDK 8.0. This SDK version is using the hard-coded addresses in the resource_table for vring addresses. This only works as long as the addresses chosen matches the Linux-side DMA allocation addresses. The current addresses happens to work because they match for 64K page sizes, and as you have discovered doesn't work when using 4K page size.

    The correct recommended usage should be to use FW_RSC_ADDR_ANY (0xffffffff) in the resource table, and let the Linux remoteproc framework allocate and publish back the allocated addresses in the resource table. Adjusting the  RPMSG_VRING_SIZE from 0x10000 to 0x4000 is only an interim short-term fix for 4K page, and is not recommended approach.

    We have already fixed this issue and made the updates to the resource table in SDK 8.1. I recommend you to download SDK 8.1 (08.01.00.13) and use that as a reference. 

    The resource table file is also moved to a different directory (<RTOS_SDK>/vision_apps/platform/ti/j721e/rtos/common_linux/app_ipc_rsctable.h).

    Short summary of changes would be to

    1. #define RPMSG_ADDR_ANY (~0) in the app_ipc_rsctable.h

    2. Replace all the <MCU/C66>_MEM_RPMSG_VRING{0/1} with RPMSG_ADDR_ANY in the ti_ipc_remoteproc_ResourceTable structure in app_ipc_rsctable.h

    regards

    Suman