OpenAMP support for m33 core on i.mx93

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

OpenAMP support for m33 core on i.mx93

981 Views
tahrens
Contributor I

Hey,

I know this question has already been asked here

Solved: Re: RPMsg support for m33 core on i.mx93 - NXP Community

but I do not understand the accepted answer. In the NXP's Real-Time Edge software framework the RPSMG support is only listed for FreeRTOS.

The i.mx95 A7 core, however, has already been added lately https://github.com/zephyrproject-rtos/zephyr/pull/86923

So my question is if NXP is planing to add also support for the m33. And if not what would be needed to add support manually?

 

0 Kudos
Reply
2 Replies

653 Views
Iulia_Prodan
NXP Employee
NXP Employee

To enable inter-core communication between Linux (running on the A-core) and Zephyr (running on the M33 core), the recommended starting point is the openamp_rsc_table sample from Zephyr.
This sample leverages:
- OpenAMP on Zephyr
- remoteproc and rpmsg on Linux

Prerequisites

Linux setup

  1. Linux BSP: use NXP's official BSP  https://github.com/nxp-imx/linux-imx/tree/lf-6.12.y
  2. Device tree: use the `-rpmsg` variant, e.g. imx93-11x11-evk-rpmsg.dts
  3. U-Boot: run `prepare_mcore` before booting Linux 

Zephyr setup (M33 core)

To run the openamp_rsc_table sample successfully, shared memory between the host and remote cores must be defined using the `zephyr,ipc_shm` property in a DTS overlay.

Next, add the MU node in nxp_imx93_m33.dtsi:

```
mu1: mu1@44220000 {

    compatible = "nxp,imx-mu";

    reg = <0x44220000 DT_SIZE_K(64)>;

    interrupts = <21 0>;

};

```

Then, linker script update - add the resource table section in `linker.ld`:

```

#if defined(CONFIG_OPENAMP_RSC_TABLE)

SECTIONS {

    SECTION_PROLOGUE(.resource_table,, SUBALIGN(8)) {

        KEEP(*(.resource_table*))

    } GROUP_LINK_IN(ROMABLE_REGION)

}

#endif

```

Configuration adjustments for i.MX93

The RX and TX IDs on i.MX93 differ from other boards. You must override the default values in the `.conf` overlay file:

```

CONFIG_IPM_IMX_MAX_DATA_SIZE_16=n

CONFIG_IPM_IMX_MAX_DATA_SIZE_4=y

CONFIG_OPENAMP_WITH_DCACHE=y

CONFIG_LOG=y

CONFIG_OPENAMP_RSC_TABLE_IPM_RX_ID=1

CONFIG_OPENAMP_RSC_TABLE_IPM_TX_ID=0

```

Sample PRs

Linux patch requirement

For proper operation on i.MX93, apply the following Linux patch: https://lore.kernel.org/imx/CAEnQRZDoYvK-YXLjqbXsRAWDkHrWNOoR1OCCWxs+AfNUDuPB_w@mail.gmail.com/T/

Final steps before execution

Before launching the application:

  • Run `prepare_mcore` in U-Boot.
  • Use the `-rpmsg` device tree blob.
  • Follow the steps in the Application Note AN5317.

Additional Resources

0 Kudos
Reply

916 Views
June_Lu
NXP TechSupport
NXP TechSupport

All zephyr IPC support here( Linux kernel OS on the main processor and a Zephyr application on the co-processor)
https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/ipc/openamp_rsc_table/boards
Confirm from the internal team, this is no plan of supporting MPU cm33 now.
But I have send your requirement to the internal team, if there is any update will let you know.
I am sorry for that.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2116014%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EOpenAMP%20support%20for%20m33%20core%20on%20i.mx93%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2116014%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHey%2C%3C%2FP%3E%3CP%3EI%20know%20this%20question%20has%20already%20been%20asked%20here%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FZephyr-Project%2FRPMsg-support-for-m33-core-on-i-mx93%2Fm-p%2F2064979%23M281%22%20target%3D%22_blank%22%3ESolved%3A%20Re%3A%20RPMsg%20support%20for%20m33%20core%20on%20i.mx93%20-%20NXP%20Community%20%3C%2FA%3E%3C%2FP%3E%3CP%3Ebut%20I%20do%20not%20understand%20the%20accepted%20answer.%20In%20the%20NXP's%20Real-Time%20Edge%20software%20framework%20the%20RPSMG%20support%20is%20only%20listed%20for%20FreeRTOS.%3C%2FP%3E%3CP%3EThe%20i.mx95%20A7%20core%2C%20however%2C%20has%20already%20been%20added%20lately%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Fpull%2F86923%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Fpull%2F86923%3C%2FA%3E%3C%2FP%3E%3CP%3ESo%20my%20question%20is%20if%20NXP%20is%20planing%20to%20add%20also%20support%20for%20the%20m33.%20And%20if%20not%20what%20would%20be%20needed%20to%20add%20support%20manually%3F%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2167583%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20OpenAMP%20support%20for%20m33%20core%20on%20i.mx93%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2167583%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ETo%20enable%20inter-core%20communication%20between%20Linux%20(running%20on%20the%20A-core)%20and%20Zephyr%20(running%20on%20the%20M33%20core)%2C%20the%20recommended%20starting%20point%20is%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Ftree%2Fmain%2Fsamples%2Fsubsys%2Fipc%2Fopenamp_rsc_table%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Eopenamp_rsc_table%3C%2FA%3E%20sample%20from%20Zephyr.%20%3CBR%20%2F%3EThis%20sample%20leverages%3A%3CBR%20%2F%3E-%20OpenAMP%20on%20Zephyr%3CBR%20%2F%3E-%20remoteproc%20and%20rpmsg%20on%20Linux%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EPrerequisites%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CU%3ELinux%20setup%3C%2FU%3E%3C%2FEM%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ELinux%20BSP%3A%20use%20NXP's%20official%20BSP%26nbsp%3B%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-imx%2Flinux-imx%2Ftree%2Flf-6.12.y%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-imx%2Flinux-imx%2Ftree%2Flf-6.12.y%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EDevice%20tree%3A%20use%20the%20%60-rpmsg%60%20variant%2C%20e.g.%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fgithub.com%2Fnxp-imx%2Flinux-imx%2Fblob%2Flf-6.12.y%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx93-11x11-evk-rpmsg.dts%22%20target%3D%22_blank%22%3Eimx93-11x11-evk-rpmsg.dts%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EU-Boot%3A%20run%20%60prepare_mcore%60%20before%20booting%20Linux%26nbsp%3B%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CEM%3E%3CU%3EZephyr%20setup%3C%2FU%3E%3C%2FEM%3E%3CU%3E%20(M33%20core)%3C%2FU%3E%3C%2FP%3E%0A%3CP%3ETo%20run%20the%20openamp_rsc_table%20sample%20successfully%2C%20shared%20memory%20between%20the%20host%20and%20remote%20cores%20must%20be%20defined%20using%20the%20%60zephyr%2Cipc_shm%60%20property%20in%20a%20DTS%20overlay.%3C%2FP%3E%0A%3CP%3ENext%2C%20add%20the%20MU%20node%20in%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Fblob%2Fmain%2Fdts%2Farm%2Fnxp%2Fnxp_imx93_m33.dtsi%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Enxp_imx93_m33.dtsi%3C%2FA%3E%3A%3C%2FP%3E%0A%3CP%3E%60%60%60%3CBR%20%2F%3Emu1%3A%20mu1%4044220000%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20compatible%20%3D%20%22nxp%2Cimx-mu%22%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20reg%20%3D%20%26lt%3B0x44220000%20DT_SIZE_K(64)%26gt%3B%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20interrupts%20%3D%20%26lt%3B21%200%26gt%3B%3B%3C%2FP%3E%0A%3CP%3E%7D%3B%3C%2FP%3E%0A%3CP%3E%60%60%60%3C%2FP%3E%0A%3CP%3EThen%2C%20linker%20script%20update%20-%20add%20the%20resource%20table%20section%20in%20%60linker.ld%60%3A%3C%2FP%3E%0A%3CP%3E%60%60%60%3C%2FP%3E%0A%3CP%3E%23if%20defined(CONFIG_OPENAMP_RSC_TABLE)%3C%2FP%3E%0A%3CP%3ESECTIONS%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SECTION_PROLOGUE(.resource_table%2C%2C%20SUBALIGN(8))%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20KEEP(*(.resource_table*))%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%20GROUP_LINK_IN(ROMABLE_REGION)%3C%2FP%3E%0A%3CP%3E%7D%3C%2FP%3E%0A%3CP%3E%23endif%3C%2FP%3E%0A%3CP%3E%60%60%60%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EConfiguration%20adjustments%20for%20i.MX93%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThe%20RX%20and%20TX%20IDs%20on%20i.MX93%20differ%20from%20other%20boards.%20You%20must%20override%20the%20default%20values%20in%20the%20%60.conf%60%20overlay%20file%3A%3C%2FP%3E%0A%3CP%3E%60%60%60%3C%2FP%3E%0A%3CP%3ECONFIG_IPM_IMX_MAX_DATA_SIZE_16%3Dn%3C%2FP%3E%0A%3CP%3ECONFIG_IPM_IMX_MAX_DATA_SIZE_4%3Dy%3C%2FP%3E%0A%3CP%3ECONFIG_OPENAMP_WITH_DCACHE%3Dy%3C%2FP%3E%0A%3CP%3ECONFIG_LOG%3Dy%3C%2FP%3E%0A%3CP%3ECONFIG_OPENAMP_RSC_TABLE_IPM_RX_ID%3D1%3C%2FP%3E%0A%3CP%3ECONFIG_OPENAMP_RSC_TABLE_IPM_TX_ID%3D0%3C%2FP%3E%0A%3CP%3E%60%60%60%3C%2FP%3E%0A%3CP%3E%3CEM%3ESample%20PRs%3C%2FEM%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Ftree%2Fmain%2Fsamples%2Fsubsys%2Fipc%2Fopenamp_rsc_table%2Fboards%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Ftree%2Fmain%2Fsamples%2Fsubsys%2Fipc%2Fopenamp_rsc_table%2Fboards%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Fpull%2F86923%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Fpull%2F86923%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Fpull%2F79220%2Fcommits%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Fpull%2F79220%2Fcommits%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CEM%3ELinux%20patch%20requirement%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EFor%20proper%20operation%20on%20i.MX93%2C%20apply%20the%20following%20Linux%20patch%3A%20%3CA%20href%3D%22https%3A%2F%2Flore.kernel.org%2Fimx%2FCAEnQRZDoYvK-YXLjqbXsRAWDkHrWNOoR1OCCWxs%2BAfNUDuPB_w%40mail.gmail.com%2FT%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Flore.kernel.org%2Fimx%2FCAEnQRZDoYvK-YXLjqbXsRAWDkHrWNOoR1OCCWxs%2BAfNUDuPB_w%40mail.gmail.com%2FT%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EFinal%20steps%20before%20execution%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EBefore%20launching%20the%20application%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ERun%20%60prepare_mcore%60%20in%20U-Boot.%3C%2FLI%3E%0A%3CLI%3EUse%20the%20%60-rpmsg%60%20device%20tree%20blob.%3C%2FLI%3E%0A%3CLI%3EFollow%20the%20steps%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN5317.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EApplication%20Note%20AN5317%3C%2FA%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSTRONG%3EAdditional%20Resources%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Ei.MX%20Linux%20User%20Guide%20-%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fuser-guide%2FUG10163.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fuser-guide%2FUG10163.pdf%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EApplication%20Note%20AN5317%20-%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN5317.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN5317.pdf%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EDetails%20on%20the%20remoteproc%2C%20rpmsg%2C%20mailbox%2C%20and%20OpenAMP%20frameworks.%20It%20includes%20examples%20on%20how%20to%20create%20the%20DTS%20and%20configuration%20overlays.%20Please%20note%20that%20this%20is%20specifically%20an%20example%20for%20the%20HiFi4%20core%20from%20the%20i.MX%208M%20Plus%20%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJqwPljnm2_k%26amp%3Bt%3D14s%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJqwPljnm2_k%26amp%3Bt%3D14s%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EDTS%20API%2C%20on%20%60zephyr%2Cipc_shm%60%20-%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Fblob%2Fmain%2Fdoc%2Fbuild%2Fdts%2Fapi%2Fapi.rst%3Fplain%3D1%23L421%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Fblob%2Fmain%2Fdoc%2Fbuild%2Fdts%2Fapi%2Fapi.rst%3Fplain%3D1%23L421%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2119047%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20OpenAMP%20support%20for%20m33%20core%20on%20i.mx93%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2119047%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAll%20zephyr%20IPC%20support%20here(%20Linux%20kernel%20OS%20on%20the%20main%20processor%20and%20a%20Zephyr%20application%20on%20the%20co-processor)%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Ftree%2Fmain%2Fsamples%2Fsubsys%2Fipc%2Fopenamp_rsc_table%2Fboards%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Ftree%2Fmain%2Fsamples%2Fsubsys%2Fipc%2Fopenamp_rsc_table%2Fboards%3C%2FA%3E%3CBR%20%2F%3EConfirm%20from%20the%20internal%20team%2C%20this%20is%20no%20plan%20of%20supporting%20MPU%20cm33%20now.%3CBR%20%2F%3EBut%20I%20have%20send%20your%20requirement%20to%20the%20internal%20team%2C%20if%20there%20is%20any%20update%20will%20let%20you%20know.%3CBR%20%2F%3EI%20am%20sorry%20for%20that.%3C%2FP%3E%3C%2FLINGO-BODY%3E