Version 3 (modified by 4 days ago) ( diff ) | ,
---|
Ethernet
This is a generic Ethernet page for all Gateworks SBCs.
Also see the Venice Ethernet page: venice/ethernet
MAC Address Information and Programming
Gateworks can program custom MAC addresses to ethernet on orders of 100 pieces or more (considered a Gateworks special)
The ethernet MAC address for onboard ethernet devices come from our Gateworks board-info EEPROM.
To see the MAC address, see below examples:
U-Boot:
u-boot=> print ethaddr # eth0's address ethaddr=00:d0:12:8a:f8:24 ^^^ U-Boot won't allow you to change this unless you rebuild with CONFIG_OVERWRITE_ETHADDR_ONCE=y u-boot=> net list eth0 : ethernet@30be0000 00:d0:12:8a:f8:24 active
Linux:
Linux: root@noble-venice:~# ifconfig eth0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.24.20.205 netmask 255.240.0.0 broadcast 172.24.255.255 inet6 fe80::af3f:d05c:7c8c:9bd3 prefixlen 64 scopeid 0x20<link> ether 00:d0:12:8a:f8:24 txqueuelen 1000 (Ethernet) RX packets 181 bytes 14541 (14.5 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 60 bytes 5390 (5.3 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 root@noble-venice:~# ifconfig eth0 hw ether 00:d0:12:8a:f8:25 root@noble-venice:~# ifconfig eth0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.24.20.205 netmask 255.240.0.0 broadcast 172.24.255.255 inet6 fe80::af3f:d05c:7c8c:9bd3 prefixlen 64 scopeid 0x20<link> ether 00:d0:12:8a:f8:25 txqueuelen 1000 (Ethernet) RX packets 243 bytes 18817 (18.8 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 60 bytes 5390 (5.3 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Venice MAC Addresses
Venice is made of a baseboard and a SOM.
In the case of a SoM+Baseboard the MAC Addresses are stored in the EEPROM of where the MAC is so for a GW72xx/GW73xx for example, eth0's (IMX8M FEC) mac is in the SoM EEPROM and eth1's (LAN7430 PCI GbE) is in the Baseboard EEPROM. The MAC's for Venice and beyond are stored in the EEPROM as a base address and a number of MAC's (so for example a GW74xx's EEPROM specifies 7 MAC addresses for eth0, eth1, lan1, lan2, lan3, lan4, lan5). The MAC's are read from the EEPROM's and assigned to env vars in U-Boot where 'ethaddr' is the first one, and 'eth1addr' the 2nd and so on. The bootloader has code to assign these MAC's to placeholders in the device-tree which the Linux kernel drivers use.
Therefore if you want to assign them manually you can do so in the bootloader (but by default the bootloader does not allow you to alter the eth*addr vars unless you build it with CONFIG_OVERWRITE_ETHADDR_ONCE=y) or you can assign them in Linux depending on your OS (ie in /etc/network/interfaces or manually via cmdline).
If you want to have your own MAC's programmed in our EEPROM you would need a Gateworks special (for both SOM and baseboard depending on where the MAC's are) and give us an address range to use and have this specified in the ECO.
We do not provide a method to change the MAC address in our EEPROM. Doing so would require modifying the board info area and updating the checksum (risky as if you do something wrong, you can't boot properly at all and have to send the board back to us for programming) not to mention the complexity of figuring out which EEPROM to modify.
Also see the Venice Ethernet page: venice/ethernet
ethtool
ethtool
is the standard Linux tool used to talk to the Ethernet PHY.
Examples:
- show PHY details about an interface:
# ethtool eth0 Settings for eth0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: Symmetric Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: Symmetric Advertised auto-negotiation: Yes Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Link partner advertised pause frame use: Symmetric Receive-only Link partner advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: MII PHYAD: 0 Transceiver: external Auto-negotiation: on Supports Wake-on: d Wake-on: d Link detected: yes
Setting the Ethernet Port Speed
When using a 4-wire (2-pair) cable suitable for 100BASE-T on a Gigabit interface depending on the PHY and the link partner you may need to force the speed to 100Mbps.
For customers who would like to force a specific speed, you can use the following:
Examples:
- force 100mbps speed
# ifconfig eth0 down [ 261.516832] libphy: 2188000.ethernet:00 - Link is Down # ethtool -s eth0 autoneg off speed 100 # ifconfig eth0 up [ 265.516787] libphy: 2188000.ethernet:00 - Link is Up - 100/Full
Duplex
Most Ethernet NICs can be configured to be either full or half duplex. For information on what this means, please see this page.
You can use ethtool
to configure duplex:
# ifconfig eth0 down [ 261.516832] libphy: 2188000.ethernet:00 - Link is Down # ethtool -s eth0 autoneg off duplex half # ethtool eth0 | grep Duplex Duplex: Half
Ethernet PAUSE frames for flow control (802.3x)
The IEEE 802.3x standard introduced Ethernet PAUSE frames which can be used at the MAC level as a mechanism of flow-control much like that used in UARTs. A transmitter can send a PAUSE frame to a receiver to tell them to stop sending for a specified period of time if they can't keep up with the data flow.
This is typically only used if one end of the transmission can't keep up with the line-speed of the medium (ie a board supporting GigE that can't keep up with 1gbps).
Because the Fast Ethernet Controller (FEC) integrated into the IMX6 can't perform at 1000mbps the use of PAUSE frames may be desirable in certain cases.
Ethernet PAUSE frames are not supported across all the various Gateworks products (in some cases the hardware can't support it, in others the drivers may not support it):
- IMX6 FEC: (used as eth0 on GW51xx/GW52xx/GW53xx/GW54xx/GW55x) supports PAUSE frames (yet tx/rx must be set the same)
- Intel i210: (used on GW5520 and GW16083) supports symmetric PAUSE frames with independent control
- Marvell SKY2: (used as eth1 on GW54xx/GW53xx) supports PAUSE frames but no auto-negotiation
Use ethtool
to configure:
# Show pause-frame status root@OpenWrt:/# ethtool --show-pause eth0 Pause parameters for eth0: Autonegotiate: on RX: off TX: off RX negotiated: on TX negotiated: on # Disable pause frame support root@OpenWrt:/# ethtool --pause eth0 autoneg off rx off tx off rx unmodified, ignoring tx unmodified, ignoring root@OpenWrt:/# [ 92.519412] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full # Enable pause frame root@OpenWrt:/# ethtool --pause eth0 autoneg on # enable pause frame autoneg root@OpenWrt:/# [ 137.518636] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full
Notes:
- Note that FEC tx/rx pause frame support must be the same (you can't enable tx and disable rx for example)
- If PAUSE frames are supported by the NIC/driver their default configuration is auto-negotiated.
- If autonegotiation of PAUSE frames is enabled from a disabled state the link will go down and come back up
See also: