Network

The phyCORE-AM67x Development Kit can be operated as a disk-less system by hosting its bootloader, kernel, device tree and root filesystem on a remote server and then loading/mounting these artifacts over a Local Area Network. This approach is very convenient throughout development because you can quickly build and test changes to your kernel and root filesystem without having to update a physical boot device (such as the bootable SD Card). Furthermore, it makes file transfers between your Host Machine and phyCORE-AM67x Development Kit easy since they will effectively have shared access to the same directories.

Note

  • BSP-Yocto-Ampliphy-AM67x-PD25.1.0 only supports 1x ethernet port in the U-Boot bootloader by default. You MUST use ETH0 (reference designator X7) for these steps to work.

  • Link info Bootmode pin needs to be ON along with RGMII boot mode selection Bootmode pins.

Requirements

Hardware

  • Ubuntu 24.04 LTS or newer

    • If using a virtual machine, VMWare Workstation, VMWare Player, and VirtualBox are all viable solutions.

  • Ethernet cable

  • USB to Ethernet Adapter - This provides an isolated network for us to serve our files to the phyCORE-AM67x.

Software

Prepare the following U-Boot images by building the BSP (Build the BSP) or downloading the pre-built (Pre-Built Binaries) image files. These images will be used for downloading to and booting on the phyCORE-AM67x via UART:

* tiboot3.bin-ethboot
* tispl.bin
* u-boot.img

Boot Switch Settings

The phyCORE-AM67x development kit is configured to boot from an SD Card slot by default and basic steps for performing this and establishing serial communication are outlined in the Quickstart. We need to modify the default boot configuration to Network Boot.

  • S7 should be ON to override default boot settings.

Network Boot Switch phyBOARD-AM67x Boot Switches

Note

Be mindful of the switch orientation!

Load The Bootloader

The phyCORE-AM67x boot ROM has the ability to make BOOTP requests to retrieve a bootloader over the network. This requires configuring a DHCP and TFTP server on our host machine.

Host Setup - DHCP Server

Note

Basic DHCP server installation and setup is covered in Host Setup.

The DHCP server replying to BOOTP requests from the SoC must provide a filename to be fetched over TFTP for each stage of the boot depending on the Vendor-Class-Identifier (VCI) DHCP field specified in the request. VCI DHCP field is filled out by the ROM and subsequent stages and corresponding binaries files to be sent over TFTP are listed in the table below.

This configuration extends the basic DHCP setup with BOOTP support and vendor-class-identifier logic for the phyCORE-AM67x.

Once the server is set up, we can edit the DHCP configuration file:

sh-host:~$ sudo vim /etc/dhcp/dhcpd.conf

Define the BOOTP options for the phyCORE-AM67x. Make sure to adapt the subnet range to your network card!

default-lease-time 600;
max-lease-time 7200;

allow booting;
allow bootp;

option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.100.1;
option routers 192.168.100.254;
option broadcast-address 192.168.100.255;

# Define the subnet and netmask
subnet 192.168.100.0 netmask 255.255.255.0
{
   # Specify a range of IP addresses for BOOTP
   range dynamic-bootp 192.168.100.10 192.168.100.31;

   # Conditional filename assignments based on the vendor-class-identifier
   if substring (option vendor-class-identifier, 0, 16) = "TI K3 Bootp Boot"
   {
      filename "tiboot3.bin-ethboot";
   } elsif substring (option vendor-class-identifier, 0, 20) = "AM67X U-Boot R5 SPL"
   {
      filename "tispl.bin";
   } elsif substring (option vendor-class-identifier, 0, 21) = "AM67X U-Boot A53 SPL"
   {
      filename "u-boot.img";
   }

   # Lease times
   default-lease-time 6000;
   max-lease-time 72000;

   # The IP address of the TFTP server (this could be the DHCP server itself)
   next-server 192.168.100.1;
}

We can now start our DHCP server:

sh-host:~$ sudo systemctl start isc-dhcp-server

To check the status of our server we can run the following:

sh-host:~$ systemctl status isc-dhcp-server
● isc-dhcp-server.service - ISC DHCP IPv4 server
      Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
      Active: active (running) since Wed 2024-07-31 15:43:35 PDT; 4s ago
      Docs: man:dhcpd(8)
   Main PID: 173833 (dhcpd)
      Tasks: 4 (limit: 115431)
      Memory: 4.5M
            CPU: 15ms
      CGroup: /system.slice/isc-dhcp-server.service
               └─173833 dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf /etc/dhcp/dhcpd.conf enx047bcb62cb4a

Host Setup - TFTP Server (Bootloader Files)

Note

Basic TFTP server installation and setup is covered in Host Setup.

Once the TFTP server is up, we need to copy our desired u-boot binaries to it. Checkout the Build the BSP guide to give you a basis for customizing your software for your application requirements. For now, we’ll just populate our TFTP server with pre-built binaries:

sh-host:~$ cd /tftpboot

sh-host:~$ wget https://download.phytec.de/Software/Linux/BSP-Yocto-AM67x/BSP-Yocto-Ampliphy-AM67x-PD25.1.0/images/ampliphy-vendor/phyboard-rigel-am67xx-1/tiboot3.bin-ethboot
sh-host:~$ wget https://download.phytec.de/Software/Linux/BSP-Yocto-AM67x/BSP-Yocto-Ampliphy-AM67x-PD25.1.0/images/ampliphy-vendor/phyboard-rigel-am67xx-1/tispl.bin
sh-host:~$ wget https://download.phytec.de/Software/Linux/BSP-Yocto-AM67x/BSP-Yocto-Ampliphy-AM67x-PD25.1.0/images/ampliphy-vendor/phyboard-rigel-am67xx-1/u-boot.img

At this point we are ready to load our bootloader from the network!

Target Setup (phyCORE-AM67x)

Ensure one end of your Ethernet cable is plugged into ETH0 of the dev kit, the other end should be connected to your dhcp server. Simply power on the board. If everything is configured correctly, the boot rom will reach out to the DHCP server to download the boot binaries.

Note

BOOTP requests and replies are mapped via VCI strings → vendor class identification strings.

Boot Flow: ROM -> DHCP/BOOTP -> tiboot3 -> DHCP/BOOTP -> tispl.bin -> DHCP/BOOTP -> u-boot.img


Load The Kernel

We can configure our phyCORE-AM67x‘s bootloader to grab the kernel and device trees in form of a fitImage over the network and use them for boot. This can be done by modifying the bootloader environment directly on the running phyCORE-AM67x and making use of U-Boot’s standard boot mechanism.

Refer to the Quickstart guide for the basic steps required to boot your phyCORE-AM67x. When prompted, halt autoboot and stop in the U-Boot bootloader.

Connect your phyCORE-AM67x Development Kit’s ETH0 port to your Local Area Network using a CAT-5e cable.

Host Setup - NFS Server

Note

Basic NFS server installation and setup is covered in Host Setup.

Once the NFS is up, we just need to populate it with our desired root filesystem. Checkout the Build the BSP guide to give you a basis for customizing your software for your application requirements.

For now, we’ll just populate our NFS with a pre-built root filesystem:

sh-host:~$ wget phytec-headless-image-phyboard-rigel-am67xx-1.rootfs.tar.gz
sh-host:~$ sudo tar -xvf phytec-headless-image-phyboard-rigel-am67xx-1.rootfs.tar.gz -C /nfsroot
sh-host:~$ rm phytec-headless-image-phyboard-rigel-am67xx-1.rootfs.tar.gz

The NFS should now be ready for network booting the kernel from the bootloader!

Host Setup - TFTP Server (Kernel Files)

Note

Basic TFTP server installation and setup is covered in Host Setup.

In addition to all bootloader files, the Linux kernel image, and device tree blob are required. Fetch both pre-build files and store them in the tftpboot directory:

sh-host:~$ cd /tftpboot

sh-host:~$ wget https://download.phytec.de/Software/Linux/BSP-Yocto-AM67x/BSP-Yocto-Ampliphy-AM67x-PD25.1.0/images/ampliphy-vendor/phyboard-rigel-am67xx-1/fitImage
sh-host:~$ wget https://download.phytec.de/Software/Linux/BSP-Yocto-AM67x/BSP-Yocto-Ampliphy-AM67x-PD25.1.0/images/ampliphy-vendor/phyboard-rigel-am67xx-1/net_boot_fit.scr.uimg

Target Setup (phyCORE-AM67x)

Since the server IP and nfsroot directory could be different in other networks, we do not set any default values. Enter the following commands to modify the bootloader environment.

sh-uboot:~# setenv nfsroot /nfsroot
sh-uboot:~# setenv serverip 192.168.100.1

Now we can proceed with standard boot:

sh-uboot:~# bootflow scan -lb

If the phyCORE-AM67x has configured its boot switches for ethernet boot, the boot_targets variable will be set to "dhcp mmc0 mmc1 spi_flash" which will prioritize the network boot.

Once fully booted into Linux, you can double check that your root filesystem is mounted over a network (as opposed to the 2nd, unused rootfs partition of the SD Card) with the following command:

sh-phyboard-rigel-am67xx-1:~# mount | grep nfs
Example Output
sh-phyboard-rigel-am67xx-1:~# mount | grep nfs
172.22.10.18:/nfsroot on / type nfs4 (rw,relatime,vers=4.0,rsize=4096,wsize=4096,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.22.30.129,local_lock=none,addr=172.22.10.18)