SDAA437 July   2026 TDA4VE-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. Introduction
    1. 1.1 Motivation
    2. 1.2 Scope
    3. 1.3 Target Boot Architecture
  5. Background
    1. 2.1 J721S2 Boot Flow
    2. 2.2 OSPI NOR Flash Overview
    3. 2.3 UBI and UBIFS Overview
  6. OSPI Flash Layout
    1. 3.1 Partition Layout
    2. 3.2 Bootloader Partitions
    3. 3.3 Root Filesystem Partition
  7. Flashing Boot Components
    1. 4.1 Boot Components Overview
    2. 4.2 Identifying OSPI MTD Partitions
    3. 4.3 Flashing Boot Components into OSPI NOR Flash
    4. 4.4 Verifying Boot Components
  8. Creating a UBIFS Root Filesystem
    1. 5.1 Preparing the RootFS Partition
    2. 5.2 Creating a UBI Device
    3. 5.3 Creating a UBIFS Volume
    4. 5.4 Verifying UBIFS Operation
  9. Storing Linux Boot Artifacts in UBIFS
    1. 6.1 Mounting the UBIFS Root Filesystem Volume
    2. 6.2 Creating the Root Filesystem Structure with BusyBox
    3. 6.3 Verifying BusyBox Execution
    4. 6.4 Creating BusyBox Command Links
    5. 6.5 Creating the init Script
    6. 6.6 Testing the Root Filesystem Using chroot
    7. 6.7 Copying the Linux Kernel Image and DTB
  10. Configuring Linux Boot from UBIFS
    1. 7.1 Configuring Boot Arguments
    2. 7.2 Loading the Kernel and DTB from UBIFS
    3. 7.3 Testing Linux Boot
    4. 7.4 Creating a Reusable Boot Command
  11. Booting Linux Entirely from OSPI NOR Flash
    1. 8.1 Automating the Boot Sequence in U-Boot
    2. 8.2 End-to-End Boot Flow
  12. Summary
  13. 10References

Verifying UBIFS Operation

The UBIFS volume can be mounted using the Linux UBIFS driver.

Create a mount point and mount the volume.

root@j721s2-evm:~# mkdir -p /mnt/ospi_rootfs
root@j721s2-evm:~# mount -t ubifs -o compr=none ubi0:rootfs /mnt/ospi_rootfs
[  378.881540] UBIFS (ubi0:0): default file-system created
[  378.886938] UBIFS (ubi0:0): Mounting in unauthenticated mode
[  378.892793] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 1188
[  378.924191] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[  378.931604] UBIFS (ubi0:0): LEB size: 262016 bytes (255 KiB), min./max. I/O unit sizes: 16 bytes/256 bytes
[  378.941248] UBIFS (ubi0:0): FS size: 54761344 bytes (52 MiB, 209 LEBs), max 219 LEBs, journal size 2620160 bytes (2 MiB, 10 LEBs)
[  378.952889] UBIFS (ubi0:0): reserved for root: 2586513 bytes (2525 KiB)
[  378.959495] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 0D0FF060-F89F-4D12-B474-1C6AA3288A8D, small LPT model
root@j721s2-evm:~#

The mounted filesystem can be verified using standard Linux file operations.

For example,

root@j721s2-evm:~# echo hello > /mnt/ospi_rootfs/test.txt
root@j721s2-evm:~# sync
root@j721s2-evm:~# cat /mnt/ospi_rootfs/test.txt
hello
root@j721s2-evm:~#

In addition to verification on Linux, the UBIFS volume can be also verified from the U-Boot environment. This step ensures that the filesystem created in Linux can be accessed by U-Boot before storing Linux boot artifacts.

The following commands were used.

=> ubi part ospi.rootfs

=> ubifsmount ubi0:rootfs

=> ubifsls /

Example output is below.

=> ubi part ospi.rootfs
k3-navss-ringacc ringacc@2b800000: Ring Accelerator probed rings:286, gp-rings[96,20] sci-dev-id:272
k3-navss-ringacc ringacc@2b800000: dma-ring-reset-quirk: disabled
jedec_spi_nor flash@0: non-uniform erase sector maps are not supported yet.
cadence_spi spi@47040000: Pattern not found. Skipping calibration
SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
jedec_spi_nor flash@0: Software reset enable failed: -524
cadence_spi spi@47050000: Pattern not found. Skipping calibration
SF: Detected mt25qu512a with page size 256 Bytes, erase size 64 KiB, total 64 MiB
Could not find a valid device for spi-nand0
ubi0: attaching mtd7
ubi0: scanning is finished
ubi0: attached mtd7 (name "ospi.rootfs", size 55 MiB)
ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 262016 bytes
ubi0: min./max. I/O unit sizes: 16/256, sub-page size 16
ubi0: VID header offset: 64 (aligned 64), data offset: 128
ubi0: good PEBs: 223, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 7/3, WL threshold: 4096, image sequence number: 1854191452
ubi0: available PEBs: 0, total reserved PEBs: 223, PEBs reserved for bad PEB handling: 0
=> ubifsmount ubi0:rootfs
UBIFS (ubi0:0): recovery needed
UBIFS (ubi0:0): recovery deferred
UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O mode
UBIFS (ubi0:0): LEB size: 262016 bytes (255 KiB), min./max. I/O unit sizes: 16 bytes/256 bytes
UBIFS (ubi0:0): FS size: 54761344 bytes (52 MiB, 209 LEBs), journal size 2620160 bytes (2 MiB, 10 LEBs)
UBIFS (ubi0:0): reserved for root: 2586513 bytes (2525 KiB)
UBIFS (ubi0:0): media format: w5/r0 (latest is w4/r0), UUID 0D0FF060-F89F-4D12-B474-1C6AA3288A8D, small LPT model
=> ubifsls /
                6  Fri May 30 02:46:03 2025  test.txt
=>

The successful execution of these commands confirms that the UBI metadata and UBIFS volume created in Linux are recognized correctly by U-Boot and can be accessed before Linux boot files are stored.

Successful read and write operations confirm below.

• The OSPI NOR flash partition is accessible.

• The UBI device is functioning correctly.

• The UBIFS volume can be mounted and used from both Linux and U-Boot environments.

At this point, the rootfs volume is ready to store the Linux kernel image, DTB, and root filesystem components described in the next chapter.