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.

AM5728: PRU Ethernet issue

Other Parts Discussed in Thread: AM5728

Hi:

Board : AM5728  custom board

SDK 5.3

   Refer to the IDK device tree。

  PRU device tree Settings:

pruss2_eth: pruss2_eth {
compatible = "ti,am57-prueth";
prus = <&pru2_0>, <&pru2_1>;
firmware-name = "ti-pruss/am57xx-pru0-prueth-fw.elf",
"ti-pruss/am57xx-pru1-prueth-fw.elf";
sram = <&ocmcram1>;
interrupt-parent = <&pruss2_intc>;
interrupts = <20>, <21>;
interrupt-names = "rx_red_hp", "rx_red_lp";

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

&pruss_soc_bus2 {
status = "okay";
reset-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>,
<&gpio2 19 GPIO_ACTIVE_LOW>;
reset-delay-us = <2>; /* PHY datasheet states 1uS min */

pruss2: pruss@0 {
status = "okay";
};
};

&pruss2_mdio {
status = "okay";
pruss2_eth0_phy: ethernet-phy@0 {
reg = <0>;
interrupt-parent = <&gpio2>;
interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
};

pruss2_eth1_phy: ethernet-phy@1 {
reg = <1>;
interrupt-parent = <&gpio2>;
interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
};
};

Recompile and load the ti_prueth.ko module.The eth2 and eth3 devices can be produced, But eth3 cannot get the IP。

Eth2 on the plug and unplug network cable is printed with the following information:

[ 311.491809] prueth pruss2_eth eth2: Link is Up - 100Mbps/Full - flow control rx/tx
[ 311.499430] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
[ 311.517882] NOHZ: local_softirq_pending 08
[ 312.517800] NOHZ: local_softirq_pending 08
[ 312.578006] NOHZ: local_softirq_pending 08
[ 312.878745] NOHZ: local_softirq_pending 08
[ 312.883887] NOHZ: local_softirq_pending 08
[ 312.947958] NOHZ: local_softirq_pending 08
[ 312.972437] NOHZ: local_softirq_pending 08
[ 312.978250] NOHZ: local_softirq_pending 08
[ 313.294243] NOHZ: local_softirq_pending 08

[ 313.873089] NOHZ: local_softirq_pending 08

notice: Eth3 plugs and unplugs the network cable, but no Link up information is printed。  Two phy chips use the same MDIO control signal

                                                   

Why does eth2 work and eth3 not print the Link up information? Is it related to the firmware?

  • Hello,

    You included pruss2_emac0 node in your device tree. Did you include pruss2_emac1? See arch/arm/boot/dts/am57xx-idk-common.dtsi in your SDK for an example.

    Regards,

    Nick

  • Hi:

      Sorry, I cut the code in half last time。

     Here is my code from the new post。

    / {

    aliases {

    ethernet2 = &pruss2_emac0;
    ethernet3 = &pruss2_emac1;
    };

    /* Dual-MAC Ethernet application node on PRU-ICSS2 */
    pruss2_eth: pruss2_eth {
    compatible = "ti,am57-prueth";
    prus = <&pru2_0>, <&pru2_1>;
    firmware-name = "ti-pruss/am57xx-pru0-prueth-fw.elf",
    "ti-pruss/am57xx-pru1-prueth-fw.elf";
    sram = <&ocmcram1>;
    interrupt-parent = <&pruss2_intc>;
    interrupts = <20>, <21>;
    interrupt-names = "rx_red_hp", "rx_red_lp";

    pruss2_emac0: ethernet-mii0 {
    phy-handle = <&pruss2_eth0_phy>;
    phy-mode = "mii";
    interrupts = <20>, <22>, <23>, <26>;
    interrupt-names = "rx", "tx", "hsrprp_ptp_tx",
    "emac_ptp_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>, <24>, <27>;
    interrupt-names = "rx", "tx", "hsrprp_ptp_tx",
    "emac_ptp_tx";
    /* Filled in by bootloader */
    local-mac-address = [00 00 00 00 00 00];
    };
    };

    };

    &pruss_soc_bus2 {
    status = "okay";
    reset-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>,
    <&gpio2 19 GPIO_ACTIVE_LOW>;
    reset-delay-us = <2>; /* PHY datasheet states 1uS min */

    pruss2: pruss@0 {
    status = "okay";
    };
    };

    &pruss2_mdio {
    status = "okay";
    pruss2_eth0_phy: ethernet-phy@0 {
    reg = <0>;
    interrupt-parent = <&gpio2>;
    interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
    };

    pruss2_eth1_phy: ethernet-phy@1 {
    reg = <1>;
    interrupt-parent = <&gpio2>;
    interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
    };
    };

    I am referring to the arch/arm/boot/ DTS /am57xx-idk-common.dtsi file。But eth3 can't get the IP。

    Has PRU ETH of SDK5.3 been tried to use on IDK board?  Has anyone had the same problem?

  • Hi:

    I print some messages as follows,  I don't know if the red part is or doesn't matter.  What should we do about it?

    root@am57xx-evm:~# dmesg | grep mdio
    [ 1.744502] mdio_bus fixed-0: GPIO lookup for consumer reset
    [ 1.744510] mdio_bus fixed-0: using lookup tables for GPIO lookup
    [ 1.744518] mdio_bus fixed-0: lookup for GPIO reset failed
    [ 1.751275] mdio_bus 48485000.mdio: GPIO lookup for consumer reset
    [ 1.751282] mdio_bus 48485000.mdio: using device tree for GPIO lookup
    [ 1.751293] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/ethernet@48484000/mdio@48485000[0]'
    [ 1.751303] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/ethernet@48484000/mdio@48485000[0]'
    [ 1.751310] mdio_bus 48485000.mdio: using lookup tables for GPIO lookup
    [ 1.751317] mdio_bus 48485000.mdio: lookup for GPIO reset failed
    [ 1.810883] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000
    [ 1.818580] libphy: 48485000.mdio: probed
    [ 1.827535] davinci_mdio 48485000.mdio: phy[1]: device 48485000.mdio:01, driver Micrel KSZ9031 Gigabit PHY
    [ 1.837279] davinci_mdio 48485000.mdio: phy[2]: device 48485000.mdio:02, driver Micrel KSZ9031 Gigabit PHY
    [ 10.953790] Micrel KSZ9031 Gigabit PHY 48485000.mdio:02: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=48485000.mdio:02, irq=POLL)
    [ 11.341587] Micrel KSZ9031 Gigabit PHY 48485000.mdio:01: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=48485000.mdio:01, irq=POLL)
    [ 12.528948] mdio_bus 4b2b2400.mdio: GPIO lookup for consumer reset
    [ 12.528957] mdio_bus 4b2b2400.mdio: using device tree for GPIO lookup
    [ 12.528967] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/pruss_soc_bus@4b2a6004/pruss@0/mdio@32400[0]'
    [ 12.528974] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/pruss_soc_bus@4b2a6004/pruss@0/mdio@32400[0]'
    [ 12.528980] mdio_bus 4b2b2400.mdio: using lookup tables for GPIO lookup
    [ 12.530941] mdio_bus 4b2b2400.mdio: lookup for GPIO reset failed
    [ 12.592015] davinci_mdio 4b2b2400.mdio: davinci mdio revision 1.6, bus freq 1000000
    [ 12.600380] libphy: 4b2b2400.mdio: probed
    [ 12.614474] davinci_mdio 4b2b2400.mdio: phy[0]: device 4b2b2400.mdio:00, driver TI TLK10X 10/100 Mbps PHY
    [ 12.624901] davinci_mdio 4b2b2400.mdio: phy[1]: device 4b2b2400.mdio:01, driver TI TLK10X 10/100 Mbps PHY

  • Hello,

    Please move

    reset-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>,
    <&gpio2 19 GPIO_ACTIVE_LOW>;
    reset-delay-us = <2>; /* PHY datasheet states 1uS min */

    from the pruss_soc_bus2 node to the pruss2_mdio node.

    Your reference files in the SDK are arch/arm/boot/dts/am572x-idk.dts, arch/arm/boot/dts/am572x-idk-common.dtsi, and arch/arm/boot/dts/am57xx-idk-common.dtsi.

    Regards,

    Nick

  • HI:

        Thank you very much。 According to your changes, both eth2 and eth3 are available。

       But the message still appears。

    [ 12.528948] mdio_bus 4b2b2400.mdio: GPIO lookup for consumer reset
    [ 12.528957] mdio_bus 4b2b2400.mdio: using device tree for GPIO lookup
    [ 12.528967] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/pruss_soc_bus@4b2a6004/pruss@0/mdio@32400[0]'
    [ 12.528974] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/pruss_soc_bus@4b2a6004/pruss@0/mdio@32400[0]'
    [ 12.528980] mdio_bus 4b2b2400.mdio: using lookup tables for GPIO lookup
    [ 12.530941] mdio_bus 4b2b2400.mdio: lookup for GPIO reset failed

  • Hello,

    What do you mean by "both eth2 and eth3 are available"? Is your problem fixed? Could you give us the results of an ifconfig -a ? Terminal output would be helpful

    Regards,
    Nick

  • FYI, I will be on vacation the rest of the week. I will return the following week.

    Regards,

    Nick

  • I am going to assume that your problem is resolved. If you have further questions, please reply to this thread or create a new one.

    Regards,

    Nick