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.

AM623: Linux driver error while Interfacing AM623 with DP83848 (RMII)

Part Number: AM623


Tool/software:

Hi,

I am trying to interface AM623 with DP83848 ethernet PHY. But while booting Linux it is showing following error

[    3.282475] davinci_mdio 8000f00.mdio: Configuring MDIO in manual mode
[    3.335653] davinci_mdio 8000f00.mdio: davinci mdio revision 9.7, bus freq 1000000
[    7.446063] am65-cpsw-nuss 8000000.ethernet: initializing am65 cpsw nuss version 0x6BA01103, cpsw version 0x6BA81103 Ports: 3 quirks:00000006
[    7.459109] am65-cpsw-nuss 8000000.ethernet: /bus@f0000/ethernet@8000000/ethernet-ports/port@2 read phy-mode err -22
[    7.486254] am65-cpsw-nuss: probe of 8000000.ethernet failed with error -22

The linux device tree configuration is adding below.

    main_mdio1_pins_default: main-mdio1-pins-default {
        pinctrl-single,pins = <
            AM62X_IOPAD(0x160, PIN_OUTPUT, 0) /* (AD24/V17) MDIO0_MDC */
            AM62X_IOPAD(0x15c, PIN_INPUT, 0) /* (AB22/U16) MDIO0_MDIO */
        >;
    };

    main_rmii1_pins_default: main_mii1-default-pins {
        pinctrl-single,pins = <
            AM62X_IOPAD(0x0130, PIN_INPUT, 1) /* (AE19) RGMII1_TXC.RMII1_CRS_DV */
            AM62X_IOPAD(0x0148, PIN_INPUT, 1) /* (AD17) RGMII1_RXC.RMII1_REF_CLK */
            AM62X_IOPAD(0x014c, PIN_INPUT, 1) /* (AB17) RGMII1_RD0.RMII1_RXD0 */
            AM62X_IOPAD(0x0150, PIN_INPUT, 1) /* (AC17) RGMII1_RD1.RMII1_RXD1 */
            AM62X_IOPAD(0x0144, PIN_INPUT, 1) /* (AE17) RGMII1_RX_CTL.RMII1_RX_ER */
            AM62X_IOPAD(0x0134, PIN_OUTPUT, 1) /* (AE20) RGMII1_TD0.RMII1_TXD0 */
            AM62X_IOPAD(0x0138, PIN_OUTPUT, 1) /* (AD20) RGMII1_TD1.RMII1_TXD1 */
            AM62X_IOPAD(0x012c, PIN_OUTPUT, 1) /* (AD19) RGMII1_TX_CTL.RMII1_TX_EN */
            AM62X_IOPAD(0x0178, PIN_OUTPUT, 7) /* (AC20) RGMII2_TD3.GPIO1_0   Reset Signal*/
           
        >;
    };
&cpsw3g {
    pinctrl-names = "default";
    pinctrl-0 = <&main_rmii1_pins_default>;
    status = "okay";
};

&cpsw_port1 {
    phy-mode = "rmii";
    phy-handle = <&cpsw3g_phy1>;
    status = "okay";
};

&cpsw3g_mdio {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&main_mdio1_pins_default>;

    cpsw3g_phy1: ethernet-phy@1 {
        reg = <1>;
       
        ti,rx-internal-delay = <0>;
        ti,tx-internal-delay = <0>;

        reset-gpios = <&main_gpio1 0 GPIO_ACTIVE_LOW>;
        reset-assert-us = <25>;
        reset-deassert-us = <60000>;
       
        status = "okay";
    };
};

The dp83848 PHY is configured as "rmii" mod and its address is "1". And the GPIO pin "GPIO1_0" is used as PHY reset signal.

I have applied this same configuration in u-boot device tree, and it is working but in Linux it is showing error while booing.