5. Advanced Features
5.1. Test Modes
5.1.1. Packet Generator and Checker
In addition to the IEEE 802.2ch test modes, the RAD-Moon3 can be used as a packet generator and checker.
Pressing the button will cycle through the 4 modes below.
Note:
The Packet Generator and Checker is a feature of only the 2.5/5/10G-T port. (RJ-45)
5.1.2. IEEE 802.3ch Test Modes
IEEE 802.3ch defines a number of test modes for a MultiGBASE-T1 PHY. These test modes can be accessed by holding down and while the unit is unpowered and then connecting power. While in this mode, the two activity LEDs above the RAD-Moon3 logo will rapidly flash amber in unison.
Pressing the button cycles through each of these test modes. The mode can be exited with a power cycle.
The 3 LEDs on the membrane buttons are a binary representation of the test mode number. For example, if the LED Status from left to right were on/off/on, this would be a binary 101, or decimal 5. If a test mode has multiple submodes, this is represented by different colors of the LEDs. The active test mode can be determined using the table below.
Note
In certain Test modes, the device may not function as a media converter and will be limited to the functionality either stated here in the description or stated in the 802.3ch specification.
5.2. Device Register Access
5.2.1. MDIO Protocol
Most Ethernet PHYs and switches communicate using MDIO protocol (Management Data Input/Output). Using this protocol, internal registers can be accessed to configure the device as well as read information from the device such as its current configuration and status information.
Each MDIO frame is 32 bits:
2 start bits
2 bit operation code
5 bit phy address
5 bit register address
2 bit turn around delay
16 bits of data.
As Ethernet devices has evolved over the years, so has the protocol used to communicate with them. Devices in Intrepid products use either Clause 22 or Clause 45, which will be explained in the following sections.
Clause 22
The initial protocol, IEEE 802.3 Clause 22, was designed to read or write 32 registers within 32 devices. Each read/write is done in one operation.
Phy Address 5 bits (0 – 31 decimal)
Register address 5 bits (0 – 31 decimal) or (0 – 1F hex)
Data 16 bits
Page Register
Some Ethernet Phy manufacturers added a page register to allow for more registers in Clause 22. The page can be 0 – 255 decimal. If the Phy does not support pages, then page will be ignored. When using pages, reads and writes can no longer be performed in one operation. Instead you must write to the page register and then before any other process changes the page, you can read or write the destination register. If another process were to change the page register before you finish, the result will be an read the wrong register or an write to wrong register which may cause the Phy to stop working.
Common Clause 22 Registers
Clasuse 22 Registers |
Bits |
Function/Status |
|
---|---|---|---|
Control Register (Register 0) |
15 |
reset |
|
14 |
loopback |
||
12 |
auto negotiate |
||
11 |
power down |
||
10 |
isolate |
||
9 |
renegotiate |
||
8 |
duplex |
||
7 |
collision test |
||
6/13 |
speed |
10=1000mbps |
|
01=100mbps |
|||
00=10mbps |
|||
Status Register (Register 1) |
5 |
Auto Negotiation Complete |
|
4 |
Remote Fault |
||
3 |
Auto Negotiation Capability |
||
2 |
Link Status |
||
1 |
Jabber Detect |
||
0 |
Extended Capability |
||
Phy ID Reg 1 (Register 2) |
15:0 |
OUI MSB |
|
PHY ID Reg 2 (Register 1) |
15:10 |
OUI LSB |
|
9:4 |
Model Number |
||
3:0 |
Revision Number |
Clause 45
As Ethernet Phys became more complicated and supported different speeds and connections, IEEE 802.3 Clause 45 was added. Because the Register Address is now 16 bits, each read/write takes at 2 operations. The first operation is always writing the Register Address that you want to use in the next operation. The second is the actual read or write. There is also a special read that increments the address after each read which allows you to write a starting address and then read a whole block of registers.
Port 5 bits (this is equivalent to the Phy Address)
Device 5 bits (this is similar to the page)
Register address 16 bits (this allows 65536 registers in each device)
Data 16 bits
Common Clause 45 Registers
PMA/PMD Registers
Device |
Register |
Bits |
Function/Status |
||
Control Register |
1 |
0 |
15 |
reset |
|
11 |
power down |
||||
6/13 |
speed (10-1000mbps) |
11=Speed set by bits 5:2 |
|||
10=1000mbps |
|||||
01=100mbps |
|||||
00=10mbps |
|||||
5:2 |
speed (2.5-10 Gbps) |
0111=5 Gbps |
|||
0110=2.5 Gbps |
|||||
0000=10 Gbps |
|||||
Device ID Reg 1 |
1 |
2 |
15:0 |
Auto Negotiation Complete |
|
Device ID Reg 2 |
1 |
3 |
15:10 |
OUI LSB |
|
9:4 |
Model Number |
||||
3:0 |
Revision Number |
PCS Registers
Device |
Register |
Bits |
Function/Status |
||
---|---|---|---|---|---|
Control Register |
3 |
0 |
15 |
reset |
|
14 |
loopback |
||||
11 |
power down |
||||
6/13 |
speed |
10=1000mbps |
|||
01=100mbps |
|||||
00=10mbps |
|||||
Device ID Reg 1 |
3 |
2 |
15:0 |
Auto Negotiation Complete |
|
Device ID Reg 2 |
3 |
3 |
15:10 |
OUI LSB |
|
9:4 |
Model Number |
||||
3:0 |
Revision Number |
5.2.2. Using MDIO with Intrepid Products
Now that the two relevant variants of the MDIO protocol are understood, reading and writing registers requires the following information.
MDIO protocols supported by each port of your hardware are listed in the table below.
MDIO Addresses of the device: In many cases, there can be multiple MDIO busses in a system. Therefore, in addition to the address of the device, it is necessary to know which MDIO bus is used to communicate with it. The device addresses and their corresponding MDIO Bus Index can be found in the table below.
Register Information: Most devices support the common register addresses listed earlier in this section. However, there are many other manufacturer-specific registers that can be useful. This information is usually found in the manufacturer’s data sheet. It is often confidential and requirements and NDA (Non Disclosure Agreement) with the manufacturer.
MDIO Address Table
RAD-Moon3 MDIO Addresses
The MDIO addressing for the RAD-Moon3 is as follows.
Device |
Port |
MDIO Bus Index |
PHY Address |
Protocol |
RAD-Moon3 |
MultiGBASE-T1 |
0x0 |
0x00 |
Clause45 |
MultiGBASE-T |
0x0 |
0x10 |
5.2.3. Using MDIO in Vehicle Spy 3
Coming Soon!
5.2.4. Using MDIO with Intrepid’s Open Source API
libicsneo is the Intrepid Control Systems cross-platform device communication library.
Installation and usage documentation can be found within each of the respective APIs.
C++ MDIO Example:
The following code block is an example of writing and reading to a register using the C++ API .
// We can transmit messages to write to arbitrary register
std::cout << "\tTransmitting a MDIO request to write register on 88Q2112...\n";
mdio_r = std::make_shared<icsneo::MDIOMessage>();
mdio_r->network = icsneo::Network::NetID::MDIO1;
mdio_r->phyAddress = 0x06u;
mdio_r->devAddress = 0x01u;
mdio_r->regAddress = 0x0902u;
mdio_r->data = {0xA3, 0x02};
mdio_r->direction = icsneo::MDIOMessage::Direction::Write;
mdio_r->clause = icsneo::MDIOMessage::Clause::Clause45;
ret = device->transmit(mdio_r); // This will return false if the device does not support MDIO
std::cout << (ret ? "OK" : "FAIL") << std::endl;
// We can transmit messages to read back to arbitrary register
std::cout << "\tTransmitting a MDIO request to read register on 88Q2112...\n";
mdio_r = std::make_shared<icsneo::MDIOMessage>();
mdio_r->network = icsneo::Network::NetID::MDIO1;
mdio_r->phyAddress = 0x06u;
mdio_r->devAddress = 0x01u;
mdio_r->regAddress = 0x0902u;
mdio_r->direction = icsneo::MDIOMessage::Direction::Read;
mdio_r->clause = icsneo::MDIOMessage::Clause::Clause45;
ret = device->transmit(mdio_r); // This will return false if the device does not support MDIO
std::cout << (ret ? "OK" : "FAIL") << std::endl;
An complete example of how to use MDIO through the C++ API can be found here: MDIO C++ Example
Python MDIO Example:
The following code block is an example of writing and reading to a register using the Python API .
import icsneopy
a = icsneopy.MDIOMessage()
a.network = icsneopy.Network(icsneopy.Network.NetID.MDIO1)
a.phyAddress = 0x00
a.regAddress = 0x02
a.direction = icsneopy.MDIOMessage.Direction.Read
a.clause = icsneopy.MDIOMessage.Clause.Clause22
dev.transmit(a)
b = icsneopy.MDIOMessage()
b.network = icsneopy.Network(icsneopy.Network.NetID.MDIO1)
b.phyAddress = 0x00
b.regAddress = 0x18
b.direction = icsneopy.MDIOMessage.Direction.Write
b.clause = icsneopy.MDIOMessage.Clause.Clause22
dev.transmit(b)
C MDIO Example
Coming Soon!
5.2.5. Vehicle Spy’s PHY Dashboard
PHY Dashboard is a feature of Vehicle Spy 3 allowing simple device register reads and writes using MDIO.
Opening the PHY Dashboard
The PHY Dashboard can be opened from the Embedded Tools menu in Vehicle Spy (shown below)
PHY Dashboard Interface
Add – use this button to add MDIO operations. Ctrl-S saves screen contents to VS3 file.
Delete – deletes the currently selected item or item.
Delete All – deletes all operations
Read One Time – performs all reads from the list once. No writes are performed.
Write One Time – performs all writes from the list once. No reads are performed.
All One Time – performs every item in the list once.
Send Selected – performs only the selected item or items once.
Start Monitor – performs all reads once per second.
Stops Monitor – stops the monitor operation.
Note: all values in Hex except Phy Address/Port
PHY Dashboard Examples
Clause 22 Example:
Line 1 writes soft reset to phy address 16, using Clause 22
Line 2 reads Phy ID Reg1 from phy address 16 using Clause 22
Line 3 reads Phy ID Reg2 from phy address 16 using Clause 22
Clause 45 Example:
Line 1 writes soft reset of PCS to Port 16, Device 3 using Clause 45
Line 2 reads PCS ID Reg1 from Port 16, Device 3 using Clause 45
Line 3 reads PCS ID Reg2 from Port 16, Device 3 using Clause 45
MDIO Addresses for your hardware
Reference this MDIO address table for the addresses specific to your hardware.
5.3. MACsec
MACsec (802.1AE) is a Layer 2 protocol that can ensure data integrity and authenticity, as well as data encryption. The OPEN Alliance TC17 has drafted the MACsec Automotive Profile to adapt the broad standards of 802.1AE to automotive applications.
The use and operation of MACsec is well beyond the scope of this guide, but many Intrepid products contain Automotive Ethernet PHYs with MACsec support. This guide explains the different way of loading MACsec configurations and keys into the Automotive Ethernet PHY.
5.3.1. Intrepid Devices Supporting MACsec
The MACsec configuration of a PHY is contained in a yaml file that is sent to the PHY Using Vehicle Spy or one of Intrepid’s API. (Examples follow) The following table contains the information needed to address the PHY using the API.
Product |
Serial # |
Port |
netid |
config_netid |
RAD-Moon2_zl |
RNxxxx |
100/1000BASE-T1 |
NETID_OP_ETHERNET1 |
NETID_MDIO_01 |
RAD-Moon3 |
R3xxxx |
100/1000BASE-T1 |
NETID_OP_ETHERNET1 |
NETID_MDIO_01 |
RAD-Comet2 |
RCxxxx |
AE01 |
NETID_OP_ETHERNET1 |
NETID_MDIO_02 |
|
GSxxxx |
SFP1 |
NETID_ETHERNET |
NETID_I2C1 |
SFP2 |
NETID_ETHERNET2 |
NETID_I2C2 |
||
RAD-Galaxy2 |
AE01 |
|||
AE02 |
||||
AE03 |
||||
AE04 |
||||
AE05 |
||||
AE06 |
||||
AE07 |
||||
AE08 |
||||
AE09 |
||||
AE10 |
||||
AE11 |
||||
AE12 |
||||
AE13 |
||||
AE14 |
||||
AE15 |
||||
AE16 |
5.3.2. Configuring MACsec in Vehicle Spy 3
In Development
5.3.3. Configuring MACsec using Intrepid’s Open Source API
libicsneo is the Intrepid Control Systems device communication library.
Installation and usage documentation can be found within each of the respective APIs.
MACsec C++ API
Coming Soon!
MACsec Python API
Coming Soon!
MACsec C API
Coming Soon!
5.3.4. Configuring MACsec in using python_ics
Python Installation
pip install python_ics pyyaml
Usage
ics_load_macsec.py [-h] [--yaml YAML] --port PORT [--reset] serial_number
serial_number
The serial number of the device to configure.
options
Option |
Descrition |
Default Value |
-h, –help |
show this help message and exit |
|
–yaml YAML |
filename of yaml configuration to be loaded (Assumes .yml is located in “/yaml/” directory) |
test_macsec_Rule_wildcard_SecY_128_strip_strict_sci_SA_sak0.yml |
–port PORT |
‘config_netid’ - network ID for the port configuration network. |
config_netid = NETID_I2C2 |
‘netid’ - network ID for the port network. |
netid = NETID_OP_ETHERNET1 |
|
–reset |
Reset and clear and disable MACsec on the device, then exit; yaml configuration ignored |
FALSE |
Example Command Lines
RAD-Comet2/3:
python ics_load_macsec.py Rxxxxx --port "{'netid':NETID_OP_ETHERNET1,'config_netid':NETID_MDIO_02}" --yaml "test_sfp_macsec_Rule_wildcard_SecY_128_strip_strict_sci_SA_sak0.yml"
RAD-Moon2_zl:
python ics_load_macsec.py RNxxxx --port "{'netid':NETID_OP_ETHERNET1,'config_netid':NETID_MDIO_01}" --yaml "test_sfp_macsec_Rule_wildcard_SecY_128_strip_strict_sci_SA_sak0.yml"
RAD-Moon3:
python ics_load_macsec.py R3xxxx --port "{'netid':NETID_OP_ETHERNET1,'config_netid':NETID_MDIO_01}" --yaml "test_sfp_macsec_Rule_wildcard_SecY_128_strip_strict_sci_SA_sak0.yml"
RAD-Gigastar Port1 with SFP-MV2221M:
python ics_load_macsec.py GSxxxx --port "{'netid':NETID_ETHERNET,'config_netid':NETID_I2C2}" --yaml "test_sfp_macsec_Rule_wildcard_SecY_128_strip_strict_sci_SA_sak0.yml"
RAD-Gigastar Port2 with SFP-MV2221M:
python ics_load_macsec.py GSxxxx --port "{'netid':NETID_ETHERNET2,'config_netid':NETID_I2C3}" --yaml "test_sfp_macsec_Rule_wildcard_SecY_128_strip_strict_sci_SA_sak0.yml"