DP83869HM: DP83869HM SGMII-to-RGMII Bridge Mode Configuration

Part Number: DP83869HM
Other Parts Discussed in Thread: DP83869

Tool/software:

Hello,

I am working on J784S4 with Processor SDK Linux 09.02.00.05.In our design the DP83869HM PHY is used as a bridge where

  • SGMII is connected to the CPSW MAC (J784S4 SerDes2),
  • RGMII is connected to an external PHY (ADIN1100).

My current DTS configuration looks like this

  • &serdes_wiz2 {
    status = "okay";
    };

    &serdes2 {
    status = "okay";
    #address-cells = <1>;
    #size-cells = <0>;
    serdes2_sgmii_link: phy@0 {
    reg = <0>; // lane index
    cdns,num-lanes = <1>;
    cdns,phy-type = <PHY_TYPE_SGMII>;
    #phy-cells = <0>;
    resets = <&serdes_wiz2 1>;
    };
    };


    &main_cpsw0 {
    status = "okay";

    };

    &main_cpsw0_mdio {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&main_cpsw9x1_pins_default>;
    pinctrl-1 = <&main_pmx_gpio_vddshv20_pins_default>; 

    main_phy3: ethernet-phy@3 {
    reg = <3>;// DP83869 address
    ti,op-mode = <DP83869_RGMII_SGMII_BRIDGE>;

    };
    adin1100: ethernet-phy@0 {
    reg = <0>; // ADIN1100 behind DP83869
    phy-mode = "rgmii";
    };
    };

    &main_cpsw0_port5 {
    status = "okay";
    phy-mode = "sgmii";
    phy-handle = <&main_phy3>;
    phys = <&cpsw0_phy_gmii_sel 5>, <&serdes2_sgmii_link>;
    phy-names = "mac", "serdes";
    };

    &serdes_ln_ctrl {
    idle-states = <J784S4_SERDES0_LANE0_PCIE1_LANE0>, <J784S4_SERDES0_LANE1_PCIE1_LANE1>,
    <J784S4_SERDES0_LANE2_IP3_UNUSED>, <J784S4_SERDES0_LANE3_USB>,
    <J784S4_SERDES1_LANE0_PCIE0_LANE0>, <J784S4_SERDES1_LANE1_PCIE0_LANE1>,
    <J784S4_SERDES1_LANE2_PCIE0_LANE2>, <J784S4_SERDES1_LANE3_PCIE0_LANE3>,
    <J784S4_SERDES2_LANE0_QSGMII_LANE5>,<J784S4_SERDES2_LANE2_QSGMII_LANE1>, <J784S4_SERDES2_LANE3_QSGMII_LANE2>;
    };

In the DP83869 driver (dp83869.c), when DP83869_RGMII_SGMII_BRIDGE is selected, it writes:

ret = phy_modify_mmd(phydev, DP83869_DEVADDR, DP83869_OP_MODE,
DP83869_SGMII_RGMII_BRIDGE,
DP83869_SGMII_RGMII_BRIDGE);

From the datasheet (section 7.6.1.122, OP_MODE_DECODE Register):

  • Bit 6 = 0 → SGMII to RGMII bridge ( intended mode)

  • Bit 6 = 1 → RGMII to SGMII bridge

So my questions are:

  1. Is my DTS configuration sufficient to bring up SGMII→RGMII bridge mode?

  2. Do I need to add any extra properties (like internal delays, FIFO depth, etc.) in the DTS for this bridge mode?

  3. Since the driver currently sets Bit 6 = 1, is there an additional DTS flag or config needed to make it work for SGMII→RGMII?

Currently the link is not coming up on the ADIN1100 side

Thanks,

Apuroop Kumar.

  • Hello,

    As you are dealing with a bridge application, it would be important to ensure that the ADI PHY is having link so it can properly output 125MHz RGMII to DP83869. As the SGMII is waiting for clarification from the RGMII portion to dictate speed, the ADI PHY needs to be configured properly. I don't believe internal delays are necessary, but may be optimal to get the RGMII interface working depending on layout of your board.

    Sincerely,

    Gerome

  • Hi,

    With the below dts setup:

    &serdes_wiz2 {
    status = "okay";
    };

    &serdes2 {
    status = "okay";
    #address-cells = <1>;
    #size-cells = <0>;
    serdes2_sgmii_link: phy@0 {
    reg = <0>; // lane index
    cdns,num-lanes = <1>;
    cdns,phy-type = <PHY_TYPE_SGMII>;
    #phy-cells = <0>;
    resets = <&serdes_wiz2 1>;
    };
    };

    &main_cpsw0 {
    status = "okay";
    };

    &main_cpsw0_mdio {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&main_cpsw9x1_mdio_pins_default>;
    pinctrl-1 = <&main_pmx_gpio_vddshv20_pins_default>; //not needed for ADIN1100?

    /* DP83869 Bridge PHY - Connected to CPSW SGMII port */
    bridge_phy: ethernet-phy@3 {
    reg = <3>;// DP83869 address
    ti,op-mode = <DP83869_RGMII_SGMII_BRIDGE>;
    };

    /* ADIN1100 - Connected via RGMII to DP83869 bridge */
    adin1100: ethernet-phy@0 {
    reg = <0>; // ADIN1100 behind DP83869
    phy-mode = "rgmii-rxid";
    };
    };

    &main_cpsw0_port5 {
    status = "okay";
    phy-mode = "sgmii";
    phy-handle = <&bridge_phy>;
    phys = <&cpsw0_phy_gmii_sel 5>, <&serdes2_sgmii_link>;
    phy-names = "mac", "serdes";
    };

    &serdes_refclk {
    clock-frequency = <100000000>;
    };

    Below are the observed outputs:

    • root@j784s4-evm:/opt/edgeai-gst-apps# dmesg | grep dp83869 
    • [    1.438552] dp83869: entered in dp83869_probe 
    • [    1.438555] dp83869: entered in dp83869_of_init 
    • [    1.439389] dp83869: TX internal delay from DT: 0 ps 
    • [    1.444343] dp83869: entered in dp83869_config_init 
    • [    1.444759] dp83869: entered in dp83869_configure_mode 
    • [    1.445792] dp83869: mode=3 entered RGMII_SGMII_BRIDGE in dp83869_configure_mode 
    • [    1.447449] dp83869: entered in dp83869_config_port_mirroring 
    • [    1.448276] dp83869: entered in dp83869_config_intr 
    • [    1.448485] dp83869: entered in dp83869_ack_interrupt 
    • [    1.974628] dp83869: entered in dp83869_probe 
    • [    1.974632] dp83869: entered in dp83869_of_init 
    • [    1.975465] dp83869: TX internal delay from DT: 0 ps 
    • [    1.980418] dp83869: entered in dp83869_config_init 
    • [    1.980629] dp83869: entered in dp83869_configure_mode 
    • [    1.981663] dp83869: mode=3 entered RGMII_SGMII_BRIDGE in dp83869_configure_mode 
    • [    1.983315] dp83869: entered in dp83869_config_port_mirroring 
    • [    1.984142] dp83869: entered in dp83869_config_intr 
    • [    1.984351] dp83869: entered in dp83869_ack_interrupt 
    • [    8.240081] dp83869: entered in dp83869_phy_reset 
    • [    8.246246] dp83869: entered in dp83869_config_init 
    • [    8.256855] dp83869: entered in dp83869_configure_mode 
    • [    8.269766] dp83869: mode=3 entered RGMII_SGMII_BRIDGE in dp83869_configure_mode 
    • [    8.279726] dp83869: entered in dp83869_config_port_mirroring 
    • [    8.291065] dp83869: entered in dp83869_config_init 
    • [    8.291276] dp83869: entered in dp83869_configure_mode 
    • [    8.292310] dp83869: mode=3 entered RGMII_SGMII_BRIDGE in dp83869_configure_mode 
    • [    8.293962] dp83869: entered in dp83869_config_port_mirroring 
    • [    8.294793] dp83869: entered in dp83869_config_intr 
    • [    8.295004] dp83869: entered in dp83869_ack_interrupt 
    • [    8.297124] dp83869: entered in dp83869_read_status 
    • [    9.342235] dp83869: entered in dp83869_read_status 
    • [   10.366232] dp83869: entered in dp83869_read_status 
    • [   11.394236] dp83869: entered in dp83869_read_status 
    • [   12.414237] dp83869: entered in dp83869_read_status 
    • [   13.438235] dp83869: entered in dp83869_read_status 
    • [   14.462236] dp83869: entered in dp83869_read_status 
    • [  160.894216] dp83869: entered in dp83869_read_status 
    • [  161.918217] dp83869: entered in dp83869_read_status 
    • Checked  INTERRUPT_STATUS Register (Offset = 13h) using phytool 
    • root@j784s4-evm:/opt/edgeai-gst-apps# phytool write eth1/0x03/0x0D 0x001F 
    • root@j784s4-evm:/opt/edgeai-gst-apps# phytool write eth1/0x03/0x0E 0x0013 
    • root@j784s4-evm:/opt/edgeai-gst-apps# phytool write eth1/0x03/0x0D 0x401F 
    • root@j784s4-evm:/opt/edgeai-gst-apps# phytool read  eth1/0x03/0x0E 
    • 0x0040 
    • root@j784s4-evm:/opt/edgeai-gst-apps#  
    •  Bit 6 set ---->MDI crossover has changed  
    • Still link is down.
    • With the below dts setup:
    • &serdes_wiz2 {
      status = "okay";
      };

      &serdes2 {
      status = "okay";
      #address-cells = <1>;
      #size-cells = <0>;
      serdes2_sgmii_link: phy@0 {
      reg = <0>; // lane index
      cdns,num-lanes = <1>;
      cdns,phy-type = <PHY_TYPE_SGMII>;
      #phy-cells = <0>;
      resets = <&serdes_wiz2 1>;
      };
      };


      &main_cpsw0 {
      status = "okay";
      };

      &main_cpsw0_mdio {
      status = "okay";
      pinctrl-names = "default";
      pinctrl-0 = <&wtx_main_cpsw9x1_mdio_pins_default>;


      /* DP83869 Bridge PHY - Connected to CPSW SGMII port */
      bridge_phy: ethernet-phy@3 {
      reg = <3>;// DP83869 address
      ti,op-mode = <DP83869_RGMII_SGMII_BRIDGE>;
      };

      /* ADIN1100 - Connected via RGMII to DP83869 bridge */
      adin1100: ethernet-phy@0 {
      reg = <0>; // ADIN1100 behind DP83869
      };
      };

      &main_cpsw0_port5 {
      status = "okay";
      phy-mode = "rgmii-id";
      phy-handle = <&adin1100>;
      phys = <&cpsw0_phy_gmii_sel 5>, <&serdes2_sgmii_link>;
      phy-names = "mac", "serdes";

      };

      Here are the observed outputs:

    • root@j784s4-evm:/opt/edgeai-gst-apps# dmesg | grep cpsw 
    • [    1.342481] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA02102, cpsw version 0x6BA82102 Ports: 2 quirks:00000000 
    • [    1.355336] am65-cpsw-nuss 46000000.ethernet: initialized cpsw ale version 1.4 
    • [    1.362543] am65-cpsw-nuss 46000000.ethernet: ALE Table size 64 
    • [    1.372846] am65-cpsw-nuss 46000000.ethernet: CPTS ver 0x4e8a010b, freq:500000000, add_val:1 pps:1 
    • [    1.461252] am65-cpsw-nuss c000000.ethernet: initializing am65 cpsw nuss version 0x6BA03102, cpsw version 0x6BA82902 Ports: 9 quirks:00000000 
    • [    1.874488] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA02102, cpsw version 0x6BA82102 Ports: 2 quirks:00000000 
    • [    1.887349] am65-cpsw-nuss 46000000.ethernet: initialized cpsw ale version 1.4 
    • [    1.894557] am65-cpsw-nuss 46000000.ethernet: ALE Table size 64 
    • [    1.904882] am65-cpsw-nuss 46000000.ethernet: CPTS ver 0x4e8a010b, freq:500000000, add_val:1 pps:1 
    • [    1.914914] am65-cpsw-nuss 46000000.ethernet: set new flow-id-base 48 
    • [    2.001088] am65-cpsw-nuss c000000.ethernet: initializing am65 cpsw nuss version 0x6BA03102, cpsw version 0x6BA82902 Ports: 9 quirks:00000000 
    • [    2.014924] am65-cpsw-nuss c000000.ethernet: Use random MAC address 
    • [    2.021188] am65-cpsw-nuss c000000.ethernet: initialized cpsw ale version 1.5 
    • [    2.028306] am65-cpsw-nuss c000000.ethernet: ALE Table size 512 
    • [    2.034569] am65-cpsw-nuss c000000.ethernet: CPTS ver 0x4e8a010c, freq:250000000, add_val:3 pps:0 
    • [    2.045877] am65-cpsw-nuss c000000.ethernet: set new flow-id-base 82 
    • [    7.163522] am65-cpsw-nuss c000000.ethernet eth1: PHY [c000f00.mdio:00] driver [ADIN1100] (irq=POLL) 
    • [    7.174834] am65-cpsw-nuss c000000.ethernet eth1: configuring for phy/sgmii link mode 
    • root@j784s4-evm:/opt/edgeai-gst-apps#  
    • root@j784s4-evm:/opt/edgeai-gst-apps# dmesg | grep dp83869  
    • [    1.968261] dp83869: entered in dp83869_probe 
    • [    1.968265] dp83869: entered in dp83869_of_init 
    • [    1.969098] dp83869: TX internal delay not found in DT, using default: 7 
    • [    1.975785] dp83869: entered in dp83869_config_init 
    • [    1.975996] dp83869: entered in dp83869_configure_mode 
    • [    1.977030] dp83869: mode=3 entered RGMII_SGMII_BRIDGE in dp83869_configure_mode 
    • [    1.978681] dp83869: entered in dp83869_config_port_mirroring 
    • [    1.979509] dp83869: entered in dp83869_config_intr 
    • [    1.979718] dp83869: entered in dp83869_ack_interrupt 
    • root@j784s4-evm:/opt/edgeai-gst-apps#  
    • root@j784s4-evm:/opt/edgeai-gst-apps# dmesg | grep adin1100 
    • [    1.980934] adin1100: entered in adin_probe 
    • [    1.980938] adin1100: entered in adin_get_features 
    • [    7.141021] adin1100: entered in adin_soft_reset 
    • [    7.160799] adin1100: entered in adin_resume 
    • [    7.160811] adin1100: entered in adin_set_powerdown_mode 
    • [    7.187903] adin1100: entered in adin_resume 
    • [    7.187910] adin1100: entered in adin_set_powerdown_mode 
    • [    7.190617] adin1100: entered in adin_config_aneg 
    • [    7.205395] adin1100: entered in adin_read_status 
    • [    8.227916] adin1100: entered in adin_read_status 
    • [    9.251914] adin1100: entered in adin_read_status 
    • [   10.275913] adin1100: entered in adin_read_status 
    • [   60.606602] adin1100: entered in adin_get_sqi 
    • [   60.607443] adin1100: entered in adin_get_sqi_max 
    • [   61.471910] adin1100: entered in adin_read_status 
    • [   62.495909] adin1100: entered in adin_read_status 
    • [   63.519904] adin1100: entered in adin_read_status 
    • [   64.543909] adin1100: entered in adin_read_status 
    • [   65.567908] adin1100: entered in adin_read_status 
    • [   66.591908] adin1100: entered in adin_read_status 
    • root@j784s4-evm:/opt/edgeai-gst-apps# ethtool eth1 
    • Settings for eth1: 
    • Supported ports: [ TP MII ] 
    • Supported link modes:   10baseT1L/Full 
    • Supported pause frame use: Symmetric 
    • Supports auto-negotiation: Yes 
    • Supported FEC modes: Not reported 
    • Advertised link modes:  10baseT1L/Full 
    • Advertised pause frame use: Symmetric 
    • Advertised auto-negotiation: Yes 
    • Advertised FEC modes: Not reported 
    • Speed: Unknown! 
    • Duplex: Unknown! (255) 
    • Auto-negotiation: on 
    • master-slave cfg: preferred slave 
    • master-slave status: unknown 
    • Port: Twisted Pair 
    • PHYAD: 0 
    • Transceiver: external 
    • MDI-X: Unknown 
    • Supports Wake-on: d 
    • Wake-on: d 
    •         Current message level: 0x000020f7 (8439) 
    •                                drv probe link ifdown ifup rx_err tx_err hw 
    • Link detected: no 
    • SQI: 0/7 
    • root@j784s4-evm:/opt/edgeai-gst-apps# ip a 
    • 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 
    •     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 
    •     inet 127.0.0.1/8 scope host lo 
    •        valid_lft forever preferred_lft forever 
    •     inet6 ::1/128 scope host  
    •        valid_lft forever preferred_lft forever 
    • 2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 
    •     link/ether 04:25:e8:b7:09:f4 brd ff:ff:ff:ff:ff:ff 
    • 3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000 
    •     link/ether b6:85:c3:e1:5d:d9 brd ff:ff:ff:ff:ff:ff 
    • root@j784s4-evm:/opt/edgeai-gst-apps# 

    Below is the information  i got from datasheet regarding setting dp83869 as SGMII to RGMII bridge:

    In SGMII-to-RGMII mode, Ethernet MAC is connected to the SGMII pins of the DP83869HM and PHY is
    connected to the RGMII pins of the DP83869. In this mode, DP83869HM configures SGMII in Auto. In Auto
    mode, SGMII adapts the link speed based on RGMII.
    After auto-negotiation is completed on the PHY side, the link capabilities are communicated to DP83869HM over
    the RGMII interface. However, this information needs to be conveyed to the Ethernet MAC as well. The MAC can
    read this information from the DP83869HM through the registers.
    In SGMII-to-RGMII Bridge mode, the DP83869 acts as RGMII MAC for the Ethernet PHY. The DP83869 RX pins
    acts as output pins from the DP83869 to the Ethernet PHY TX pins, and the DP83869 TX pins acts as input pins
    for the Ethernet PHY RX pins.

    My question is in dts setup under cpsw_port0 what to define under phy-handle and phy-mode?

    Since dp83869hm acts as bridge and adin1100 is the ethernet phy do i need to define adin1100 and rgmii under phy-handle and phy-mode?

    Does Linux CPSW need to bind directly to the ADIN1100’s MDIO node (with DP83869 only acting as a hardware bridge)?

    Best Regards,
    B.Apuroop Kumar

  • Hello,

    It appears this is a duplicate post of the following thread. I will close this thread to consolidate our efforts.

    e2e.ti.com/.../processor-sdk-j784s4-clarification-on-phys-usage-with-sgmii-on-cpsw9g

    Sincerely,
    Gerome