Add a new shared memory region on Android Auto P9.0.0_GA2.1.0 BSP

Document created by Qiang Li - Mpu Se Employee on Jun 12, 2019
Version 1Show Document
  • View in full screen mode

In new iMX8QM and iMX8QXP BSP, it had implemented hardware partition to split the resource and memory regions.

The default Android Auto BSP had given example for shared memory between M4 and A core, it is used for RPMSG.

 

Here is an example to add a new shared memory for iMX8QXP MEK board with Android Auto P9.0.0_GA2.1.0 BSP, which can be accessed in both M4, Uboot and Linux Kernel. The added shared memory region is from 0x90C00000 to 0x97FFFFFF.

 

vendor_nxp_fsl-proprietary_uboot-firmware.patch

SCFW patch for board file to create the new shared memory region (0x90C00000~0x97FFFFFF).

This patch is applied to android_build/vendor/nxp/fsl-proprietary/uboot-firmware/imx8q_car/board-imx8qxp.c, after patched, copy this file to SCFW porting kit and build out a new SCFW image, put it to "android_build/vendor/nxp/fsl-proprietary/uboot-firmware/imx8q_car/mx8qx-scfw-tcm.bin".

 

vendor_nxp-opensource_uboot-imx.patch

This is the Uboot patch to map the shared memory region, if Uboot doesn't need access these memory, this patch is not needed.

 

vendor_nxp-opensource_kernel_imx.patch

This is the kernel patch to map the shared memory region.

 

Note: In this example, we put the two shared memory region together, then it will not split the memory region used in Linux. From test, if we split the Linux kernel memory into two regions, the Linux kernel will fail to boot up.

 

New reserved memory region in Kernel:

                /*
                 * reserved-memory layout
                 * 0x8800_0000 ~ 0x8FFF_FFFF is reserved for M4
                 * Shouldn't be used at A core and Linux side.
                 *
                 */
                decoder_boot: decoder_boot@0x84000000 {
                        no-map;
                        reg = <0 0x84000000 0 0x2000000>;
                };
                encoder_boot: encoder_boot@0x86000000 {
                        no-map;
                        reg = <0 0x86000000 0 0x200000>;
                };
                rpmsg_reserved: rpmsg@0x90000000 {
                        no-map;
                        reg = <0 0x90000000 0 0x400000>;
                };
                rpmsg_dma_reserved:rpmsg_dma@0x90400000 {
                        compatible = "shared-dma-pool";
                        no-map;
                        reg = <0 0x90400000 0 0x800000>;
                };
                /* PLATFORM_BSP add for M4 RESOURCE */
                m4_resource: m4_resource@0x90c00000 {
                        compatible = "shared-dma-pool";
                        no-map;
                        reg = <0 0x90c00000 0 0x7400000>;
                };
                decoder_rpc: decoder_rpc@0x98000000 {
                        no-map;
                        reg = <0 0x98000000 0 0x200000>;
                };
                encoder_rpc: encoder_rpc@0x98200000 {
                        no-map;
                        reg = <0 0x98200000 0 0x200000>;
                };
                dsp_reserved: dsp@0x98400000 {
                        no-map;
                        reg = <0 0x98400000 0 0x2000000>;
                };
                encoder_reserved: encoder_reserved@0x9a400000 {
                        no-map;
                        reg = <0 0x9a400000 0 0x800000>;
                };

Outcomes