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.

TDA4VM: Boot from OSPI using SBL boot mode, the kernel fails to load the OSPI driver

Part Number: TDA4VM

Hi,

    I want to boot from ospi using sbl mode, but the kernel fails to load the OSPI driver. It dose not recognize the ospi partitions and cannot enter ubifs.

    This SDK version is 08_02_00_04.(BOARD=j721e_evm)

     Here are my steps:

        1.ospi partitions:

        mtdparts=47040000.spi.0:512k(ospi.tiboot3),512k(ospi.tifs),24M(ospi.app),20M(ospi.reserve),19328k@45m(ospi.rootfs),128k(ospi.phypattern)

        2.use dfu to burn images to the corresponding partitions of ospi respectively

        (The app is generated by combined_appimage/makefile, including ipc_echo_testb_freertos_mcu1_0_release_strip.xer5f, bl32.bin, Image, k3-j721e-common-proc-board.dtb, bl31.bin )

        (bootargs in devicetree is bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=47040000.spi.0:512k(ospi.tiboot3),512k(ospi.tifs),24M(ospi.app),20M(ospi.reserve),19328k@45m(ospi.rootfs),128k(ospi.phypattern) root=ubi0:rootfs rw ubi.mtd=ospi.rootfs rootfstype=ubifs rootwait=1)

        3.set the boot pin to boot from ospi

        4.kernel print 

        

      

  • Hi,

    Could you please share the boot sequence? Is it SBL --> ATF --> Linux. Please share that.
    Its possible that SBL leaves OSPI in a state that Kernel is not able to comprehend.

    Please share the complete boot logs in a text file.

    Also can you try to boot using SPL/U-boot?

    - Keerthy

  • Hi,

    1.the boot sequence is SBL --> ATF --> Linux.

    2.'ospi_sbl_log-MCU_Serial2.txt' and 'ospi_kernel_log-Main_Serial1.txt' are the boot logs.

    3.to optimize boot time, I'm not going to use SPL/U-boot.

    4.there is  a similar case - https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1048083/tda4vm-tda4-cannot-partition-ospi-flash-when-booting-through-ospi-flash

    ospi_sbl_log-MCU_Serial2.txt
    Fullscreen
    1
    2
    SBL Revision: 01.00.10.01 (Jul 6 2022 - 09:32:24)
    TIFS ver: 22.1.1--v2022.01 (Terrific Llam
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    ospi_kernel_log-Main_Serial1.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    NOTICE: BL31: v2.5(release):08.01.00.006-dirty
    NOTICE: BL31: Built : 21:03:57, Mar 23 2022
    ERROR: GTC_CNTFID0 is 0! Assuming 200000000 Hz. Fix Bootloader
    [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd080]
    [ 0.000000] Linux version 5.10.100-g261e0a90da96-dirty (chens@ubuntu) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025, GNU ld (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 2.33.1.20191209) #22 SMP PREEMPT Fri Jul 15 13:42:56 CST 2022
    [ 0.000000] Machine model: Texas Instruments K3 J721E SoC
    [ 0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [ 0.000000] printk: bootconsole [ns16550a0] enabled
    [ 0.000000] efi: UEFI not found.
    [ 0.000000] [Firmware Bug]: Kernel image misaligned at boot, please fix your bootloader!
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 1 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@a0000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, size 15 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-memory@a0100000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 1 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@a1000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a1100000, size 15 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-memory@a1100000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a2000000, size 1 MiB
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi,

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1048083/tda4vm-tda4-cannot-partition-ospi-flash-when-booting-through-ospi-flash/3878732#3878732

    SBL seems to initialize SPI in a mode different from 1S mode expected by Linux kernel. Can you soft reset the flash in SBL?

    Do you see this behavior with other boot modes like MMC or eMMC?

    - Keerthy

  • Hi,

       Is there any examples to achieve that the ospi configuration in sbl is consistent with the ospi configuration in the Linux kernel,like both 1S mode?

        I tried adding a soft reset after SBL exits OSPI, the Linux kernel can successfully initialize OSPI, but the app running on mcu1_0 cannot open OSPI.

        After the SBL is started, the app of mcu1_0 needs to read the data of ospi, and the linux kernel can also initialize and access ospi. The ospi configuration should be the same in all three cases.

  • After the SBL is started, the app of mcu1_0 needs to read the data of ospi, and the linux kernel can also initialize and access ospi. The ospi configuration should be the same in all three cases

    Sharing of OSPI between MCU & Linux will be an issue. Can you try rmmod of OSPI from kernel & then use it from MCU1_0?

    You will need to build OSPI as a module in Linux. By default it is built in kernel. I have not tried that. Just a work around.

    - Keerthy

  • Thank you for your reply.

    Sharing of OSPI between MCU & Linux will be an issue. Can you try rmmod of OSPI from kernel & then use it from MCU1_0?

    We want to implement monitoring A72 using mcu1_0. After the Linux system crashes, the mcu1_0 is responsible for resetting and rebootting the A72 (already done).Therefore, exiting Linux abnormally does not guarantee that the ospi driver will be successfully uninstalled every time.

    Is there any examples to achieve that the ospi configuration in sbl is consistent with the ospi configuration in the Linux kernel,like both 1S mode?

    ospi should be initialized with the same configuration in mcu1_0 and Linux so that mcu1_0 can use ospi normally after Linux exits abnormally. mcu1_0 reads image data from ospi to start A72.

  • Ospi can be owned only by one core. Dynamically sharing OSPI by more than one core is not supported in the SDK 

    Closing this thread.

    Best Regards,

    Keerthy