OSPI

An Octal Serial Peripheral Interface (OSPI) Flash is populated on the SOM as a programmable nonvolatile storage. The OSPI Flash can be used for a fast boot. This guide will walk through how to flash the SOM’s OSPI via U-boot, followed by booting from OSPI. For more information on OSPI, please see section 6.1.4 in the phyCORE-AM62x Hardware Manual.

Flashing the OSPI

The easiest way to access the SOM’s OSPI is to boot the SOM into U-Boot from an SD card (you may already be doing this). This guide will require a “Bootable SD card”, an SD card that has been flashed with the development kit’s BSP image. For instructions on how to create a bootable SD card, see this guide SD Card.

  • Power on the development kit and hit any key to stop in U-Boot.

    Note

    Be sure that you are booting the kit from SD card!

  • Within U-Boot, flash both SPLs and the U-Boot image into the OSPI storage device.

    Target (U-Boot)
     sf probe
    
     fatload mmc 1 $loadaddr tiboot3.bin
     sf update  $loadaddr 0x0 $filesize
    
     fatload mmc 1 $loadaddr tispl.bin
     sf update  $loadaddr 0x80000 $filesize
    
     fatload mmc 1 $loadaddr u-boot.img
     sf update  $loadaddr 0x280000 $filesize
    
  • Unplug power from the kit. Follow the next section “Boot from OSPI” to configure the hardware.

Boot from OSPI

The phyCORE-AM62x development kit is configured to boot from an SD Card slot by default. This guide will serve to provide basic steps for booting from the SOM’s onboard OSPI flash memory after it has been flashed.

  • Keep the bootable SD card inserted in the kit.

    This is kept in during booting due to OSPI’s limit space. The SD card contains the kernel and root filesystem for the BSP image; OSPI currently contains the bootloader.

  • S10 should be ON.

../_images/pb-07124_boot-ospi.png phyCORE-AM62x Boot Switches

Note

Be mindful of the switch orientation!

Initramfs with OSPI

You can also include an initramfs and kernel on the OSPI NOR, which will allow you to boot into Linux using OSPI. Again, you will need to be booted into U-Boot with an SD card, and this guide also expects that you have a USB drive with an initramfs image on it. The name of the initramfs image will vary depending on what machine you are using.

Target (U-Boot)
sf probe

fatload mmc 1 $loadaddr tiboot3.bin
sf update $loadaddr 0x0 $filesize

fatload mmc 1 $loadaddr tispl.bin
sf update $loadaddr 0x80000 $filesize

fatload mmc 1 $loadaddr u-boot.img
sf update $loadaddr 0x280000 $filesize

fatload mmc 1 $loadaddr k3-am625-phyboard-lyra-rdk.dtb
sf update $loadaddr 0x700000 $filesize
setenv size_fdt $filesize

fatload mmc 1 $loadaddr Image
sf update $loadaddr 0x800000 $filesize
setenv size_kern $filesize

usb start

fatload usb 0 $loadaddr phytec-initramfs-image-phyboard-lyra-am62xx-3.cpio.xz
sf update $loadaddr 0x1e00000 $filesize
setenv size_fs $filesize

saveenv

env export -c $loadaddr
sf update $loadaddr 0x680000 $filesize
sf update $loadaddr 0x6c0000 $filesize

Now change your board to OSPI boot mode using the boot switches as shown above.

Once you boot into linux, in order to populate the /dev directory, you must run the following command. Once /dev is populated, you can write to the eMMC.

Target (Linux)
mount -t devtmpfs udev /dev

Limitations with OSPI

Unfortunatly, only SOMs with 64MB or more of NOR have space for a root filesystem. If you do not have space for a root file system, PHYTEC recommends to load a Kernel and root filesystem via Ethernet.