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.

Linux/AM5728: pruss not working with tlk phy

Part Number: AM5728
Other Parts Discussed in Thread: TLK105,

Tool/software: Linux

We are working on AM5728 based custom board . We are using pruss ethernet  with tlk105 phy device. We observed the following log messages for pru with phy address error.Kindly help.

root@am57xx-evm:~# dmesg | grep pru
[    7.259237] ti-pruss 4b280000.pruss: creating PRU cores and other child platform devices
[    7.284009] irq: no irq domain found for /ocp/pruss@4b280000/intc@4b2a0000 !
[    7.302788] irq: no irq domain found for /ocp/pruss@4b280000/intc@4b2a0000 !
[    7.483196]  remoteproc4: 4b2b4000.pru0 is available
[    7.523804] pru-rproc 4b2b4000.pru0: PRU rproc node /ocp/pruss@4b280000/pru0@4b2b4000 probed successfully
[    7.539245]  remoteproc5: 4b2b8000.pru1 is available
[    7.573625] pru-rproc 4b2b8000.pru1: PRU rproc node /ocp/pruss@4b280000/pru1@4b2b8000 probed successfully
[    7.858287] prueth pruss2_eth: port 1: using random MAC addr: 4a:97:a6:a3:25:55
[    7.874470] prueth pruss2_eth: couldn't connect to phy /ocp/pruss@4b280000/mdio@4b2b2400/ethernet-phy@31
[    7.947143] prueth pruss2_eth: netdev init ethernet-mii0 failed: -19
[    7.967946] prueth pruss2_eth: port 2: using random MAC addr: aa:75:3d:c0:2b:69
[    7.980060] prueth pruss2_eth: couldn't connect to phy /ocp/pruss@4b280000/mdio@4b2b2400/ethernet-phy@6
[    7.997306] prueth pruss2_eth: netdev init ethernet-mii1 failed: -19
[    8.005469] prueth pruss2_eth: TI PRU ethernet driver initialized
root@am57xx-evm:~#

  • Hello Marka,

    What version of Linux are you using? Please attach your dts file and your command line output.

    Regards,
    Nick
  • Marka Reddy said:
    [    7.874470] prueth pruss2_eth: couldn't connect to phy /ocp/pruss@4b280000/mdio@4b2b2400/ethernet-phy@31
    [    7.947143] prueth pruss2_eth: netdev init ethernet-mii0 failed: -19
    [    7.967946] prueth pruss2_eth: port 2: using random MAC addr: aa:75:3d:c0:2b:69
    [    7.980060] prueth pruss2_eth: couldn't connect to phy /ocp/pruss@4b280000/mdio@4b2b2400/ethernet-phy@6
    [    7.997306] prueth pruss2_eth: netdev init ethernet-mii1 failed: -19

    Are you certain those PHY addresses (31 and 6) match precisely with how the PHY's were bootstrapped?

  • we are using linux 4.4

    dts portion of PRU is : ==================

    ethernet2 = &pruss2_emac0;
    ethernet3 = &pruss2_emac1;

    /* Dual-MAC Ethernet application node on PRU-ICSS2 */
    pruss2_eth {
    compatible = "ti,am57-prueth";
    pruss = <&pruss2>;
    sram = <&ocmcram1>;
    interrupt-parent = <&pruss2_intc>;

    pruss2_emac0: ethernet-mii0 {
    phy-handle = <&pruss2_eth0_phy>;
    phy-mode = "mii";
    interrupts = <20>, <22>;
    interrupt-names = "rx", "tx";
    /* Filled in by bootloader */
    local-mac-address = [00 00 00 00 00 00];
    };

    pruss2_emac1: ethernet-mii1 {
    phy-handle = <&pruss2_eth1_phy>;
    phy-mode = "mii";
    interrupts = <21>, <23>;
    interrupt-names = "rx", "tx";
    /* Filled in by bootloader */
    local-mac-address = [00 00 00 00 00 00];
    };
    };




    pru2_mii_pins_default: pru2_mii_pins_default{
    pinctrl-single,pins = <
    /* Slave 1 */
    0x2B8 (PIN_INPUT | MUX_MODE11) /* mcasp1_axr1.pr2_mii_mt0_clk */
    0x2D4 (PIN_OUTPUT | MUX_MODE11) /* mcasp1_axr8.pr2_mii0_txen */
    0x2D8 (PIN_OUTPUT | MUX_MODE11) /* mcasp1_axr9.pr2_mii0_txd3 */
    0x2DC (PIN_OUTPUT | MUX_MODE11) /* mcasp1_axr10.pr2_mii0_txd2 */
    0x2E0 (PIN_OUTPUT | MUX_MODE11) /* mcasp1_axr11.pr2_mii0_txd1 */
    0x2E4 (PIN_OUTPUT | MUX_MODE11) /* mcasp1_axr12.pr2_mii0_txd0 */
    0x2E8 (PIN_INPUT | MUX_MODE11) /* mcasp1_axr13.pr2_mii_mr0_clk */
    0x2Ec (PIN_INPUT | MUX_MODE11) /* mcasp1_axr14.pr2_mii0_rxdv */
    0x2F0 (PIN_INPUT | MUX_MODE11) /* mcasp1_axr15.pr2_mii0_rxd3 */
    0x2F4 (PIN_INPUT | MUX_MODE11) /* mcasp2_aclkx.pr2_mii0_rxd2 */
    0x2F8 (PIN_INPUT | MUX_MODE11) /* mcasp2_fsx.pr2_mii0_rxd1 */
    0x30C (PIN_INPUT | MUX_MODE11) /* mcasp2_axr2.pr2_mii0_rxd0 */

    /* Slave 2 */
    0x374 (PIN_INPUT | MUX_MODE11) /* gpio6_10.pr2_mii_mt1_clk */
    0x378 (PIN_OUTPUT | MUX_MODE11) /* gpio6_11.pr2_mii1_txen */
    0x37C (PIN_OUTPUT | MUX_MODE11) /* mmc3_clk.pr2_mii1_txd3 */
    0x380 (PIN_OUTPUT | MUX_MODE11) /* mmc3_cmd.pr2_mii1_txd2 */
    0x384 (PIN_OUTPUT | MUX_MODE11) /* mmc3_dat0.pr2_mii1_txd1 */
    0x388 (PIN_OUTPUT | MUX_MODE11) /* mmc3_dat1.pr2_mii1_txd0 */
    0x38C (PIN_INPUT | MUX_MODE11) /* mmc3_dat2.pr2_mii_mr1_clk */
    0x390 (PIN_INPUT | MUX_MODE11) /* mmc3_dat3.pr2_mii1_rxdv */
    0x394 (PIN_INPUT | MUX_MODE11) /* mmc3_dat4.pr2_mii1_rxd3 */
    0x398 (PIN_INPUT | MUX_MODE11) /* mmc3_dat5.pr2_mii1_rxd2 */
    0x39C (PIN_INPUT | MUX_MODE11) /* mmc3_dat6.pr2_mii1_rxd1 */
    0x3A0 (PIN_INPUT | MUX_MODE11) /* mmc3_dat7.pr2_mii1_rxd0 */



    >;
    };

    pru2_mii_davinci_mdio_pins_default: pru2_mii_davinci_mdio_pins_default{
    pinctrl-single,pins = <
    /* MDIO */
    0x2A4 (PIN_OUTPUT | MUX_MODE11) /* mcasp1_aclkx.pr2_mdio_mdclk */
    0x2A8 (PIN_INPUT | MUX_MODE11) /* mcasp1_fsx.pr2_mdio_data */




    &pruss1 {
    status = "disabled";

    pru1_0: pru0@4b234000 {
    interrupt-parent = <&pruss1_intc>;
    interrupts = <16>, <17>;
    interrupt-names = "vring", "kick";
    status = "disabled";
    };

    pru1_1: pru1@4b238000 {
    interrupt-parent = <&pruss1_intc>;
    interrupts = <18>, <19>;
    interrupt-names = "vring", "kick";
    status = "disabled";
    };

    };

    &pruss2 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&pru2_mii_pins_default>;

    pru2_0: pru0@4b2b4000 {
    interrupt-parent = <&pruss2_intc>;
    interrupts = <16>, <17>;
    interrupt-names = "vring", "kick";
    status = "okay";
    };

    pru2_1: pru1@4b2b8000 {
    interrupt-parent = <&pruss2_intc>;
    interrupts = <18>, <19>;
    interrupt-names = "vring", "kick";
    status = "okay";
    };


    };



    &pruss2_mdio {
    status = "okay";

    pinctrl-names = "default";
    pinctrl-0 = <&pru2_mii_davinci_mdio_pins_default>;


    pruss2_eth0_phy: ethernet-phy@30{
    reg = <30>;

    };

    pruss2_eth1_phy: ethernet-phy@6{
    reg = <6>;
    };
    };




    command line output:==============

    root@am57xx-evm:~# dmesg | grep pru
    [ 7.259237] ti-pruss 4b280000.pruss: creating PRU cores and other child platform devices
    [ 7.284009] irq: no irq domain found for /ocp/pruss@4b280000/intc@4b2a0000 !
    [ 7.302788] irq: no irq domain found for /ocp/pruss@4b280000/intc@4b2a0000 !
    [ 7.483196] remoteproc4: 4b2b4000.pru0 is available
    [ 7.523804] pru-rproc 4b2b4000.pru0: PRU rproc node /ocp/pruss@4b280000/pru0@4b2b4000 probed successfully
    [ 7.539245] remoteproc5: 4b2b8000.pru1 is available
    [ 7.573625] pru-rproc 4b2b8000.pru1: PRU rproc node /ocp/pruss@4b280000/pru1@4b2b8000 probed successfully
    [ 7.858287] prueth pruss2_eth: port 1: using random MAC addr: 4a:97:a6:a3:25:55
    [ 7.874470] prueth pruss2_eth: couldn't connect to phy /ocp/pruss@4b280000/mdio@4b2b2400/ethernet-phy@31
    [ 7.947143] prueth pruss2_eth: netdev init ethernet-mii0 failed: -19
    [ 7.967946] prueth pruss2_eth: port 2: using random MAC addr: aa:75:3d:c0:2b:69
    [ 7.980060] prueth pruss2_eth: couldn't connect to phy /ocp/pruss@4b280000/mdio@4b2b2400/ethernet-phy@6
    [ 7.997306] prueth pruss2_eth: netdev init ethernet-mii1 failed: -19
    [ 8.005469] prueth pruss2_eth: TI PRU ethernet driver initialized


    BR

    marka reddy
  • Hello Marka,

    1) Linux 4.4 is old enough that I can only offer limited support.

    2) Look at Brad's comment. If the driver says "device does not exist" (i.e., linux error code 19), the most common issue is that the PHY bootstrapping & resistors were not set up properly.

    3) dmesg | grep pru does not give enough information. If you cannot post your entire boot log, post dmesg | grep mdio to verify that you are actually seeing ethernet phys at phy[6] and phy[31]

    Regards,
    Nick
  • Marka Reddy said:

    &pruss2_mdio {
    status = "okay";

    pinctrl-names = "default";
    pinctrl-0 = <&pru2_mii_davinci_mdio_pins_default>;


    pruss2_eth0_phy: ethernet-phy@30{
    reg = <30>;

    };

    pruss2_eth1_phy: ethernet-phy@6{
    reg = <6>;
    };
    };

    Marka Reddy said:
    [ 7.874470] prueth pruss2_eth: couldn't connect to phy /ocp/pruss@4b280000/mdio@4b2b2400/ethernet-phy@31
    [ 7.947143] prueth pruss2_eth: netdev init ethernet-mii0 failed: -19
    [ 7.967946] prueth pruss2_eth: port 2: using random MAC addr: aa:75:3d:c0:2b:69
    [ 7.980060] prueth pruss2_eth: couldn't connect to phy /ocp/pruss@4b280000/mdio@4b2b2400/ethernet-phy@6
    [ 7.997306] prueth pruss2_eth: netdev init ethernet-mii1 failed: -19

    The numbers in the Linux error message don't match your dts.  Do you know how to reverse-compile your dtb back into a single dts?  If so, can you please post that?  If not, please post the dtb and I can do it.

  • We verified PHY bootstrapping resistors and we configured it for address 30 . We just tried in our dtb with all combinations of phy addresses from 0 to 30. All the time we observed the same error. Please confirm if dts definitions provided above are correct. Also, find the dmesg | grep mdio messages below:


    root@am57xx-evm:~# dmesg | grep mdio
    [ 1.523745] davinci_mdio 48485000.mdio: davinci mdio revision 1.6
    [ 1.529868] davinci_mdio 48485000.mdio: detected phy mask fffffff9
    [ 1.540450] libphy: 48485000.mdio: probed
    [ 1.544522] davinci_mdio 48485000.mdio: phy[1]: device 48485000.mdio:01, driver Micrel KSZ9031 Gigabit PHY
    [ 1.554259] davinci_mdio 48485000.mdio: phy[2]: device 48485000.mdio:02, driver Micrel KSZ9031 Gigabit PHY
    [ 7.083827] davinci_mdio 4b2b2400.mdio: davinci mdio revision 1.6
    [ 7.090872] libphy: 4b2b2400.mdio: probed
    [ 7.899142] prueth pruss2_eth: couldn't connect to phy /ocp/pruss@4b280000/mdio@4b2b2400/ethernet-phy@30
    [ 7.960611] prueth pruss2_eth: couldn't connect to phy /ocp/pruss@4b280000/mdio@4b2b2400/ethernet-phy@6


    Regards,
    Marka
  • We tried changing phy addresses from 0 to 31 in dts ,hence the mismatch as they were of different iterations.
    the bootstrapping combination is for phy address 30.

    Regards,
    Marka
  • Do you know how to reverse-compile your dtb back into a single dts? If so, can you please post that? If not, please post the dtb and I can do it.
  • 5460.dts.txtplease find the re-compiled dtb file as dts.txt

  • I haven't been able to spot any issues in your dts. If you cannot get the PHY to respond in any capacity, then my suspicion is that you have a hardware issue related to your PHY. I would check the PHY's power, clocks, and reset for starters.
  • Hi

    PHY power and reset connections seem to be OK. but in the MAC --PHY  MII interface we have not connected the  CRS  and COL signals.  Is there any issue with this?.  The schematic portion is attached   prueth.pdf

  • What's controlling the PRU2ETH0_RESETn signal? Is it ever getting asserted low to make sure the PHY is getting reset? Ideally the signal should be asserted low while the PHY is powering up, and then it should be released (high).
  • reset signal seems to be OK.
  • I suggest focusing on the MDIO bus. That's where the initial communication takes place to identify the device. You could compare against the IDK to see how it differs.
  • Hello Marka,

    I am going to mark this thread resolved. Feel free to continue the discussion if needed.

    Regards,
    Nick