3.1.1.7. OSPI/QSPI

OSPI/QSPI is a serial peripheral interface like SPI the major difference being the support for Octal/Quad read, uses 8/4 data lines for read compared to 2 lines used by the traditional SPI. This section documents how to write files to the QSPI device and use it to load and then boot the Linux Kernel using a root filesystem also found on QSPI. At this time, no special builds of U-Boot are required to perform these operations on the supported hardware. For simplicity we assume the files are being loaded from an SD card. Using the network interface (if applicable) is documented above.

Note

Not all OSPI flashes can be supported. Users are recommended to check whether or not the OSPI flash part chosen for custom board designs meets all the criteria listed at https://e2e.ti.com/support/processors/f/791/t/946418

ROM supports booting from OSPI from offset 0x0.

Flashing Images to OSPI

Below commands can be used to download tiboot3.bin, tispl.bin and u-boot.img over tftp and then flash it to OSPI at respective addresses.

=> sf probe
=> tftp ${loadaddr} tiboot3.bin
=> sf update $loadaddr 0x0 $filesize
=> tftp ${loadaddr} tispl.bin
=> sf update $loadaddr 0x80000 $filesize
=> tftp ${loadaddr} u-boot.img
=> sf update $loadaddr 0x280000 $filesize
=> tftp ${loadaddr} sysfw.itb
=> sf update $loadaddr 0x6C0000 $filesize

PHY Calibration

PHY calibration allows for higher read performance. To enable PHY, the PHY calibration pattern must be flashed to OSPI at the start of the last erase sector. For the Micron MT35XU512ABA flash, this lies at the address 0x3fe0000.

Download the binary file containing the PHY pattern from here. Below commands can be used to flash the PHY pattern, with the location of the pattern depending on which flash is being used:

=> sf probe
=> tftp ${loadaddr} ospi_phy_pattern
=> sf update $loadaddr 0x3fe0000 $filesize

Flash Layout for OSPI

      0x0 +----------------------------+
          |     ospi.tiboot3(512K)     |
          |                            |
  0x80000 +----------------------------+
          |     ospi.tispl(2M)         |
          |                            |
 0x280000 +----------------------------+
          |     ospi.u-boot(4M)        |
          |                            |
 0x680000 +----------------------------+
          |     ospi.env(128K)         |
          |                            |
 0x6A0000 +----------------------------+
          |   ospi.env.backup (128K)   |
          |                            |
 0x6C0000 +----------------------------+
          |      ospi.sysfw(1M)        |
          |                            |
 0x7C0000 +----------------------------+
          |      padding (256k)        |
 0x800000 +----------------------------+
          |     ospi.rootfs(UBIFS)     |
          |                            |
0x3FE0000 +----------------------------+
          |   ospi.phypattern (128k)   |
          |                            |
          +----------------------------+

Kernel Image and DT are expected to be present in the /boot folder of UBIFS ospi.rootfs just like in SD card case. U-Boot looks for UBI volume named “rootfs” for rootfs.

To boot kernel from OSPI, at the U-Boot prompt:

=> setenv boot ubi
=> boot