What to add to the DTS file to get remoteproc working for the M4 core on TI AM62x

Hi Toradex,

We are migrating from an NXP IMX8M platform to TI-AM62x. I have searched for examples how to get remoteproc for M4 working on TI-AM62x but found nothing except Cortex-M on TI AM62 | Toradex Developer Center . This page only refers to TI documentation which seems outdated.
I am searching for DTS additions and would also like to know if I could use ti_k3_m4_remoteproc.c « remoteproc « drivers - kernel/git/stable/linux.git - Linux kernel stable tree or need the downstream tree from Toradex. If so, what’s still missing in mainline?

regards,

Jaap Crezee

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


To enable remoteproc functionality for the M4 core on the TI AM62x platform, you need to make specific additions to the Device Tree Source (DTS) file. Here are the steps you should follow:

  1. Define the Remote Processor Node: Add a node in the DTS file for the M4 core as a remote processor. This should include:

    • A compatible string for the M4 core.
    • Memory regions that the M4 core will use.
    • Interrupt lines associated with the M4 core.
    • A link between the remoteproc driver and the M4 core.
  2. Memory Regions and Interrupts: Ensure that the memory regions and interrupts are correctly defined. This involves specifying the memory addresses and configurations necessary for the M4 core to communicate with the main processor.

  3. Firmware Loading: Specify the firmware image that the M4 core will execute. This is crucial for the remoteproc framework to load and manage the firmware properly.

  4. Refer to TI Documentation: Consult the TI AM62x documentation for the correct DTS structure and parameters needed for the M4 core to ensure all necessary configurations are included.

Regarding the use of ti_k3_m4_remoteproc.c from the mainline Linux kernel, you need to verify its compatibility with the TI AM62x platform. If the mainline kernel lacks the required features for the M4 core, you may need to refer to the downstream tree from Toradex for additional patches or configurations not present in the mainline kernel.

There may be additional features or patches required in the mainline kernel to fully support remoteproc for the M4 core on the TI AM62x platform. It is advisable to check the latest updates from Toradex or the community for any specific patches or configurations necessary for the M4 core to operate correctly.

Please, also check if these links can help you solve your problem:

Boot MCU from U-Boot on AM62X.

Hi @jaapcrezee!

Welcome to our community!

Just to understand your environment better, I’m assuming that you are using our SoM Verdin AM62, could you please specify which board and OS you are using?

About the remoteproc, what are you expecting to achieve using it?

In our modules, we have a device tree overlay that enables HMP (Heterogeneous Multicore Processing). For Verdin AM62 it is called verdin-am62_hmp_overlays.dtbo, and you can learn how to enable it by following this article for Torizon OS and this article for BST. Besides, I would recommend following TI’s academy in order to learn how the Cortex M works and how to use it in your project.

Feel free to reach out if you have any issues or doubts.

Best regards.
Lucas Azeituno.

Hi @jaapcrezee !

Do you have any feedback on this thread? Did you manage to solve it already? If yes, it would be great if you could share with us how :slight_smile:

Best regards,

Sorry forgot to reply. Here you go:

I added this to my DTS file:


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

        m4_rts_ddr: ipc-memories@9c800000 {
                compatible = "shared-dma-pool";
                reg = <0x00 0x9c800000 0x00 0x00300000>;        /* 3 megabyte */
                no-map;
        };

        mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 {
            compatible = "shared-dma-pool";
            reg = <0x00 0x9cb00000 0x00 0x100000>;
            no-map;
        };

        mcu_m4fss_memory_region: m4f-memory@9cc00000 {
            compatible = "shared-dma-pool";
            reg = <0x00 0x9cc00000 0x00 0xe00000>;
            no-map;
        };

    };

    remoteproc@5000000 {
        compatible = "ti,am64-m4fss";
        reg = <0x00 0x5000000 0x00 0x30000>,
              <0x00 0x5040000 0x00 0x10000>;
        reg-names = "iram", "dram";
        resets = <&k3_reset 9 1>;
        firmware-name = "";
        mboxes = <&mailbox0_cluster0>, <&mbox_m4_0>;
        memory-region = <&mcu_m4fss_dma_memory_region>,
                        <&mcu_m4fss_memory_region>,
                        <&m4_rts_ddr>;
        ti,sci = <&dmsc>;
        ti,sci-dev-id = <9>;
        ti,sci-proc-ids = <0x18 0xff>;
     };

};

Please mind that m4_rts_ddr is an arbitrary name for us used elsewhere in our documentation and M4 code. (LDS).

I also switch to kernel 6.12 as the k3-m4-remoteproc driver is merged from that point by TI in mainline: ti_k3_m4_remoteproc.c « remoteproc « drivers - kernel/git/stable/linux.git - Linux kernel stable tree

Hi @jaapcrezee !

Just to be sure: the device tree snippet you shared solved the topic for you right? If yes, please mark your message as the solution :slight_smile:

Best regards,