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.

AM6442: PRU as ethernet interface

Part Number: AM6442


Hello

I have a board AM6442-SK. I want make PRU visible as ethernet interface in Linux. From the level of device tree k3-am642-sk.dts I added pinctrl to PRU0 and PRU1

&cpsw3g {
        pinctrl-names = "default";
        pinctrl-0 = <&mdio1_pins_default
                     &rgmii1_io_bus_pins_default
                     &rgmii2_service_pins_default
                     &rgmii3_pru0_pins_default
                     &rgmii4_pru1_pins_default
        >;

        cpts@3d000 {
                ti,pps = <7 1>;
        };
};

also in k3-am64-main.dtsi there is a node cpsw3g: ethernet@8000000.

Should I add also subnodes for PRU i ethernet-ports node like this?

ethernet-ports {

			#address-cells = <1>;

			#size-cells = <0>;



			cpsw_port1: port@1 {

				reg = <1>;

				ti,mac-only;

				label = "port1";

				phys = <&phy_gmii_sel 1>;

				mac-address = [00 00 00 00 00 00];

				ti,syscon-efuse = <&main_conf 0x200>;

			};



			cpsw_port2: port@2 {

				reg = <2>;

				ti,mac-only;

				label = "port2";

				phys = <&phy_gmii_sel 2>;

				mac-address = [00 00 00 00 00 00];

			};
			
			pru0_port2: port@3 {

				reg = <3>;

				ti,mac-only;

				label = "port3";

				phys = <&phy_gmii_sel 3>;

				mac-address = [00 00 00 00 00 00];

			};
			
			pru1_port3: port@4 {

				reg = <4>;

				ti,mac-only;

				label = "port4";

				phys = <&phy_gmii_sel 4>;

				mac-address = [00 00 00 00 00 00];

			};
			
			

		};

Also appropriate firmware is needed for PRU cores, I think. Where can I found it?

Is my method and understanding of this correct?

Thanks

BR

Jakub

  • Hello Jakub,

    As far as I was aware, we have not hooked up the PRU Ethernet signals to the PHYs on the AM64x Starter Kit. Have you modified the EVM hardware?

    On the AM64x EVM, we did multiplex one of the PHYs so that it can be controlled by either the CPSW or the PRUETH. Please see this post for more information:
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1137215/tmds64gpevm-eth1-port-is-cpsw-instead-of-prueth

    Regards,

    NIck

  • Hello Nick

    I have not modified AM6422-SK board but I tried this approach for out custom hardware board that will be available in close future. My question is what steps should be taken to make things work. I modified device tree like I show above. Is that correct? I also defined pins in rgmii3_pru0_pins_default and
    rgmii4_pru1_pins_default device tree node for PRU0 and PRU1.

    BR,

    Jakub

  • Where can I download specific firmware for PRU to work as ethernet interface?

  • Hello Jakub,

    Basic information about the AM64x

    The AM64x has two different Ethernet interfaces. The CPSW (called "cpsw3g" in the devicetree file you linked above), and the PRU_ICSSG subsystem configured for PRU Ethernet.

    The devicetree files are divided up like this:

    Processor definition:
    k3-am642.dtsi
    k3-am64.dtsi
    k3-am64-main.dtsi (main domain)
    k3-am64-mcu.dtsi (MCU domain)

    Board-level information & specific settings:
    everything else
    e.g., for AM64x general purpose EVM:
    k3-am642-evm.dts (default board)
    k3-am642-evm-icssg1-dualemac.dts (overlay that can be applied over the default board to configure 2 PRU Ethernet ports on AM64x EVM)

    Getting started resources 

    Please reference the two AM64x general purpose EVM devicetree files I listed above. This is TI's example for how to set up PRU Ethernet in the Linux devicetree.

    The PRU Ethernet binaries are included in the default filesystem image under /lib/firmware/ti-pruss. If needed, I can also point to the git repo where we publish the binaries for each SDK release.

    Regards,

    Nick

  • Hello Nick

    Thank you for explanation. I read post that you put here in earlier response. I also have TMDS64GPEVM board and I applied device tree overlay k3-am642-evm-icssg1-dualemac.dts but during booting some error occurred:

    [    2.402457] TI DP83869 300b2400.mdio:0f: attached PHY driver [TI DP83869] (mi_bus:phy_addr=300b2400.mdio:0f, irq=POLL)
    [    2.403189] icssg-prueth icssg1-eth: couldn't connect to phy ethernet-phy@3
    [    2.403214] Unable to handle kernel NULL pointer dereference at virtual adress 00000000000003a8
    et: set new flow-id-base 16
    [    2.472318] Mem abort info:
    [    2.475362]   ESR = 0x96000004
    [    2.479201]   EC = 0x25: DABT (current EL), IL = 32 bits
    [    2.485268]   SET = 0, FnV = 0
    [    2.488629]   EA = 0, S1PTW = 0
    [    2.492400] printk: console [ttyS2]: printing thread stopped
    [    2.492472] Data abort info:
    [    2.500939]   ISV = 0, ISS = 0x00000004
    [    2.504788]   CM = 0, WnR = 0
    [    2.507767] [00000000000003a8] user address but active_mm is swapper
    [    2.514134] Internal error: Oops: 96000004 [#1] PREEMPT_RT SMP
    [    2.519956] Modules linked in:
    

    I don't changed anything in k3-am642-evm.dts or overlay.

    In k3-am642-evm.dts there is a node:

    mdio_mux_1: mdio-mux-1 {
    
    		compatible = "mdio-mux-multiplexer";
    
    		mux-controls = <&mdio_mux>;
    
    		mdio-parent-bus = <&cpsw3g_mdio>;
    
    		#address-cells = <1>;
    
    		#size-cells = <0>;
    
    
    
    		mdio@1 {
    
    			reg = <0x1>;
    
    			#address-cells = <1>;
    
    			#size-cells = <0>;
    
    
    
    			cpsw3g_phy3: ethernet-phy@3 {
    
    				reg = <3>;
    
    				tx-internal-delay-ps = <250>;
    
    				rx-internal-delay-ps = <2000>;
    
    			};
    
    		};
    
    	};

     is that not create some conflict?

    It seems to me that function static int emac_phy_connect(struct prueth_emac *emac) call of_phy_connect() and this function returns NULL pointer.  It looks like it cannot find ethernet-phy@3 device. Why?

    Other question: Why k3-am642-evm-icssg1-dualemac.dts overlay has fragment number equal 101?

  • The PRU Ethernet binaries are included in the default filesystem image under /lib/firmware/ti-pruss. If needed, I can also point to the git repo where we publish the binaries for each SDK release.

    I'm using meta-ti layers for Yocto and I found firmware recipe for firmware. However please tell me which branch/commit you are used for latest stable SDK?

    How often do you updating meta-ti layers? Currently I'm using kirkstone yocto branch.

  • Hello Jakub,

    I'm not totally sure about the Yocto questions, I can reassign to a team member more familiar with Yocto to comment if you would like.

    This is the git repo that Yocto should be pulling from: 

    https://git.ti.com/cgit/processor-firmware/ti-linux-firmware/tree/ti-pruss?h=ti-linux-firmware

    If you look at the git log, we tagged the SDK releases.

    Regards,

    Nick

  • Hello Nick

    Thanks for response. What about this device tree error? Any hints why this ethernet-phy@3 device cannot be found? Cause I see this node is defined in k3-am642-evm.dts in mdio_mux_1 node.

    BR

    Jakub

  • Any update regarding this topic?