Published On: May, 24, 2019 By: Eshtaartha Basu
The Texas Instruments AM335x processor used in the OSD335x Family of System in Package Devices supports up to two independent Gigabit Ethernet ports (10/100/1000 Mbps). This application note will help you quickly get started interfacing an Ethernet PHY with the OSD335x, the AM335x System in Package, Family of Devices. This document will showcase reference designs, which can be used as design examples, make recommendations on layout, device trees and provide tips on debugging AM335x Ethernet issues.
Get updates to this application note and all of our documentation
"*" indicates required fields
1.Introduction
2.Choosing the Right PHY
2.1.1Reference Designs
2.1.2Additional Ethernet PHYs
3.Design Example / Recommendations
3.1Schematics
3.2Layout
3.2.1Dual Ethernet Example
4.Setting up Ethernet (Device Tree)
5.Debugging Tips
5.1Software Issues
5.2MAC to PHY Connections
5.3PHY to RJ45 Port Connections
5.4Data Errors
6.Revision History of this Document
A PDF version of this App Note can be found here.
The AM335x processor within the OSD335x, the AM335x System in Package, Family of Devices contains two Ethernet MAC (Medium Access Control) peripherals that can be used independently or together with an integrated switch. Each MAC supports MII, RMII, RGMII and MDIO interfaces that can be used to connect to an Ethernet PHY (Physical Layer), which in turn is connected to an Ethernet port. This allows Ethernet cables to connect the AM335x to the rest of the network.
Ethernet PHYs are available from many different manufacturers and have a wide range of features. The most significant features to consider when choosing an Ethernet PHY are:
Reference Designs using the AM335x Ethernet with different PHYs are listed below so that you can choose the best fit for your requirements and jump-start your design.
Below is a list of additional Ethernet PHYs from major manufacturers. This is not a comprehensive list but can be used in case there are issues with availability of the PHYs in the reference designs listed above.
For any PHY selection, we strongly recommend that you can purchase the part through a major distributor, such as DigiKey or Mouser, and that the part has plenty of stock available.
The following figures show an example of a dual AM335x Ethernet design using the KSZ9031 Ethernet PHY to communicate with the Ethernet MAC peripherals on the OSD335x, the AM335x System in Package, Family of Devices. The figures walk through the schematics and layout. Reference design files for this design will be available in the future. Please sign up for documentation updates to be notified when they are available.
When connecting an Ethernet PHY, you need to be aware of the default PHY configuration pull-up / pull-down resistors. Most PHYs utilize a number of pins to set the initial configuration of the device, such as the PHY address on the MDIO bus. It is important that all of these configuration pins are set correctly. For example, in the figure below, you can see the pull-up / pull-down resistors on the RX and LED interfaces that will set the initial configuration of the PHY.
When creating a dual AM335x Ethernet design, it is critical that each PHY have a different MDIO address. This will allow the single MDIO bus to communicate and configure each PHY. Additionally, it is important to know the MDIO address of the PHY since that will be necessary when we set up the device tree for the Ethernet PHY.
When laying out an Ethernet PHY, there are two different sets of connections: MAC to PHY and PHY to RJ45 connector (i.e. the Ethernet port). The MAC to PHY connections for the OSD335x Family of devices uses MII, RMII or RGMII. These have a bus speed of 25 MHz, 50 MHz, 125 MHz, respectively. The PHY to RJ45 connections use differential Ethernet signaling in the 10s to 100s of MHz depending on the Ethernet speed required for the link.
The following are some general recommendations for Ethernet PHY layout design:
Avoid vias and layer changes for Ethernet traces.
On all sides, the first three rows of OSD32MP15x can be easily accessed using 5/5 traces as shown in Figure 4.
When laying out a dual AM335x Ethernet design, we recommend that you focus on careful placement and routing of a single Ethernet PHY and port. Once that Ethernet PHY and port are placed and routed to your satisfaction, the layout can be replicated easily for the second Ethernet port. You can see an example of this in the figures below when looking at both the signal routing and power layout.
By default, most Ethernet PHYs follow the IEEE 802.3 (clause 22.2.4) management register set. While each PHY will have vendor specific extensions, the standardization of the management register set means that it is straight forward to set up an Ethernet PHY within Linux to interface with the OSD335x Family of devices. In order to get Ethernet working within Linux, we must properly specify the device tree properties. This section will walk through the information necessary for the Linux device tree.
Most of the device tree declaration for the AM335x Ethernet MAC has been done in the device tree include files for the OSD335x Family of devices (osd335x-sm.dtsi and osd335x-csip.dtsi which can be found at https://github.com/octavosystems/OSD335x-Device-Tree). In the main device tree file for your board, you will need to:
Once you have properly configured your AM335x Ethernet design, you still may run into issues. Below are some tips to help debug any Ethernet problems you might encounter. In general, you want to break down the problem:
If the Ethernet peripheral and PHY declarations in the device tree are not correct, this can cause Linux to improperly or fail to load the Ethernet drivers. To understand the drivers that are loaded during Linux boot, you can use the UART0 console to view the boot messages. If the UART0 console is not available, you can also check the boot log under the “/var/log” directory.
If you get the following errors, it means that there is a mismatch between the PHY address detected by the PHY and the address specified for the phy_id. This could be a typo in the device tree or improper detection of the PHY address based on the pull-up / pull-down resistors on the PHY configuration pins.
1 2 | [ 30.050889] libphy: PHY 4a101000.mdio:04 not found [ 30.106155] net eth0: phy "4a101000.mdio:04" not found on slave 0, err -19 |
In this error message, the Ethernet PHY phy_id was set to “4” in the device tree. However, the PHY could not be detected at address “4”.
To verify the MAC to PHY connections, you can put the Ethernet PHY in loopback mode in which the PHY will route any packets received on the TX interface back to the RX interface without putting the transaction on the PHY to RJ45 port pins. To help with this, we have provided an Ethernet Loopback Test that will allow you to put the PHY in loopback mode. Please refer to the documentation in the zip file for instructions on how to use the software.
It is difficult to test the PHY to RJ45 Port connections independently. Instead, testing this relies on connecting the RJ45 Port to an Ethernet network. When an Ethernet cable is connected from the RJ45 Port to an active Ethernet network, you should see the link lights on the RJ45 connector come on as the PHY negotiates the capabilities of the network. If you do not see the link lights come on, check that the network is active and try multiple cables to see if there is a PHY to RJ45 Port connection issue or a cable issue.
Once you have verified the previous connections, if you are seeing poor performance or data errors (this can show up as TX or RX errors when viewing the Ethernet interface using ifconfig), you can do a couple of things:
Additionally, network firewalls can cause issues when testing Ethernet. Be sure that firewalls on your network or host computer are understood and configured so as not to cause issues when testing the Ethernet functionality of your design.
If you are seeing errors, it is always a good idea to re-check your schematic connections, verify the symbol to footprint mapping for your PHY, and reviewing your layout for issues. If you do have any additional questions regarding using the AM335x System in Package together with Ethernet, please feel free to search for answers and post questions on our Forums (https://octavosystems.com/forums/)
Revision Number | Revision Date | Changes | Author |
---|---|---|---|
1 | 5/23/2019 | Initial Release | E. Basu |
Octavo Systems LLC all rights reserved
OCTAVO is registered in the U.S. Patent and Trademark Office. OSD, C-SiP, and the Octavo Logo are trademarks of Octavo Systems LLC.
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields