Post Go back to editing
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PHY address does not map correctly when communicating over MDIO interface to connected PHY devices.

Thread Summary

The user encountered issues with SGMII links on a custom hardware setup using the ADIN6310 and DP83867ISR PHYs. The problem was resolved by changing the phy-pull-up-control setting to external and ensuring the switch port configuration happened before the PHY reset, which allowed the PHYs to sample the correct addresses. Additionally, the user had to disable internal delays in the MAC and enable them in the ADIN6310 for the RGMII link on Port 0. Ethernet is now working end-to-end.
AI Generated Content
Category: Software
Product Number: ADIN6310
Software Version: ADIN6310SWDR-Rel5.1.0

Hi,

Please see my previous post:  Missing files in the ADIN6310 driver software 

With reference to the post above, I can run the ses-example-app built into my imx8 linux image and configure the ADIN6310 eval board OK and ethernet traffic passes between ports.

I now have the linux running on our custom hardware which connects the imx8 processor to ADIN6310 Port 0. Ports 1 and 2 both connect to separate PHY devices (DP83867ISR), Ports 3 and 4 are routed off board( effectively unconnected for now) and Port 5 is not connected.

The interface to the on board PHYs is SGMII which can be seen reflected in my config xml below .

<!-- 6310 HARDWARE SETUP -->
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
            xmlns:sched="urn:ieee:std:802.1Q:yang:ieee802-dot1q-sched"
      xmlns:ses="urn:adi:ses">
  <interface>
    <name>P0</name>
    <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
    <ethernet xmlns="urn:ieee:std:802.3:yang:ieee802-ethernet-interface">
      <if-type xmlns="urn:adi:ses">rgmii</if-type>
      <phy-rx-delay-supported xmlns="urn:adi:ses">false</phy-rx-delay-supported>
      <phy-tx-delay-supported xmlns="urn:adi:ses">false</phy-tx-delay-supported>
      <phy-type xmlns="urn:adi:ses">unmanaged</phy-type>
      <clock-selection xmlns="urn:adi:ses">internal</clock-selection>
      <phy-address xmlns="urn:adi:ses">10</phy-address>
      <link-polarity xmlns="urn:adi:ses">active-low</link-polarity>
      <phy-pull-up-control xmlns="urn:adi:ses">internal</phy-pull-up-control>
      <duplex>full</duplex>
      <speed>1</speed>
    </ethernet>
  </interface>

  <interface>
    <name>P1</name>
    <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
    <ethernet xmlns="urn:ieee:std:802.3:yang:ieee802-ethernet-interface">
      <if-type xmlns="urn:adi:ses">sgmii</if-type>
      <phy-rx-delay-supported xmlns="urn:adi:ses">false</phy-rx-delay-supported>
      <phy-tx-delay-supported xmlns="urn:adi:ses">false</phy-tx-delay-supported>
      <phy-type xmlns="urn:adi:ses">unmanaged</phy-type>
      <clock-selection xmlns="urn:adi:ses">internal</clock-selection>
      <phy-address xmlns="urn:adi:ses">0</phy-address>
      <link-polarity xmlns="urn:adi:ses">active-high</link-polarity>
      <phy-pull-up-control xmlns="urn:adi:ses">internal</phy-pull-up-control>
      <duplex>full</duplex>
      <speed>1</speed>
    </ethernet>
  </interface>

  <interface>
    <name>P2</name>
    <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
    <ethernet xmlns="urn:ieee:std:802.3:yang:ieee802-ethernet-interface">
      <if-type xmlns="urn:adi:ses">sgmii</if-type>
      <phy-rx-delay-supported xmlns="urn:adi:ses">false</phy-rx-delay-supported>
      <phy-tx-delay-supported xmlns="urn:adi:ses">false</phy-tx-delay-supported>
      <phy-type xmlns="urn:adi:ses">unmanaged</phy-type>
      <clock-selection xmlns="urn:adi:ses">internal</clock-selection>
      <phy-address xmlns="urn:adi:ses">1</phy-address>
      <link-polarity xmlns="urn:adi:ses">active-high</link-polarity>
      <phy-pull-up-control xmlns="urn:adi:ses">internal</phy-pull-up-control>
      <duplex>full</duplex>
      <speed>1</speed>
    </ethernet>
  </interface>

  <interface>
    <name>P3</name>
    <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
    <ethernet xmlns="urn:ieee:std:802.3:yang:ieee802-ethernet-interface">
      <if-type xmlns="urn:adi:ses">sgmii-1000base-kx</if-type>
      <phy-rx-delay-supported xmlns="urn:adi:ses">false</phy-rx-delay-supported>
      <phy-tx-delay-supported xmlns="urn:adi:ses">false</phy-tx-delay-supported>
      <phy-type xmlns="urn:adi:ses">unmanaged</phy-type>
      <clock-selection xmlns="urn:adi:ses">internal</clock-selection>
      <phy-address xmlns="urn:adi:ses">2</phy-address>
      <link-polarity xmlns="urn:adi:ses">active-high</link-polarity>
      <phy-pull-up-control xmlns="urn:adi:ses">internal</phy-pull-up-control>
      <duplex>full</duplex>
      <speed>1</speed>
    </ethernet>
  </interface>

  <interface>
    <name>P4</name>
    <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
    <ethernet xmlns="urn:ieee:std:802.3:yang:ieee802-ethernet-interface">
      <if-type xmlns="urn:adi:ses">sgmii-1000base-kx</if-type>
      <phy-rx-delay-supported xmlns="urn:adi:ses">false</phy-rx-delay-supported>
      <phy-tx-delay-supported xmlns="urn:adi:ses">false</phy-tx-delay-supported>
      <phy-type xmlns="urn:adi:ses">unmanaged</phy-type>
      <clock-selection xmlns="urn:adi:ses">internal</clock-selection>
      <phy-address xmlns="urn:adi:ses">3</phy-address>
      <link-polarity xmlns="urn:adi:ses">active-high</link-polarity>
      <phy-pull-up-control xmlns="urn:adi:ses">internal</phy-pull-up-control>
      <duplex>full</duplex>
      <speed>1</speed>
    </ethernet>
  </interface>

  <!-- Unused, but it needs them defined, so leave as rgmii-->
  <interface>
    <name>P5</name>
    <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
    <ethernet xmlns="urn:ieee:std:802.3:yang:ieee802-ethernet-interface">
      <if-type xmlns="urn:adi:ses">rgmii</if-type>
      <phy-rx-delay-supported xmlns="urn:adi:ses">false</phy-rx-delay-supported>
      <phy-tx-delay-supported xmlns="urn:adi:ses">false</phy-tx-delay-supported>
      <phy-type xmlns="urn:adi:ses">unmanaged</phy-type>
      <clock-selection xmlns="urn:adi:ses">internal</clock-selection>
      <phy-address xmlns="urn:adi:ses">4</phy-address>
      <link-polarity xmlns="urn:adi:ses">active-high</link-polarity>
      <phy-pull-up-control xmlns="urn:adi:ses">internal</phy-pull-up-control>
      <duplex>full</duplex>
      <speed>1</speed>
    </ethernet>
  </interface>
</interfaces>

<!-- HOST MAC ADDRESS SETUP -->
<ses xmlns="urn:adi:ses">
  <host-setup>
    <smp-mac-address>7A-C6-BB-11-11-11</smp-mac-address>
  </host-setup>
</ses>

The ADIN6310 configures successfully using the example app but currently the interface is not working. I have good indication that the imx8 to ADIN6310 interface is happy and also the electrical side of the PHY to connected PC which has a positive link state. So I am investigating the SGMII link from ADIN6310 Port 1 to the first PHY device. To get some information about this link I added a status option to the example app which reads some of the PHY registers over the MDIO interface. Here is a snippet of the code I added: 

if (printLinkStatus)
  {
    int p;
    int reg;
    uint16_t val;
    SES_phyConfig_t phyConfig;

      for (p = 1; p <= portCount; p++) {
      rv = SES_GetLinkState((SES_mac_t)p);

      if (rv < 0)
          printf("Port %d : ERROR (%d)\n", p, rv);
      else
          printf("Port %d : %s\n",
                p,
                rv ? "UP" : "DOWN");


      memset(&phyConfig, 0, sizeof(phyConfig));
      rv = SES_GetPhyConfig((SES_mac_t)p, &phyConfig, sizeof(phyConfig));

      //printf(" rv=%d\n", rv);
      //printf(" type=%d\n", phyConfig.type);
      //printf(" speed=%d\n", phyConfig.speed);
      //printf(" duplex=%d\n", phyConfig.duplexMode);
      //printf(" autoneg=%d\n", phyConfig.autoNegEnable);

      for (reg = 0; reg < 8; reg++) {
        rv = SES_ReadPhyReg((SES_mac_t)p, reg, &val);

        if (rv == SES_OK)
          printf("PHY reg %d = 0x%04x\n", reg, val);
        else
          printf("PHY reg %d read failed (%d)\n", reg, rv);
      }

    }
    
    SES_RemoveHwInterface(interfaceId);
    return 0;
  }

This printed the following (port numbering offset because I believe port 0 is defined as SES_macPrimary): 


Init with device on: /dev/spidev3.2 ready_pin:/dev/gpiochip1:12 speed:5000000
Port 1 : UP
rv=0
type=3
speed=2
duplex=1
autoneg=1
PHY reg 0 = 0xffff
PHY reg 1 = 0xffff
PHY reg 2 = 0xffff
PHY reg 3 = 0xffff
PHY reg 4 = 0xffff
PHY reg 5 = 0xffff
PHY reg 6 = 0xffff
PHY reg 7 = 0xffff
Port 2 : UP
rv=0
type=3
speed=2
duplex=1
autoneg=1
PHY reg 0 = 0xffff
PHY reg 1 = 0xffff
PHY reg 2 = 0xffff
PHY reg 3 = 0xffff
PHY reg 4 = 0xffff
PHY reg 5 = 0xffff
PHY reg 6 = 0xffff
PHY reg 7 = 0xffff
Port 3 : DOWN
rv=0
type=3
speed=2
duplex=1
autoneg=1
PHY reg 0 = 0xffff
PHY reg 1 = 0xffff
PHY reg 2 = 0xffff
PHY reg 3 = 0xffff
PHY reg 4 = 0xffff
PHY reg 5 = 0xffff
PHY reg 6 = 0xffff
PHY reg 7 = 0xffff
Port 4 : DOWN
rv=0
type=3
speed=2
duplex=1
autoneg=1
PHY reg 0 = 0xffff
PHY reg 1 = 0xffff
PHY reg 2 = 0xffff
PHY reg 3 = 0xffff
PHY reg 4 = 0xffff
PHY reg 5 = 0xffff
PHY reg 6 = 0xffff
PHY reg 7 = 0xffff
Port 5 : DOWN
rv=0
type=3
speed=2
duplex=1
autoneg=1
PHY reg 0 = 0xffff
PHY reg 1 = 0xffff
PHY reg 2 = 0xffff
PHY reg 3 = 0xffff
PHY reg 4 = 0xffff
PHY reg 5 = 0xffff
PHY reg 6 = 0xffff
PHY reg 7 = 0xffff
Port 6 : UP
rv=0
type=3
speed=2
duplex=1
autoneg=1
PHY reg 0 = 0x1140
PHY reg 1 = 0x7949
PHY reg 2 = 0x2000
PHY reg 3 = 0xa231
PHY reg 4 = 0x01e1
PHY reg 5 = 0x0000
PHY reg 6 = 0x0066
PHY reg 7 = 0x2001

The register reads on Port 5(shown as port 6) match the expected values of the PHY connected to Port1 - I confirmed this by controlling the power down signal and see the relevant bit changed state in these register reads.

I do not understand why this is not reported on the right port and where my second PHY is. I believed my 2 phy devices are boot strapped to set the PHY address to 0x0 and 0x1, but currently seeing on Port 5 where address is 0x4. I have experimented with phy address in config xml but I can  not get the PHY to change to any other port. But any other value on Port 5 does revert the register reads to all 0xffff.

I wondered about trying new example code and firmware as I see there is a 6.0.1 release, but I can not find the library source code or even details of what the changes are. In fact,  I now can't find the download for the 5.1.0 source code I previously obtained!

Any input/advice you have would be gratefully received.

Many Thanks

Steve

Edit Notes


[locked by: CatherineR at 1:20 PM (GMT -4) on 29 Sep 2026]
  • Hi Steve,

    Thanks for message. 

    I have added you to our software distribution list and shared an email update with key changes. Additionally, you will be able to see the older release in your myanalog account and look in Resources->Software Downloads, you should see the older TSN driver library 5.1.0-GA release now (look for the file with SWDR in naming). 

    The release note document contained in the doc folder for each release. 

    When you say you can not find the library source for 6.0.1-GA, did you download the TSN driver library located here: ADIN6310 Datasheet and Product Info | Analog Devices

    in your configuration, please change the phy-pull-up-control to external

          <phy-pull-up-control xmlns="urn:adi:ses">internal</phy-pull-up-control>

    The switch has internal pulls on the RXD lines and can provide unique PHY addresses for ADIN1200/ADIN1300 PHYs per port. This does not necessarily work well for other PHYs. Changing this parameter to external will disable the internal pulls and allow the PHYs sample the addressing you have configured with external resistors. Please note that in order for this to work properly, you will need to ensure the switch port configuration happens first and only then does the PHY come out of reset (so it samples the correct thing). Note that between 5.1-0GA and 6.0.1-GA there is a change in how the Px_RSTN lines are driven. In 6.0.1-GA they are actively driven low when the host starts the switch config, therefore if Px_RSTN is routed to your PHY reset, it will hold the PHY in reset, switch disables internal pulls and only then brings PHY out of reset. (this all depends on how you have connected things in your schematic though).

    In 5.1.0-GA, the switch was not actively driving the Px_RSTN lines low, so the PHY could already be out of reset. Implications then are it samples the wrong PHY address. Hope this makes sense and helps you progress. Let us know if it resolves or if further questions, 

    best regards,

    Catherine. 

  • Hi Catherine,

    Thanks so much for the fast response.

    I was just looking on the device page for the TSN library and just found the link which downloaded a .exe! Anyway I received you emails and was able to download the .zip for the latest version. I shall wait till later to decide if I need to migrate to the newer version or not, but for now I shall try out what you have suggested with the pull-up setting. I will update later when I have done some testing.

    Not mentioned before but we do have a second AD6310 on board connected to 3 different PHY devices (DP83TG720a-Q1). I was leaving that whole path to later to investigate but thought I'd better try it as a comparison. Looks like it might behaving a bit better, but a bit early to tell.

    I shall update accordingly when I have more.

    Cheers

    Steve

  • Hi Steve,

    The TSN library link is wrapped into an installer - only for purpose of including a click-through licence. Once you uninstalled, you would have the same content as in the other link with the zip file. 

    Let us know how you get on.

    Best regards,

    Catherine. 

  • Made some progress, looking at the reset between the ADIN6310 and connect PHY it seemed there was contention between internal pull ups in one device and pull downs in the other and our external pull down was not strong enough to register a clean reset and hence boot strap the right phy addresses. Now resolved, my MDIO register reads are appearing for both PHYs on the expected ports :-)

    Now I shall carry on testing the full chain and working to get the various links up and running.

  • Good to hear, thanks for the update Steve, good luck with rest of bring-up of hardware. 

    best regards,

    Catherine.

  • Hi Catherine,

    I now have ethernet working from end-to-end. Needed to make sure internal delays were turned off in MAC but included in the ADIN6310 config for the Port 0 RGMII link.

    PLease feel free to close this case.

    Thanks for your help

    Steve

  • Thanks for update Steve, glad to hear everything is working for you now. Let us know if further support needed. I will close this case. 

    best regards,

    Catherine. 

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.