Changes between Version 4 and Version 5 of venice/ethernet


Ignore:
Timestamp:
01/04/2023 06:58:09 PM (2 years ago)
Author:
Ryan Erbstoesser
Comment:

add 74xx info

Legend:

Unmodified
Added
Removed
Modified
  • venice/ethernet

    v4 v5  
    3030 * For boards like the GW740x which have a multi-port GbE switch, bandwidth is shared across the downstream ports
    3131
     32== GW740x Ethernet Notes
     33
     34The GW740x has 6 RJ45's on the front panel. When looking at the board
     35from the front with the user LED and barrel jack on the left these
     36ports are:
     37eth0 (IMX8MM EQOS MAC + GPY111 RGMII PHY)
     38lan1 (KSZ9477 switch port from IMX8MM FEC MAC (eth1) CPU uplink)
     39lan2 (KSZ9477 switch port from IMX8MM FEC MAC (eth1) CPU uplink)
     40lan3 (KSZ9477 switch port from IMX8MM FEC MAC (eth1) CPU uplink)
     41lan4 (KSZ9477 switch port from IMX8MM FEC MAC (eth1) CPU uplink)
     42lan5 (KSZ9477 switch port from IMX8MM FEC MAC (eth1) CPU uplink)
     43
     44In U-Boot use the 'net list' command to show the available network
     45devices as well as the 'eth' interface name and the device name that
     46can be used to specify the active device in U-Boot. Either name can be
     47set to the 'ethact' env variable to specify the active device and only
     481 device is active at a time for U-Boot network commands.
     49
     50Note that from the CPU's perspective 'eth1' is the CPU uplink device
     51to the KSZ9477 switch so it is never used by itself.
     52
     53Example:
     54# list network devs in U-Boot
     55u-boot=> net list
     56eth2 : lan1 00:d0:12:d3:f7:8e
     57eth3 : lan2 00:d0:12:d3:f7:8f
     58eth4 : lan3 00:d0:12:d3:f7:90
     59eth5 : lan4 00:d0:12:d3:f7:91
     60eth6 : lan5 00:d0:12:d3:f7:92
     61eth1 : ethernet@30be0000 00:d0:12:d3:f7:8d
     62eth0 : ethernet@30bf0000 00:d0:12:d3:f7:8c active
     63# specify eth0 (the 1st RJ45) (this is also the default)
     64setenv ethact eth0
     65# specify lan1 (the 2nd RJ45)
     66setenv ethact lan1 # or eth2 if you want but that is a U-Boot only name
     67# save env if you want this to persist in U-Boot across boots
     68saveenv
     69
     70For Linux, specifically our kernel and BSP you will see the device naming above:
     71eth0 (IMX8MM EQOS MAC + GPY111 RGMII PHY)
     72lan1 (KSZ9477 switch port from IMX8MM FEC MAC (eth1) CPU uplink)
     73lan2 (KSZ9477 switch port from IMX8MM FEC MAC (eth1) CPU uplink)
     74lan3 (KSZ9477 switch port from IMX8MM FEC MAC (eth1) CPU uplink)
     75lan4 (KSZ9477 switch port from IMX8MM FEC MAC (eth1) CPU uplink)
     76lan5 (KSZ9477 switch port from IMX8MM FEC MAC (eth1) CPU uplink)
     77
     78In Linux 5.12+ you do not need to bring up the CPU uplink port to the
     79switch (eth1) as it will be brought up whenever any of the downstream
     80ports are brought up. Modern Linux DSA (Distributed Switch
     81Architecture) provides more or less full interface devices for the
     82ports on the switch thus you can have IP configuration, VLAN etc, on
     83the individual ports.
     84
     85Additionally our BSP is pre-configured to bring up eth0 with DHCP so
     86if you have the first RJ45 plugged into your network you should see
     87'eth0' properly configured for networking. If you want to use the 2nd
     88RJ45 it would be 'lan1', etc.
     89
     90For Linux here are some gory details that you should be aware of if
     91you stray from our kernel/BSP:
     92In Linux things can be a bit more complicated depending on if you have
     93systemd/udev changing device names or not. Linux will register
     94on-board network devices as 'eth%d' starting at 0 and incrementing in
     95the order the device is registered which depends greatly on the kernel
     96(linking order, modules vs static drivers etc) and the kernel makes NO
     97attempt to make this consistent across reboots. Therefore there is a
     98concept in Linux where a userspace process like systemd/udev will
     99rename the network interfaces as they get registered to use
     100bus/port/path specific names that are consistent across boots. This
     101produces pretty confusing names to most users so we disable this
     102feature in our default build by passing 'net.ifnames=0' on the kernel
     103command line which confusing enough is not at all a kernel option but
     104systemd/udev parses the kernel cmdline to look for this. To make
     105things worse DSA drivers (which modern switch devices are) get their
     106port names from device-tree so Linux will name those 'lan1', 'lan2'.
     107And to make things really worse because the IMX8MM FEC and EQOS
     108network devices are different MAC's (both inside the IMX8MP) they have
     109different drivers and those drivers can register in either order so
     110eth0/eth1 can flip around across boots. I added a kernel patch (a
     111controversial one that will never make it upstream) to our kernel to
     112avoid this and make them consistent.
     113
     114Linux 5.12 DSA drivers will bring up the cpu port interface
     115automatically which is why one may see eth1 up after bringing up any of
     116the lan ports.
     117
     118
     119