Skip to contentSkip to conversation

Enable Ethernet boot on SK-AM62A-LP

PATCH In review Chintan Vankar 2 participants 6 messages Jul 16 – Jul 28 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

v3 cover Enable Ethernet boot on SK-AM62A-LP

This series enables Ethernet boot on SK-AM62A-LP. The series is based on commit 'a18265f1ccb7' of origin/next branch of U-Boot repo.

Link to v2:
https://lore.kernel.org/all/[email protected]/

Logs:
https://gist.github.com/chintan013/99c20c1c0773a48cc52a86d3eb86a98a

Changes from v2 to v3:
-> Removed duplicate config option from r5 defconfig file. -> Added "Reviewed-by" and "Tested-by" tags from Anshul Dalal. -> Removed "bootph-all" tag from "main_pktdma" and posted the
patch by adding it in Linux/upstream device tree.
-> Added the Ethernet boot documentation for SK-AM62A-LP.

Note:
The functionality can be verified after U-Boot DT is synced with the Linux DT with the patch:
https://lore.kernel.org/all/[email protected]/
Currently the feature is tested by configuring the random MAC address.

Chintan Vankar (4):
configs: am62ax_evm_r5_ethboot: Enable config options required for
Ethernet boot
configs: am62ax_evm_a53_ethboot: Enable config options required to
enable Ethernet boot
arm: dts: k3-am62a7-sk-u-boot: Enable DM services for main_pktdma
doc: board: ti: am62ax_sk: Add document for Ethernet boot on AM62x
SoC.

 arch/arm/dts/k3-am62a7-r5-sk.dts         |   4 +
 configs/am62ax_evm_a53_ethboot_defconfig |  10 ++
 configs/am62ax_evm_r5_ethboot_defconfig  |  21 +++
 doc/board/ti/am62ax_sk.rst               | 197 ++++++++++++++++++++++-
 4 files changed, 231 insertions(+), 1 deletion(-)
 create mode 100644 configs/am62ax_evm_a53_ethboot_defconfig
 create mode 100644 configs/am62ax_evm_r5_ethboot_defconfig
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 1/4 configs: am62ax_evm_r5_ethboot: Enable config options required for Ethernet boot

The R5 SPL SRAM size is limited and cannot accommodate both MMC boot and Ethernet boot config options simultaneously. Add a dedicated defconfig that enables the Ethernet boot on SK-AM62A-LP for R5 SPL stage.

---

Link to v2:
https://lore.kernel.org/all/[email protected]/

Changes from v2 to v3:
-> Removed duplicate config option from r5 defconfig file. -> Added "Reviewed-by" and "Tested-by" tags from Anshul Dalal.

 configs/am62ax_evm_r5_ethboot_defconfig | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 configs/am62ax_evm_r5_ethboot_defconfig
configs/am62ax_evm_r5_ethboot_defconfig new file +21 -0
new file mode 100644
index 00000000000..8763f32c0dc
@@ -0,0 +1,21 @@
+#include <configs/am62ax_evm_r5_defconfig>
+
+# CONFIG_NO_NET is not set
+CONFIG_SPL_GPIO=y
+CONFIG_SPL_MMC=n
+CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x200000
+CONFIG_SPL_DMA=y
+CONFIG_SPL_ENV_SUPPORT=y
+CONFIG_SPL_ETH=y
+CONFIG_SPL_I2C=y
+CONFIG_NET=y
+CONFIG_SPL_NET=y
+CONFIG_SPL_NET_VCI_STRING="AM62AX U-Boot R5 SPL"
+CONFIG_CMD_DHCP=y
+CONFIG_SPL_SYSCON=y
+CONFIG_DMA_CHANNELS=y
+CONFIG_TI_K3_NAVSS_UDMA=y
+CONFIG_DM_I2C=y
+CONFIG_PHY_TI_DP83867=y
+CONFIG_TI_AM65_CPSW_NUSS=y
Signature · 1 line
2.34.1
#2 lore raw

PATCH v3 2/4 configs: am62ax_evm_a53_ethboot: Enable config options required to enable Ethernet boot

In reply to Chintan Vankar

Enable config options required to enable Ethernet boot on SK-AM62A-LP for A53 SPL stage.

---

Link to v2:
https://lore.kernel.org/all/[email protected]/

Changes from v2 to v3:
-> Added "Reviewed-by" and "Tested-by" tags from Anshul Dalal.

 configs/am62ax_evm_a53_ethboot_defconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 configs/am62ax_evm_a53_ethboot_defconfig
configs/am62ax_evm_a53_ethboot_defconfig new file +10 -0
new file mode 100644
index 00000000000..a3ac67feb85
@@ -0,0 +1,10 @@
+#include <configs/am62ax_evm_a53_defconfig>
+
+CONFIG_SPL_DRIVERS_MISC=y
+CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_DMA=y
+CONFIG_SPL_ENV_SUPPORT=y
+CONFIG_SPL_ETH=y
+CONFIG_SPL_NET=y
+CONFIG_SPL_NET_VCI_STRING="AM62AX U-Boot A53 SPL"
+CONFIG_SPL_SYSCON=y
Signature · 1 line
2.34.1
#3 lore raw

PATCH v3 3/4 arm: dts: k3-am62a7-sk-u-boot: Enable DM services for main_pktdma

In reply to Chintan Vankar

Enable DM services for main_pktdma during R5 SPL stage.

---

Link to v2:
https://lore.kernel.org/all/[email protected]/

Changes from v2 to v3:
-> Added "Tested-by" tags from Anshul Dalal.
-> Removed "bootph-all" tag from "main_pktdma".

 arch/arm/dts/k3-am62a7-r5-sk.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/k3-am62a7-r5-sk.dts +4 -0
index 4570ff6edbf..6ea640856b4 100644
@@ -42,3 +42,7 @@
 	status = "okay";
 	bootph-pre-ram;
 };
+
+&main_pktdma {
+	ti,sci = <&dm_tifs>;
+};
Signature · 1 line
2.34.1
#4 lore raw

PATCH v3 4/4 doc: board: ti: am62ax_sk: Add document for Ethernet boot on AM62x SoC.

In reply to Chintan Vankar

Document the procedure to enable Ethernet Boot on SK-AM62A-LP.

---

This patch is newly added to this series.

 doc/board/ti/am62ax_sk.rst | 197 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 196 insertions(+), 1 deletion(-)
doc/board/ti/am62ax_sk.rst +196 -1
index 6f3432f7895..3453ed339e7 100644
@@ -185,7 +185,202 @@ https://www.ti.com/lit/pdf/spruj16 under the `Boot Mode Pins` section.
      - 00000000
      - 11001010
 
-For SW2 and SW1, the switch state in the "ON" position = 1.
+   * - Ethernet
+     - 00110000
+     - 11000100
+
+For SW3 and SW2, the switch state in the "ON" position = 1.
+
+Ethernet based boot
+-------------------
+
+To boot the board via Ethernet, configure the BOOT MODE pins for Ethernet boot.
+
+On powering on the device, ROM uses the Ethernet Port corresponding to CPSW3G's MAC
+Port 1 to transmit "TI K3 Bootp Boot".
+
+The TFTP server and DHCP server on the receiver device need to be configured such
+that VCI string "TI K3 Bootp Boot" maps to the file `tiboot3.bin` and the TFTP
+server should be capable of transferring it to the device.
+
+**Configuring DHCP server includes following steps:**
+
+* Install DHCP server:
+
+.. prompt:: bash $
+
+  sudo apt install isc-dhcp-server
+
+* Disable services before configuring:
+
+.. prompt:: bash $
+
+  sudo systemctl disable --now isc-dhcp-server.service isc-dhcp-server6.service
+
+* DHCP server setup
+
+Run the ip link or ifconfig command to find the name of your network interface:
+
+Example
+
+.. code-block::
+
+  eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
+        inet 10.0.0.5  netmask 255.255.255.0  broadcast 10.0.0.255
+        inet6 fe80::1a2b:3c4d:5e6f:7a8b  prefixlen 64  scopeid 0x20<link>
+        ether aa:bb:cc:dd:ee:ff  txqueuelen 1000  (Ethernet)
+        RX packets 100000  bytes 120000000 (120.0 MB)
+        RX errors 0  dropped 0  overruns 0  frame 0
+        TX packets 50000  bytes 6000000 (6.0 MB)
+        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
+
+  enx001122334455: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
+          ether 00:11:22:33:44:55  txqueuelen 1000  (Ethernet)
+          RX packets 200  bytes 64000 (64.0 KB)
+          RX errors 0  dropped 0  overruns 0  frame 0
+          TX packets 150  bytes 20000 (20.0 KB)
+          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
+
+  lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
+          inet 127.0.0.1  netmask 255.0.0.0
+          inet6 ::1  prefixlen 128  scopeid 0x10<host>
+          loop  txqueuelen 1000  (Local Loopback)
+          RX packets 10000  bytes 800000 (800.0 KB)
+          RX errors 0  dropped 0  overruns 0  frame 0
+          TX packets 10000  bytes 800000 (800.0 KB)
+          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
+
+Suppose we are using enx001122334455 interface, one end of it is connected to host PC
+and other to board.
+
+* Do the following changes in /etc/dhcp/dhcpd.conf in host PC.
+
+.. code-block::
+
+  subnet 192.168.0.0 netmask 255.255.254.0
+  {
+  range dynamic-bootp 192.168.0.2 192.168.0.5;
+  if substring (option vendor-class-identifier, 0, 16) = "TI K3 Bootp Boot"
+  {
+  filename "tiboot3.bin";
+  } elsif substring (option vendor-class-identifier, 0, 20) = "AM62AX U-Boot R5 SPL"
+  {
+  filename "tispl.bin";
+  } elsif substring (option vendor-class-identifier, 0, 21) = "AM62AX U-Boot A53 SPL"
+  {
+  filename "u-boot.img";
+  }
+  default-lease-time 60000;
+  max-lease-time 720000;
+  next-server 192.168.0.1;
+  }
+
+* Do following changes in /etc/default/isc-dhcp-server
+
+.. code-block::
+
+  DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
+  INTERFACESv4="enx001122334455"
+  INTERFACESv6=""
+
+* For your interface change ip address and netmask to next-server and your netmask
+
+.. prompt:: bash $
+
+  sudo ifconfig enx001122334455 192.168.0.1 netmask 255.255.254.0
+
+* Enable DHCP
+
+.. prompt:: bash $
+
+  sudo systemctl enable --now isc-dhcp-server
+
+* To see if there is any configuration error or if dhcp is running run
+
+.. prompt:: bash $
+
+  sudo service isc-dhcp-server status
+  # If it shows error then something is wrong with configuration
+
+**For TFTP setup follow below steps:**
+
+* Install TFTP server:
+
+.. prompt:: bash $
+
+  sudo apt install tftpd-hpa
+
+tftpd-hpa package should be installed.
+
+Now, check whether the tftpd-hpa service is running with the following command:
+
+.. prompt:: bash $
+
+  sudo systemctl status tftpd-hpa
+
+* Configuring TFTP server:
+
+The default configuration file of tftpd-hpa server is /etc/default/tftpd-hpa.
+If you want to configure the TFTP server, then you have to modify this configuration
+file and restart the tftpd-hpa service afterword.
+
+To modify the /etc/default/tftpd-hpa configuration file, run the following command
+
+.. prompt:: bash $
+
+  sudo vim /etc/default/tftpd-hpa
+
+Configuration file may contain following configuration options by default:
+
+.. code-block::
+
+  # /etc/default/tftpd-hpa
+
+  TFTP_USERNAME="tftp"
+  TFTP_DIRECTORY="/var/lib/tftpboot"
+  TFTP_ADDRESS=":69"
+  TFTP_OPTIONS="--secure"
+
+Now change the **TFTP_DIRECTORY** to **/tftp** and add the **--create** option to the
+**TFTP_OPTIONS**. Without the **--create** option, you won't be able to create or upload
+new files to the TFTP server. You will only be able to update existing files.
+
+After above changes /etc/default/tftpd-hpa file would look like this:
+
+.. code-block::
+
+  # /etc/default/tftpd-hpa
+
+  TFTP_USERNAME="tftp"
+  TFTP_DIRECTORY="/tftp"
+  TFTP_ADDRESS=":69"
+  TFTP_OPTIONS="--secure --create"
+
+Since we have configured tftp directory as /tftp, put tiboot3.bin, tispl.bin
+and u-boot.img after building it using sdk or manually cloning all the repos.
+
+To build binaries use following defconfig files:
+
+.. code-block::
+
+  am62ax_evm_r5_ethboot_defconfig
+  am62ax_evm_a53_ethboot_defconfig
+
+`tiboot3.bin` is expected to be built from `am62ax_evm_r5_ethboot_defconfig` and
+`tispl.bin` and `u-boot.img` are expected to be built from
+`am62ax_evm_a53_ethboot_defconfig`.
+
+Images should get fetched in following sequence as a part of boot procedure:
+
+.. code-block::
+
+  tiboot3.bin => tispl.bin => u-boot.img
+
+ROM loads and executes `tiboot3.bin` provided by the TFTP server.
+
+Next, based on NET_VCI_STRING string mentioned in respective defconfig file `tiboot3.bin`
+fetches `tispl.bin` and then `tispl.bin` fetches `u-boot.img` from TFTP server which
+completes Ethernet boot on the device.
 
 Falcon Mode
 -----------
Signature · 1 line
2.34.1
#5 lore raw
In reply to Chintan Vankar
Quoted 10 lines · Chintan Vankar

This series enables Ethernet boot on SK-AM62A-LP. The series is based on commit 'a18265f1ccb7' of origin/next branch of U-Boot repo.

Link to v2:
https://lore.kernel.org/all/[email protected]/

Logs:
https://gist.github.com/chintan013/99c20c1c0773a48cc52a86d3eb86a98a

[...]

Applied to u-boot/main, thanks!

[1/4] configs: am62ax_evm_r5_ethboot: Enable config options required for Ethernet boot

      commit: 5aec4a2c9099888d5e9334a51bc60cce7eb52b94
[2/4] configs: am62ax_evm_a53_ethboot: Enable config options required to enable Ethernet boot
      commit: 707a9b537b2a0d30e6523be9c926796674773a65
[3/4] arm: dts: k3-am62a7-sk-u-boot: Enable DM services for main_pktdma
      commit: 3e3dfa33507a2e2ce64e679d6cbb09b59f0cbf53
[4/4] doc: board: ti: am62ax_sk: Add document for Ethernet boot on AM62x SoC.
      commit: 179a5619aaf48d127a8b706981ce381e50eea924
Signature · 1 line
Tom