Using EVB-LAN96459F with a host board
The EVB-LAN96459F board can currently be used with EVB-LAN9668-EDS2 boards as the host.
This board has the RGMII, SPI and interrupt line that allows the LAN9645x to be managed via a Linux DSA Driver.
When the Linux Kernel runs on the host system the DSA driver uses the SPI connection to manage the configuration of the switch and the RGMII connection to inject and extract network frames. The interrupt line provides events to the host system.
In the console of the host system both the hosts own network ports as well as the front ports of the LAN9645x will be available as Linux network interfaces.
1. EVB-LAN9668-EDS2 as host board
1.1. Getting the software
First obtain the BSP Software release containing the software for the host system.
The file is named like this: "mchp-brsdk-arm-2025.02.3-XXX.tar.gz"
where XXX is the number of the build by the Microchip BSP build system.
The Linux Kernel for the host will also contain the Linux DSA Driver for the EVB-LAN96459F, so you only need to select the configuration that contains the device tree that loads the driver (and its dependencies).
The name of the configuration is "lan9668_ung8385_lan9645x_evb_0_at_lan966x"
Unpack the tarball and locate and display the contents of the standalone
folder that contains the artifacts that you will need:
file:
tar xvf mchp-brsdk-arm-2025.02.3-*.tar.gz ls -1 mchp-brsdk-arm-2025.02.3-*/arm-cortex_a8-linux-gnu/standalone/release
1.1.1. FIT Image
Display the contents of the U-Boot FIT image file:
dumpimage -l mchp-brsdk-arm-2025.02.3-*/arm-cortex_a8-linux-gnu/standalone/release/fit.itb
In this list of Linux kernel, root file system, device trees and configurations you should be able to see the following configuration:
Configuration 7 (lan9668_ung8385_lan9645x_evb_0_at_lan966x) Description: Kernel with DT fdt_lan9668_ung8385_lan9645x_evb_0_at_lan966x Kernel: kernel Init Ramdisk: ramdisk FDT: fdt_lan9668_ung8385_lan9645x_evb_0_at_lan966x
This configuration is the one you will be using for network booting the host system.
1.1.2. ext4 filesystem image
It is also possible to write a complete ext4 filesystem image to the hosts eMMC device and use that when booting. The ext4 root file system contains a so called "bare" FIT image that U-Boot can load.
The bare FIT image contains a Linux Kernel, device trees and configurations, but no root file system (as this is the content of the ext4 image).
The file is named brsdk_standalone_arm.ext4.gz
in the release tarball.
Copy the ext4 filesystem image file from the release to the root of your TFTP server.
1.2. Network boot the FIT image using U-Boot
For simplicity we start by network booting the FIT image, which means that you
must provide a TFTP server that holds the fit.itb
file that was listed
above.
Copy the
mchp-brsdk-arm-2025.02.3-*/arm-cortex_a8-linux-gnu/standalone/release/fit.itb
file to the root of the TFTP server, to make it available for network booting by
the EVB-LAN9668-EDS2, and ensure that the service is visible on the network
where the EVB-LAN9668-EDS2 is connected.
Now start by inserting the EVB-LAN96459F in slot 0 (labelled "MUST USE FIRST") of the EVB-LAN9668-EDS2 board.
Attach power, USB Console and network cables to the host board.
Start a terminal program and attach to the host board serial/USB connection. You can now press the reset button on the host and watch the boot sequence of the host system in your terminal program.
Stop the boot at the U-Boot shell by pressing Ctrl+C
Enter the following commands to setup network boot of the system:
setenv net_boot run rootargs_ram \; run setup \; dhcp fit.itb \; bootm \${loadaddr}#lan9668_ung8385_lan9645x_evb_0_at_lan966x setenv bootcmd run net_boot saveenv
If you would like to see the boot log as the kernel boots, you can do an
editenv bootargs_extra
and set the loglevel to a high value like e.g. 8.
Now you can run the command:
reset
to start the boot process.
If all went well you should now be seeing the LAN9645x being detected on the host system in the boot log:
[ 1.617871] microchip-lan9645x-spi spi0.0: SPI frequency: 35000000, padding bytes required: 9 [ 1.631791] microchip-lan9645x-spi spi0.0: SPI frequency: 35000000, padding bytes required: 9 ... [ 5.667280] lan9645x-switch lan9645x-switch.11.auto: NPI port=7 [ 5.673254] lan9645x-switch lan9645x-switch.11.auto: Disabled IPv6 on conduit device: eth2 [ 5.683007] lan9645x-switch lan9645x-switch.11.auto: Registered netlink family 'mchp_qos_9645x' [ 5.693652] lan9645x-switch lan9645x-switch.11.auto: Registered netlink family 'mchp_frer_9645x' ... [ 5.764636] lan9645x-switch lan9645x-switch.11.auto: configuring for fixed/rgmii-id link mode [ 5.775323] lan9645x-switch lan9645x-switch.11.auto: Link is Up - 1Gbps/Full - flow control rx/tx [ 5.864211] lan9645x-switch lan9645x-switch.11.auto lan0 (uninitialized): PHY [lan9645x-miim1.6.auto-mii:01] driver [Microchip LAN9645X Gigabit PHY] (irq=51) [ 5.974316] lan9645x-switch lan9645x-switch.11.auto lan1 (uninitialized): PHY [lan9645x-miim1.6.auto-mii:02] driver [Microchip LAN9645X Gigabit PHY] (irq=52) [ 6.074545] lan9645x-switch lan9645x-switch.11.auto lan2 (uninitialized): PHY [lan9645x-miim1.6.auto-mii:03] driver [Microchip LAN9645X Gigabit PHY] (irq=53) [ 6.164300] lan9645x-switch lan9645x-switch.11.auto lan3 (uninitialized): PHY [lan9645x-miim1.6.auto-mii:04] driver [Microchip LAN9645X Gigabit PHY] (irq=54)
and at the Linux console prompt you can now login as root and verify that the network interfaces provided by LAN9645x and visible on the host system.
# ip link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 1e:1e:8e:3c:cd:36 brd ff:ff:ff:ff:ff:ff 3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 96:1f:1d:ed:86:10 brd ff:ff:ff:ff:ff:ff 4: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 52:98:2f:30:cb:9c brd ff:ff:ff:ff:ff:ff 5: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 52:98:2f:30:cb:9d brd ff:ff:ff:ff:ff:ff 6: eth2: <BROADCAST,MULTICAST> mtu 1544 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 52:98:2f:30:cb:9e brd ff:ff:ff:ff:ff:ff 7: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/sit 0.0.0.0 brd 0.0.0.0 8: lan0@eth2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 52:98:2f:30:cb:9e brd ff:ff:ff:ff:ff:ff 9: lan1@eth2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 52:98:2f:30:cb:9e brd ff:ff:ff:ff:ff:ff 10: lan2@eth2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 52:98:2f:30:cb:9e brd ff:ff:ff:ff:ff:ff 11: lan3@eth2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 52:98:2f:30:cb:9e brd ff:ff:ff:ff:ff:ff 12: lan5@eth2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 52:98:2f:30:cb:9e brd ff:ff:ff:ff:ff:ff 13: lan6@eth2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 52:98:2f:30:cb:9e brd ff:ff:ff:ff:ff:ff
The ports on the EVB-LAN96459F is made available on the host with the naming
lanX@eth2
which signifies that the eth2 port (an RGMII port on the host) is
used as the connection towards the EVB-LAN96459F. In DSA this is called the
conduit port.
Take care not to use the conduit port (eth2 ) for any service
configuration as this is supposed to be owned by the Linux DSA Driver.
|
You can now start to configure and use the ports on the EVB-LAN96459F as described in the network section of this BSP.
1.3. eMMC boot
Ensure that you are currently booting from the host NOR flash device, as this will make it possible to return to a functional secure boot environment, in case something does not work as expected in the ext4 Image.
Then check if you can boot from eMMC by changing the bootstrapping on the EVB-LAN9668-EDS2 board to eMMC and powercycle the board.
If you can boot from eMMC, then you can skip to the Only update the ext4 filesystem section below.
If you cannot boot from eMMC you need follow the procedure in the following section.
Remember to switch back to booting the NOR flash before you continue.
1.3.1. Boot from eMMC from scratch
To use the eMMC device as the boot media and root file system, you will need to first create a partition table on the eMMC, if you have not already done so.
Then the FIP image (TF-A 2nd stage bootloader) must be added to the 'fip'
partition and optionally the fip.bak
partition.
Finally you need to write the new root file system (including a bare FIT image) to the Boot0 partition.
Follow the procedure here.
1.3.2. Only update the ext4 filesystem
If you already have a GPT partitioned eMMC device with a working FIP, then you
only need to write the new root file system (including a bare FIT image)
to the Boot0
partition.
Follow the procedure here.
1.3.3. Set eMMC as the boot media
When you have changed the bootstrapping of the board to use the eMMC device, U-Boot should automatically use the ext4 filesystem to as the root filesystem and load the bare FIT image from that location.
But you also need to select the correct device tree as mentioned above.
In the U-Boot shell change the value of the pcb
setting like this:
m => setenv pcb lan9668_ung8385_lan9645x_evb_0_at_lan966x m => saveenv
From now on the LAN9645x device tree will be used by the EVB-LAN9668-EDS2 host system to load the DSA driver that finds the LAN9645x device.