This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62A7: Need help with device tree changes regarding ethernet connection for AM62A7 custom board.

Part Number: AM62A7

Tool/software:

Hi TI forum,

We are developing a custom AM62A7-based board with ethernet. In our board, we are using the KSZ8775 switch chip from Microchip.  The switch's port 5 is used for RGMII connection with AM62A7. Below is the pin-to-pin mapping of AM62A7 to KSZ8775.

 

AM62A pin number AM62A pin description KSZ8775 pin number KSZ8775 pin description
AA17 RGMII_TD3 54 RXD5_3
Y16 RGMII_TD2 53 RXD5_2
W16 RGMII_TX_CTL 55 RXDV5
V16 RGMII_TD1 50 RXD5_1
Y17 RGMII_TD0 49 RXD5_0
AB17 RGMII_TXC 48 RXC5
AA16 RGMII_RXC 47 TXC5
V14 RGMII_RD3 38 TXD5_3
W15 RGMII_RD2 37 TXD5_2
V15 RGMII_RD1 34 TXD5_1
AB16 RGMII_RD0 33 TXD5_0
AA15 RGMII_RX_CTL 32 TXEN5

Apart from RGMII pins, we are also connecting SPI lines for sending control commands. Below are details of SPI lines.

AM62A pin number AM62A pin description KSZ8775 pin number KSZ8775 pin description
C19 SOC_SPI2_D0 67 SDO
A21 SOC_SPI2_CLK 68 MDC
B19 SOC_SPI2_D1 69 MDIO
B21 SOC_SPI2_CS0 70 SCS_N

Kindly help us with changes required in the device tree files. We are using the device file provided by TI for the SK-AM62A7-LP board.  

  • Hi,

    External Ethernet switches are not something that TI is able to directly support, TI does not have a set of exact steps to follow. We can make suggestions after you are able to create the DTS entries. Please note that users are able to attach these devices with success on a regular basis. I can make a couple of suggestions to start:

    - Contact the switch vendor if they have example DTS file that could be used as a starting point for integrating with the TI processor.

    - Contact the switch vendor for if they have a mainline Linux driver for the switch and what needs to be enabled in the kernel configuration to support the switch

    - Assuming RGMII interface the switch would connect like an Ethernet PHY in terms of pin mux, please the existing TI EVM here.

    - Place the CPSW port into fixed link mode, this is a possible example for setting the port at 100Mbps:

    &cpsw_port2 {
    status = "okay";
    phy-mode = "rgmii-id";

    fixed-link {
       speed = <100>;
       full-duplex;
      };
    };

    Best Regards,

    Schuyler

  • Hi Schuyler Patton,

    I contacted the switch vendor and got the device tree. As shown below, I have made the suggested changes in the device tree.

    &cpsw3g {
         status = "okay";
         pinctrl-names = "default";
         pinctrl-0 = <&main_rgmii1_pins_default>;

         cpts@3d000 {
              /* MAP HW3_TS_PUSH to GENF1 */
              ti,pps = <7 1>;
         };
    };


    &main_spi2{
         pinctrl-names = "default";
         pinctrl-0 = <&main_spi2_pins_default>;
         status = "okay";

         ksz9477: ethernet-switch@0 {
              compatible = "microchip,ksz9477";
              reg = <0>;
              spi-max-frequency = <44000000>;
              spi-cpha;
              spi-cpol;
              reset-gpios = <&main_gpio1 40 GPIO_ACTIVE_LOW>;
              status = "okay";
              ports {
                   #address-cells = <1>;
                   #size-cells = <0>;
                   port@0 {
                        reg = <0>;
                        label = "lan1";
                   };
                   port@1 {
                        reg = <1>;
                        label = "lan2";
                   };
                   port@2 {
                        reg = <2>;
                        label = "lan3";
                   };
                   port@3 {
                        reg = <3>;
                        label = "lan4";
                   };
                   port@4 {
                        reg = <4>;
                        label = "lan5";
                   };
                   sw_port5:port@5 {
                        reg = <5>;
                        label = "cpu";
                        ethernet = <&cpsw3g>;
                        phy-mode = "rgmii-rxid";
                        fixed-link {

                             speed = <10>;
                             full-duplex;
                        };
                   };
              };
         };
    };

    &cpsw_port1 {
         status = "okay";
         phy-mode = "rgmii-rxid";
         phy-handle = <&ksz9477>;
         fixed-link {
              speed = <10>;
              full-duplex;
         };
    };
                  

    When I boot up with these settings, it doesn't seem to affect anything on ethernet. I don't see any SPI-related logs or KSZ driver-related logs.                       

    I confirm that I have made changes in the defconfig file to include KSZ SPI drivers for building. 

    Can you please help me with this issue? What am I doing wrong in device tree?

  • Hi Sunil,

     fixed-link {
              speed = <10>;
              full-duplex;
         };

    Is your intention to bring up the interface speed at 10Mbps full-duplex?

    Can you share your full device tree? Can you also share your full boot log?

    When I boot up with these settings, it doesn't seem to affect anything on ethernet.

    Did you see any particular errors with these configuration settings? Does "ethtool eth0" or "ethtool eth1" show that the "Link detected: yes"?

    -Daolin