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.

J784S4XEVM: IPC RPMSG missing rpmsg-chrdev with custom memory layout

Part Number: J784S4XEVM

Tool/software:

Hi,

I am currently working with the custom memory layout in the Linux device tree : 

While using rpmsg_char_simple tool on A72 Linux and the ipc_echo_test example on C7X DSP with the attached memory layout.

We faced the following error : "_rpmsg_char_find_ctrldev: could not find the matching rpmsg_ctrl device for virtio1.rpmsg_chrdev.-1.14" for DSP3 and DSP4. 

DSP1 and DSP2 IPCs are working correctly.

All DSPs are attached. I see this with the command : "cat /sys/class/remoteproc/remoteproc*/state"

Is there a problem with my custom memory layout ?

Regards,

Bruce

  • Hello Bruce,

    Have you changed the memory layout in A72 as well as PDK to build ipc_echo_test ? May i know step by step how you performed memory layout change ?

    and also have you ensured the DSP3 and DSP4 custom address layout is not being used else where ? I suspect its being used else where

    Regards

    Tarun Mukesh

  • Hello Tarun,

    Indeed, before building through your makefile, we swapped the files "memory_map_defines.inc", "linker_c7x_c7x_n_freertos.lds", "linker_c7x_freertos_common.inc" and "memory_map_ddr.cmd" according to our memory layout settings. In those files, we ensured that none of the adresses and size had overlap.

    In addition, I used “dmesg | grep Reserved” to obtain the system's reserved memory. I saw that the memory is reserved and cannot be used by Linux. No R5 firmware is running. Is there any other way of checking whether the custom address configuration is being used elsewhere?

    Regards,

    Bruce

  • Hello,

    Can you share the memory you reserved in dts file ?

    Regards

    Tarun Mukesh

  • Hello,

    Thanks for sharing. I had look into you dts file and it looks fine to me. 

    In  path /packages/ti/drv/ipc/examples/common/src/c7x_mmu.c we have C7x_1_IPC_DATA_BASE,C7x_2_IPC_DATA_BASE,C7x_3_IPC_DATA_BASE,C7x_4_IPC_DATA_BASE , can you ensure these are pointing to your updated custom layout.

    Also Under attrs.attrIndx = Mmu_AttrIndx_MAIR7; we have currently address only upto 0xC0000000 .Have you modified this one ? Please share me 

    /packages/ti/drv/ipc/examples/common/src/c7x_mmu.c  file as well.

    Regards

    Tarun Mukesh

  • Hello,

    C7x_1_IPC_DATA_BASE => 0xAF000000

    C7x_2_IPC_DATA_BASE => 0xB7100000

    C7x_3_IPC_DATA_BASE => 0xBF200000

    C7x_4_IPC_DATA_BASE => 0xC7300000

    These definitions are located in the modified memory_map_defines.inc file.

    I share with you my modified c7x_mmu.c :

    /*
     *  Copyright (c) Texas Instruments Incorporated 2021
     *  All rights reserved.
     *
     *  Redistribution and use in source and binary forms, with or without
     *  modification, are permitted provided that the following conditions
     *  are met:
     *
     *    Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     *    Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the
     *    distribution.
     *
     *    Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /**
     *  \file c7x_mmu.c
     *
     *  \brief C7x MMU Config File
     */
    
    #ifdef BUILD_C7X
    
    /* ========================================================================== */
    /*                             Include Files                                  */
    /* ========================================================================== */
    
    
    #if (defined (FREERTOS))
    #include "Mmu.h"
    #elif (defined (SAFERTOS))
    #include "Mmu.h"
    #endif
    #include "memory_map_defines.inc"
    
    /* ========================================================================== */
    /*                           Macros & Typedefs                                */
    /* ========================================================================== */
    
    #if defined(SOC_J721S2)
        #define MSMC_SIZE   0x00400000U /* 4MB */
    #elif defined(SOC_J721E) || (SOC_J784S4)
        #define MSMC_SIZE   0x00800000U /* 8MB */
    #endif
    
    /* ========================================================================== */
    /*                          Function Declarations                             */
    /* ========================================================================== */
    
    /* None */
    
    /* ========================================================================== */
    /*                            Global Variables                                */
    /* ========================================================================== */
    
    /* None */
    
    /* ========================================================================== */
    /*                          Function Definitions                              */
    /* ========================================================================== */
    
    void IpcInitMmu(bool isSecure)
    {
        Mmu_MapAttrs    attrs;
    
        Mmu_initMapAttrs(&attrs);
    
        if(true == isSecure)
        {
            attrs.ns = 0;
        }
        else
        {
            attrs.ns = 1;
        }
    
        /* Register region */
        attrs.attrIndx = Mmu_AttrIndx_MAIR0;
        (void)Mmu_map(0x00000000U, 0x00000000U, 0x20000000U, &attrs, isSecure);
        (void)Mmu_map(0x20000000U, 0x20000000U, 0x20000000U, &attrs, isSecure);
        (void)Mmu_map(0x40000000U, 0x40000000U, 0x20000000U, &attrs, isSecure);
        (void)Mmu_map(0x60000000U, 0x60000000U, 0x10000000U, &attrs, isSecure);
        (void)Mmu_map(0x78000000U, 0x78000000U, 0x08000000U, &attrs, isSecure); /* CLEC */
    
        attrs.attrIndx = Mmu_AttrIndx_MAIR7;
        (void)Mmu_map(0x80000000U, 0x80000000U, 0x20000000U, &attrs, isSecure); /* DDR */
        (void)Mmu_map(0xA0000000U, 0xA0000000U, 0x60000000U, &attrs, isSecure); /* DDR */
    
        (void)Mmu_map(0x70000000U, 0x70000000U, MSMC_SIZE  , &attrs, isSecure); /* MSMC */
        (void)Mmu_map(0x41C00000U, 0x41C00000U, 0x00100000U, &attrs, isSecure); /* OCMC - 1MB */
    
        /* IPC VRing Buffer - uncached */
        attrs.attrIndx =  Mmu_AttrIndx_MAIR4;
    #if defined(SOC_J784S4)
        (void)Mmu_map(SHARED_DDR_SPACE_START, SHARED_DDR_SPACE_START, 0x04000000U, &attrs, isSecure); /* VRING DDR */
    #else
        (void)Mmu_map(SHARED_DDR_SPACE_START, SHARED_DDR_SPACE_START, 0x02000000U, &attrs, isSecure); /* VRING DDR */
    #endif
    #if defined(BUILD_C7X_1)
        (void)Mmu_map(C7x_1_IPC_DATA_BASE, C7x_1_IPC_DATA_BASE, 0x00100000U, &attrs, isSecure); /* C7X_1 DDR */
    #elif defined(BUILD_C7X_2)
        (void)Mmu_map(C7x_2_IPC_DATA_BASE, C7x_2_IPC_DATA_BASE, 0x00100000U, &attrs, isSecure); /* C7X_2 DDR */
    #elif defined(BUILD_C7X_3)
        (void)Mmu_map(C7x_3_IPC_DATA_BASE, C7x_3_IPC_DATA_BASE, 0x00100000U, &attrs, isSecure); /* C7X_3 DDR */
    #elif defined(BUILD_C7X_4)
        (void)Mmu_map(C7x_4_IPC_DATA_BASE, C7x_4_IPC_DATA_BASE, 0x00100000U, &attrs, isSecure); /* C7X_4 DDR */
    #endif
    
        return;
    }
    
    #endif /* #ifdef BUILD_C7X */
    

    Regards

    Bruce Rosier