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.

PROCESSOR-SDK-AM335X: PRU Ethernet single MAC issue

Part Number: PROCESSOR-SDK-AM335X

Hello,

our company has designed a custom board with the TI AM335x and two ethernet ports. One is connected to MII1 and the other should use the PRU and ist connected to PR1_MII1. The first port works like expected but the PRU Eth Port is not working.

We did a lot of testing and to me, it seems like a bug in the prueth driver.

After the driver is initialized we get an Error:

[ 15.044651] prueth pruss_eth: TI PRU ethernet (type 0) driver initialized

...

[ 27.001215] Unable to handle kernel NULL pointer dereference at virtual address 000000f0
[ 27.038019] pgd = 4f4314a1
[ 27.040761] [000000f0] *pgd=00000000
[ 27.083212] Internal error: Oops: 805 [#1] PREEMPT ARM

For further information, I attached a log file and the device tree we use.

Additional Info: We are using the ti-processor-sdk-linux-rt-am335x-EVM-06.01.00.08 with a 4.19. Linux RT kernel and the filesystem is tisdk-docker-rootfs-image-am335x-EVM,  both provided by the SDK.

Thank you very much in advance for your answer.

LogAndDeviceTree.zip

  • Hello Marcel,

    Did you follow the bindings documentation guidance to use Single EMAC mode instead of Dual EMAC mode in your device tree files?

    Documentation/devicetree/bindings/net/ti-prueth.txt

    Potentially useful posts:
    PRU Ethernet Driver Error
    Single PRU Ethernet Configuration

    Regards,

    Nick

  • Hello Nick,

    yes, I already found and used the ti_prueth.txt as guidance. 

    unfortunately, the other posts didn't give me new information that could have help.

    I configured the pru eth node like this in the device tree:

        pruss_eth: pruss_eth {
            compatible = "ti,am3359-prueth";
            prus = <&pru0>, <&pru1>;
            firmware-name = "" ,
                     "ti-pruss/am335x-pru1-prueth-fw.elf";
            sram = <&ocmcram>;
            interrupt-parent = <&pruss_intc>;
            mii-rt = <&pruss_mii_rt>;
            pinctrl-0 = <&mii2_pru_pins_default>;
            pinctrl-names = "default";
            interrupts = <20>, <21>;
            interrupt-names = "rx_red_hp", "rx_red_lp";
            status = "okay";

            pruss_emac1: ethernet-mii1 {
                phy-handle = <&pruss_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_bus {
        status = "okay";

        pruss: pruss@4a300000 {
            status = "okay";
        };
    };

    &pruss_mdio {
        pinctrl-0 = <&mdio_mii2_pins_default>;
        pinctrl-names = "default";
        reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
        reset-delay-us = <2>; /* PHY datasheet states 1uS min */
        status = "okay";

        pruss_eth1_phy: pruss_eth1_phy@1 {
             reg = <1>;
        };
    };
    if you want to check the whole dts file it is attached to my main post. 
    Thank you.
  • Hello Nick,

    there is one more thing I found odd. When I check the PRU firmware status it states that it is offline. But the right firmware is displayed in the firmware file

    PRU1:
    root@am335x-megmeet:~# cat /sys/class/remoteproc/remoteproc2/firmware
    ti-pruss/am335x-pru1-prueth-fw.elf
    root@am335x-megmeet:~# cat /sys/class/remoteproc/remoteproc2/state
    offline

    PRU0:

    root@am335x-megmeet:~# cat /sys/class/remoteproc/remoteproc1/firmware
    am335x-pru0-fw
    root@am335x-megmeet:~# cat /sys/class/remoteproc/remoteproc1/state
    offline

    M3:

    root@am335x-megmeet:~# cat /sys/class/remoteproc/remoteproc0/firmware
    am335x-pm-firmware.elf
    root@am335x-megmeet:~# cat /sys/class/remoteproc/remoteproc0/state
    running

    Is there a certain command I need to include in my device tree to start the pru1 firmware or is it offline because of the error? The M3 core is working fine.

    Regards,

    Marcel

  • Hello Marcel,

    Apologies for the delayed response. I should be able to get an AM335x ICEv2 board to check this by next week.

    I have sometimes seen PRU related issues when using the docker filesystem. Do you see the same behavior with the full filesystem (tisdk-rootfs-image-am335x-EVM)? 

    Regards,

    Nick

  • Hello Nick,

    I pulled a newer kernel version from the TI git repository. Now the PRU works fine. I think this resolved the issue.

    Regards,

    Marcel

  • Hello Marcel,

    Thank you for confirming your solution!

    Just to check: When you saw your issue, were you using the Linux 4.19 RT kernel that came with the ti-processor-sdk-linux-rt-am335x-EVM-06.01.00.08 SDK? Or were you using a different Linux 4.19 RT kernel?

    Regards,

    Nick

  • Hello Nick,

    the problem occurred with the Linux 4.19 RT Kernel that came with the ti-processor-sdk-linux-rt-am335x-EVM-06.01.00.08 SDK. And the problem is gone since I updated to a newer Linux 4.19 RT Kernel.

    Regards,

    Marcel