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.

PROCESSOR-SDK-AM64X: Possible Resource Sharing problem between R5 and Linux. Behaviour is different if OSPI LINUX SBL loads Linux from SD Card.

Part Number: PROCESSOR-SDK-AM64X
Other Parts Discussed in Thread: SYSCONFIG

Hello,

FilesForTiSupport.zip

I am trying to boot application which uses ICSSG on R5FSS_0_0(where SBL bootloader runs) and Linux from A53 core. OSPI Linux SBL, R5 Application, linuxappImage are loaded from flash. Linux Rootfs with kernel and dtb are in eMMC.

The problem is, R5 application is not booting when Linux boots first and linuxappImage loaded from OSPI Flash. The same application boots fine when OSPI Linux SBL loads U-Boot, kernel from SD Card.

code from OSPI Linux SBL:

"/* Change the dev stat register to SD card bootmode so that SPL loads uBoot and linux kernel from SD card */
SOC_setDevStat(SOC_BOOTMODE_MMCSD)"

To make it work, I modified the rm config to remove the overlap by assigning resourses for ICSSG to R5 and CPSW to A53 in MCU+SDK and build new boardcfg_blob. Here when I used boardcfg_blob.bin instead of boardcfg_blob_linux.bin, Linux is not booting even with kernel in SD Card.

I have changed the rm_cfg to be same as rm_linux_cfg, even in this case the Linux is not booting when SBL uses boardcfg_blob.bin.

I have attached the syscfg, rm_cfg, dts files for your reference.

Kindly check these files and guide me in resolving the issue.

Best Regards,
Upendar

  • Hello Upendar,

    I do not fully understand what you are describing.

    "The problem is, R5 application is not booting when Linux boots first and linuxappImage loaded from OSPI Flash. The same application boots fine when OSPI Linux SBL loads U-Boot, kernel from SD Card."

    1) How is the R5F application getting initialized? directly from the SBL? Or is it getting initialized later in the boot process by the Linux remoteproc driver?

    2) Is the R5F application getting initialized differently in the two boot flows that you described? If it is initialized differently, please describe how it is initialized in each boot flow.

    3) Are you seeing any error output or debug output on bootup that might have helpful information? If so, please attach that as well.

    4) What version of software are you running at this point in time?

    5) Just to double-check, are you on the same project as the e2e thread you linked? Or is that just a thread you found on the forums that is about the same subject?

    Regards,

    Nick

  • Hello Nick,

    Please find my responses below.

    1) How is the R5F application getting initialized? directly from the SBL? Or is it getting initialized later in the boot process by the Linux remoteproc driver?

    From OSPI LINUX SBL. SBL --> Loads linuxAppImage on to A53 and run it. --> Then loads self CPU(R5FSS0_0) with R5 application and resets itself.

    2) Is the R5F application getting initialized differently in the two boot flows that you described? If it is initialized differently, please describe how it is initialized in each boot flow.

    No. R5 application initialization same. Difference is, whether the U-Boot in SD Card or OSPI Flash.

    3) Are you seeing any error output or debug output on bootup that might have helpful information? If so, please attach that as well.

    No error info. When U-Boot starts first, R5 Application is not started. UART output stops after 

    "Image loading done, switching to application ...
    Starting linux and RTOS/Baremetal applications"

    4) What version of software are you running at this point in time?

    SBL from MCU+SDK 9.1. R5 Application from 8.6. Linux Yocto is based on 9.2.

    5) Just to double-check, are you on the same project as the e2e thread you linked? Or is that just a thread you found on the forums that is about the same subject?

    No. Not the same project. Its the similar topic. I followed the thread and made the modifications but did not solve my problem. We are also evaluating AM64 for commericial project.

    Please let me know if you need more information. As i said, the key difference is, from where the U-Boot is loaded. SD Card or OSPI Flash. Please check for any resource overlap. 

    Thank you for the support.

    Best Regards,
    Upendar

  • Hello Upendar,

    1) Is Linux properly initializing in both usecases? Or does U-Boot and Linux also fail to initialize and load in the usecase where the R5F0_0 application does not load?

    2) Did you confirm that the files you intend to use for booting are actually getting flashed into the OSPI memory?
    https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/09_01_00_41/exports/docs/api_guide_am64x/TOOLS_FLASH.html#BASIC_STEPS_TO_FLASH_FILES

    I am sending your thread over to a team member more familiar with SBL to comment further.

    Regards,

    Nick

  • Hello Nick,

    Linux boots fine in both the cases. Only R5 application is not booting when U-Boot starts first. 

    I think I have identified the issue. R5 Application is starting but going into Debug Assert loop because of failure in disabling the clock for OSPI Flash.

    /* Disable the clock before changing the frequency */
    status = Sciclient_pmModuleClkRequest(moduleId,
    clkId,
    TISCI_MSG_VALUE_CLOCK_SW_STATE_UNREQ,
    0U,
    SystemP_WAIT_FOREVER);

    This code returns SystemP_Failure.

    I have disabled OSPI Flash in linux. But number of parents for clock is return as 2 for OSPI Flash. The function where this happens: SOC_moduleSetClockFrequency

    Thank you.

    Best Regards,
    Upendar

  • Hi Upendar,

    I see OSPI is enabled in the shared R5F application's Sysconfig. This is problematic as the U-Boot will take exclusive ownership (TI_SCI_PD_EXCLUSIVE) of the OSPI as shown below when booting from the OSPI so when the R5F application tries to set the frequency the System Firmware NACKs it leading to the failure.

    ~/ti/psdk/am64x/09.01.00.08/board-support/ti-u-boot-2023.04+gitAUTOINC+b0d717b732-gb0d717b732
    ❯ grep -n -A15 "ospi0: spi@fc40000" -- arch/arm/dts/k3-am64-main.dtsi
    654:            ospi0: spi@fc40000 {
    655-                    compatible = "ti,am654-ospi", "cdns,qspi-nor";
    656-                    reg = <0x00 0x0fc40000 0x00 0x100>,
    657-                          <0x05 0x00000000 0x01 0x00000000>;
    658-                    interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>;
    659-                    cdns,fifo-depth = <256>;
    660-                    cdns,fifo-width = <4>;
    661-                    cdns,trigger-address = <0x0>;
    662-                    #address-cells = <0x1>;
    663-                    #size-cells = <0x0>;
    664-                    clocks = <&k3_clks 75 6>;
    665-                    assigned-clocks = <&k3_clks 75 6>;
    666-                    assigned-clock-parents = <&k3_clks 75 7>;
    667-                    assigned-clock-rates = <166666666>;
    668-                    power-domains = <&k3_pds 75 TI_SCI_PD_EXCLUSIVE>;
    669-            };
    
    

    I believe if you remove the OSPI from R5F application, it should be up and running in both the cases of U-Boot booting either from OSPI or SD card.

    Regards,

    Prashant

  • Hi Prashant,

    Thank you for the suggestion. Yes. It seems to be the problem. Now I am loading U boot from eMMC. It works now.

    I have another problem related to boot time. DDR_Init taking upwards of 300ms to in SBL_OSPI_Linux where as entire System_Init in SBL_OSPI taking less than 100ms.

    This situation is not ideal for us.

    Is there anything I can do to speed it up in case of SBL OSPI Linux? 

    Regards,

    Upendar

  • Hi Upendar,

    Can you please create a new thread for the other issue with all the necessary information like logs and all. This will help keep different context in different threads.

    Thanks!