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: AM64X OSPI-NOR Flash and Kernel Booting Issues

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

Tool/software:

AM64X OSPI-NOR Flash and Kernel Booting Issues

I am currently working with two boards, a tmds64evm (proc101c) and a sk-am64 (proc10e3). I have successfully flashed tiboot3.bin, tispl.bin, and u-boot.img using UART, TFTP, and DFU, and confirmed that the boards can boot in OSPI mode.

My ultimate goal is to boot the kernel image file from the OSPI-NOR flash.

Problem 1: OSPI MTD Re-partitioning and saveenv Issue

I am trying to follow the steps in this link: https://dev.ti.com/tirex/explore/node?node=A__ARACMGmwZUkJurQKuv0ezw__AM64-ACADEMY__WI1KRXP__LATEST

In the OSPI MTD re-partitions section, re-partitioning does not work. My result screen is as follows:

=> setenv mtdparts mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern)

=> mtd list

Could not find a valid device for fc40000.spi.0

List of MTD devices:

* nor0

  - device: flash@0

  - parent: spi@fc40000

  - driver: jedec_spi_nor

  - path: /bus@f4000/bus@fc00000/spi@fc40000/flash@0

  - type: NOR flash

  - block size: 0x40000 bytes

  - min I/O: 0x10 bytes

  - 0x000000000000-0x000004000000 : "nor0"

          - 0x000000000000-0x000000100000 : "ospi.tiboot3"

          - 0x000000100000-0x000000300000 : "ospi.tispl"

          - 0x000000300000-0x000000700000 : "ospi.u-boot"

          - 0x000000700000-0x000000740000 : "ospi.env"

          - 0x000000740000-0x000000780000 : "ospi.env.backup"

          - 0x000000800000-0x000003fc0000 : "ospi.rootfs"

          - 0x000003fc0000-0x000004000000 : "ospi.phypattern"

When I use the command script as follows:

setenv mtdparts mtdparts=nor0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern)

Re-partitioning works, and my result screen is as follows:

=> setenv mtdparts mtdparts=nor0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern)

=> mtd list

SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB

List of MTD devices:

* nor0

  - device: flash@0

  - parent: spi@fc40000

  - driver: jedec_spi_nor

  - path: /bus@f4000/bus@fc00000/spi@fc40000/flash@0

  - type: NOR flash

  - block size: 0x40000 bytes

  - min I/O: 0x10 bytes

  - 0x000000000000-0x000004000000 : "nor0"

          - 0x000000000000-0x000000080000 : "ospi.tiboot3"

          - 0x000000080000-0x000000280000 : "ospi.tispl"

          - 0x000000280000-0x000000680000 : "ospi.u-boot"

          - 0x000000680000-0x0000006c0000 : "ospi.env"

          - 0x0000006c0000-0x000000700000 : "ospi.env.backup"

          - 0x000000700000-0x000000800000 : "ospi.dtb"

          - 0x000000800000-0x000001c00000 : "ospi.kernel"

          - 0x000001c00000-0x000003fc0000 : "ospi.rootfs"

          - 0x000003fc0000-0x000004000000 : "ospi.phypattern"

However, saveenv does not work. The following screen is displayed:

=> saveenv

Unknown command 'saveenv' - try 'help'

And after rebooting, the partition contents revert to the initial state.

My questions are:

  • Is it possible to boot the kernel by placing the Image and .dtb files inside the rootfs partition without re-partitioning?
  • Is re-partitioning absolutely necessary to boot the kernel via OSPI-NOR?

Problem 2: Yocto Build Failures

I believe the required rootfs is the tisdk-tiny-initramfs image, and I am trying to build it using the command MACHINE=am64xx-evm bitbake -k tisdk-tiny-image.

Despite having a powerful PC with sufficient specifications, the build does not succeed. I have also selected "no" for the Dash-related message. The build takes several hours and ultimately fails with numerous errors.

Could you please provide a solution for this issue?

Problem 3: General Guidance

I am new to Linux, so this process has been very difficult and challenging. My final goal is to boot the kernel from the flash without an SD card, just as it would boot from an SD card.

  • Based on the issues I have described, have I misunderstood anything or taken a wrong approach?
  • If so, could you please tell me about any alternative methods?

I would be very grateful for any help.

  • I'm currently out-of-office, and will get back to you this Friday or early next week.
    Best,
    -Hong

  • 1/. Here is an early e2e with more details on booting linux from OSPI-NOR.
    RE: AM6442: How to create ospi.rootfs(UBIFS) and boot Linux from OSPI without SD 
    With Linux SDK 7.x, ubi/ubifs was not fully enabled yet @u-boot level. That was one of reasons I repartitioned OSPI MTD partitions such that u-boot loads kernel/dtb via "sf..." cmd instead of using "ubi..." cmd to load them from "ospi.rootfs" under UBI (not available in Linux SDK 7.x).

    "ubi..." cmd is enabled now in the latest SDK 11.x. With this being said, either option would work
    1/. reserve the dedicated mtd partition for kernel/dtb, and load kernel/dtb via "sf..." cmd @u-boot
    2/. load kernel/dtb from the mtd partition for rootfs/ubifs via "ubi.../ubifsmount.../ubifsload..." cmds @u-boot.

    "saveenv..." cmd had been removed in the newer SDK due to it has dependency on the flash media which sometime cause invisible issue.
    The recommended option is setting the boot configuration directly in environment variable in u-boot source code.

    2/. I'd recommend submit a new e2e ticket separately on the Yocto build question.
    3/. There're comprehensive online resources on Linux topics, for example, good reference on MTD/UBI/UBIFS...
    http://www.linux-mtd.infradead.org/doc/ubi.html
    http://www.linux-mtd.infradead.org/doc/ubifs.html

    Best,
    -Hong