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.

AM6421: icssg1_eth in linux on AM6421

Part Number: AM6421

Tool/software:

HI,

     we are trying to add icss1-eth in our Custom Board on LInux A53 domain.

   we are using DP83822 PHY in RGMII mode

    we are using ti-processor-sdk-linux-rt-am64xx-evm-09.02.01.10 SDK.

   We are unable to integrate the icss1-eth.

   We observed below differences between running pre-buid images given in SDK with the Custom built image using the same SDK sources.

  Our Modified  DeviceTree


	aliases {
		ethernet2 = &icssg1_emac0;
		ethernet3 = &icssg1_emac1;
	};
	icssg1_eth: icssg1-eth {
	
		status = "okay";
		
		compatible = "ti,am642-icssg-prueth";
		pinctrl-names = "default";
		pinctrl-0 = <&icssg1_rgmii1_pins_default>;

		sram = <&oc_sram>;
		ti,prus = <&pru1_0>, <&rtu1_0>, <&tx_pru1_0>, <&pru1_1>, <&rtu1_1>, <&tx_pru1_1>;
		firmware-name = "ti-pruss/am65x-sr2-pru0-prueth-fw.elf",
				"ti-pruss/am65x-sr2-rtu0-prueth-fw.elf",
				"ti-pruss/am65x-sr2-txpru0-prueth-fw.elf",
				"ti-pruss/am65x-sr2-pru1-prueth-fw.elf",
				"ti-pruss/am65x-sr2-rtu1-prueth-fw.elf",
				"ti-pruss/am65x-sr2-txpru1-prueth-fw.elf";

		ti,pruss-gp-mux-sel = <2>,	/* MII mode */
				      <2>,
				      <2>,
				      <2>,	/* MII mode */
				      <2>,
				      <2>;

		ti,mii-g-rt = <&icssg1_mii_g_rt>;
		ti,mii-rt = <&icssg1_mii_rt>;
		ti,pa-stats = <&icssg1_pa_stats>;
		iep = <&icssg1_iep0>,  <&icssg1_iep1>;

		interrupt-parent = <&icssg1_intc>;
		interrupts = <24 0 2>, <25 1 3>;
		interrupt-names = "tx_ts0", "tx_ts1";

		dmas = <&main_pktdma 0xc200 15>, /* egress slice 0 */
		       <&main_pktdma 0xc201 15>, /* egress slice 0 */
		       <&main_pktdma 0xc202 15>, /* egress slice 0 */
		       <&main_pktdma 0xc203 15>, /* egress slice 0 */
		       <&main_pktdma 0xc204 15>, /* egress slice 1 */
		       <&main_pktdma 0xc205 15>, /* egress slice 1 */
		       <&main_pktdma 0xc206 15>, /* egress slice 1 */
		       <&main_pktdma 0xc207 15>, /* egress slice 1 */
		       <&main_pktdma 0x4200 15>, /* ingress slice 0 */
		       <&main_pktdma 0x4201 15>, /* ingress slice 1 */
		       <&main_pktdma 0x4202 0>, /* mgmnt rsp slice 0 */
		       <&main_pktdma 0x4203 0>; /* mgmnt rsp slice 1 */
		dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3",
			    "tx1-0", "tx1-1", "tx1-2", "tx1-3",
			    "rx0", "rx1";

		ethernet-ports {
			#address-cells = <1>;
			#size-cells = <0>;
			icssg1_emac0: port@0 {
				reg = <0>;
				phy-handle = <&icssg1_phy1>;
				phy-mode = "rgmii-id";
				ti,syscon-rgmii-delay = <&main_conf 0x4110>;
				/* Filled in by bootloader */
				local-mac-address = [00 00 00 00 00 00];
				#if 0
				fixed-link {
					speed = <100>;
					full-duplex;
				};
				#endif
				
				//status = "disabled"; //added by us
			};
			icssg1_emac1: port@1 {
				reg = <1>;
				ti,syscon-rgmii-delay = <&main_conf 0x4114>;
				/* Filled in by bootloader */
				local-mac-address = [00 00 00 00 00 00];
				status = "disabled";
				#if 0
				fixed-link {
					speed = <100>;
					full-duplex;
				};
				#endif
			};
			
		};
	};
};

&icssg1_mdio {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&icssg1_mdio1_pins_default>;

	icssg1_phy1: ethernet-phy@2 {
		reg = <0x02>;		//<0xf>;
		tx-internal-delay-ps = <250>;
		rx-internal-delay-ps = <2000>;
	};
};

	icssg1_mdio1_pins_default: icssg1-mdio1-pins-default {
		pinctrl-single,pins = <
			AM64X_IOPAD(0x015c, PIN_OUTPUT, 0) // (Y6) PRG1_MDIO0_MDC  
			AM64X_IOPAD(0x0158, PIN_INPUT, 0) // (AA6) PRG1_MDIO0_MDIO  
		>;
	};

	icssg1_rgmii1_pins_default: icssg1-rgmii1-pins-default {
		pinctrl-single,pins = <
			AM64X_IOPAD(0x00b8, PIN_INPUT, 2) // (Y7) PRG1_PRU0_GPO0.PRG1_RGMII1_RD0  
			AM64X_IOPAD(0x00bc, PIN_INPUT, 2) // (U8) PRG1_PRU0_GPO1.PRG1_RGMII1_RD1  
			AM64X_IOPAD(0x00c0, PIN_INPUT, 2) // (W8) PRG1_PRU0_GPO2.PRG1_RGMII1_RD2  
			AM64X_IOPAD(0x00c4, PIN_INPUT, 2) // (V8) PRG1_PRU0_GPO3.PRG1_RGMII1_RD3  
			AM64X_IOPAD(0x00d0, PIN_INPUT, 2) // (AA7) PRG1_PRU0_GPO6.PRG1_RGMII1_RXC  
			AM64X_IOPAD(0x00c8, PIN_INPUT, 2) // (Y8) PRG1_PRU0_GPO4.PRG1_RGMII1_RX_CTL 
			AM64X_IOPAD(0x00e4, PIN_INPUT, 2) // (AA8) PRG1_PRU0_GPO11.PRG1_RGMII1_TD0 
			AM64X_IOPAD(0x00e8, PIN_INPUT, 2) // (U9) PRG1_PRU0_GPO12.PRG1_RGMII1_TD1 
			AM64X_IOPAD(0x00ec, PIN_INPUT, 2) // (W9) PRG1_PRU0_GPO13.PRG1_RGMII1_TD2  
			AM64X_IOPAD(0x00f0, PIN_INPUT, 2) //(AA9) PRG1_PRU0_GPO14.PRG1_RGMII1_TD3  
			AM64X_IOPAD(0x00f8, PIN_INPUT, 2) // (V9) PRG1_PRU0_GPO16.PRG1_RGMII1_TXC  
			AM64X_IOPAD(0x00f4, PIN_INPUT, 2) // (Y9) PRG1_PRU0_GPO15.PRG1_RGMII1_TX_CTL
		>;
	};

	icssg1_iep0_pins_default: icssg1-iep0-pins-default {
		pinctrl-single,pins = <
			AM64X_IOPAD(0x0104, PIN_OUTPUT, 2) // (W7) PRG1_PRU0_GPO19.PRG1_IEP0_EDC_SYNC_OUT0
		>;
	};
	
&icssg1 {
	status = "okay";		//added by us
};

 Below is the dmesg output for EVM with prebuilt images

root@am64xx-evm:~# dmesg | grep pru
[    5.918961] remoteproc remoteproc5: 3000a000.txpru is available
[    5.923951] remoteproc remoteproc6: 3000c000.txpru is available
[    5.932726] remoteproc remoteproc7: 3008a000.txpru is available
[    5.937531] remoteproc remoteproc8: 3008c000.txpru is available
[    7.392009] remoteproc remoteproc9: 30034000.pru is available
[    7.398963] remoteproc remoteproc11: 30038000.pru is available
[    7.410210] remoteproc remoteproc13: 300b4000.pru is available
[    7.523399] icssg-prueth icssg1-eth: TI PRU ethernet driver initialized: single EMAC mode
[    7.524713] remoteproc remoteproc15: 300b8000.pru is available
[   10.671203] remoteproc remoteproc13: powering up 300b4000.pru
[   10.673803] remoteproc remoteproc13: Booting fw image ti-pruss/am65x-sr2-pru0-prueth-fw.elf, size 40816
[   10.673873] remoteproc remoteproc13: remote processor 300b4000.pru is now up
[   10.678180] remoteproc remoteproc14: Booting fw image ti-pruss/am65x-sr2-rtu0-prueth-fw.elf, size 30888
[   10.678277] remoteproc remoteproc7: powering up 3008a000.txpru
[   10.679644] remoteproc remoteproc7: Booting fw image ti-pruss/am65x-sr2-txpru0-prueth-fw.elf, size 36672
[   10.679715] remoteproc remoteproc7: remote processor 3008a000.txpru is now up


root@am64xx-evm:~# dmesg | grep mdio
[    1.101896] davinci_mdio 8000f00.mdio: Configuring MDIO in manual mode
[    1.136171] davinci_mdio 8000f00.mdio: davinci mdio revision 9.7, bus freq 1000000
[    1.137803] davinci_mdio 8000f00.mdio: phy[0]: device 8000f00.mdio:00, driver TI DP83867
[    4.784855] davinci_mdio 300b2400.mdio: Configuring MDIO in manual mode
[    4.841271] davinci_mdio 300b2400.mdio: davinci mdio revision 1.7, bus freq 1000000
[    4.939987] davinci_mdio 300b2400.mdio: phy[15]: device 300b2400.mdio:0f, driver TI DP83869
[    7.523351] TI DP83869 300b2400.mdio:0f: attached PHY driver (mii_bus:phy_addr=300b2400.mdio:0f, irq=POLL)
[   10.745464] am65-cpsw-nuss 8000000.ethernet eth1: PHY [mdio_mux-0.1:03] driver [TI DP83869] (irq=POLL)
[   10.797082] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=POLL)


root@am64xx-evm:~#  ls -l /lib/firmware/ti-pruss/
total 676
-rw-r--r-- 1 root root 40816 Mar  9  2018 am65x-sr2-pru0-prueth-fw.elf
-rw-r--r-- 1 root root 37976 Mar  9  2018 am65x-sr2-pru0-pruhsr-fw.elf
-rw-r--r-- 1 root root 45640 Mar  9  2018 am65x-sr2-pru0-prusw-fw.elf
-rw-r--r-- 1 root root 41092 Mar  9  2018 am65x-sr2-pru1-prueth-fw.elf
-rw-r--r-- 1 root root 38208 Mar  9  2018 am65x-sr2-pru1-pruhsr-fw.elf
-rw-r--r-- 1 root root 45912 Mar  9  2018 am65x-sr2-pru1-prusw-fw.elf
-rw-r--r-- 1 root root 30888 Mar  9  2018 am65x-sr2-rtu0-prueth-fw.elf
-rw-r--r-- 1 root root 34632 Mar  9  2018 am65x-sr2-rtu0-pruhsr-fw.elf
-rw-r--r-- 1 root root 32208 Mar  9  2018 am65x-sr2-rtu0-prusw-fw.elf
-rw-r--r-- 1 root root 30124 Mar  9  2018 am65x-sr2-rtu1-prueth-fw.elf
-rw-r--r-- 1 root root 33844 Mar  9  2018 am65x-sr2-rtu1-pruhsr-fw.elf
-rw-r--r-- 1 root root 31440 Mar  9  2018 am65x-sr2-rtu1-prusw-fw.elf
-rw-r--r-- 1 root root 36672 Mar  9  2018 am65x-sr2-txpru0-prueth-fw.elf
-rw-r--r-- 1 root root 36128 Mar  9  2018 am65x-sr2-txpru0-pruhsr-fw.elf
-rw-r--r-- 1 root root 36072 Mar  9  2018 am65x-sr2-txpru0-prusw-fw.elf
-rw-r--r-- 1 root root 35184 Mar  9  2018 am65x-sr2-txpru1-prueth-fw.elf
-rw-r--r-- 1 root root 34636 Mar  9  2018 am65x-sr2-txpru1-pruhsr-fw.elf
-rw-r--r-- 1 root root 34584 Mar  9  2018 am65x-sr2-txpru1-prusw-fw.elf

  Below is the dmesg output from our custom board with image built using the same SDK

root@am64xx-evm:~# dmesg | grep pru
[    8.990535] remoteproc remoteproc3: 3008a000.txpru is available
[    9.004756] remoteproc remoteproc4: 3008c000.txpru is available
[   10.942647] remoteproc remoteproc5: 300b4000.pru is available
[   10.946757] remoteproc remoteproc7: 300b8000.pru is available
[   10.988898] icssg-prueth icssg1-eth: port 1: using random MAC addr: 2e:b5:4a:f7:8b:ad
[   11.200962] icssg-prueth icssg1-eth: TI PRU ethernet driver initialized: single EMAC mode
[   14.778202] remoteproc remoteproc5: powering up 300b4000.pru
[   14.794608] remoteproc remoteproc5: Booting fw image ti-pruss/am65x-sr2-pru0-prueth-fw.elf, size 38800
[   14.794677] remoteproc remoteproc5: remote processor 300b4000.pru is now up
[   14.797244] remoteproc remoteproc6: Booting fw image ti-pruss/am65x-sr2-rtu0-prueth-fw.elf, size 30968
[   14.797336] remoteproc remoteproc3: powering up 3008a000.txpru
[   14.800883] remoteproc remoteproc3: Booting fw image ti-pruss/am65x-sr2-txpru0-prueth-fw.elf, size 37328
[   14.800948] remoteproc remoteproc3: remote processor 3008a000.txpru is now up
[   14.801002] icssg-prueth icssg1-eth eth1: Failed to update Rx Flow ID -22
[   14.801015] remoteproc remoteproc3: stopped remote processor 3008a000.txpru
[   14.801036] remoteproc remoteproc5: stopped remote processor 300b4000.pru



root@am64xx-evm:~# dmesg | grep mdio
[    1.420830] davinci_mdio 8000f00.mdio: Configuring MDIO in manual mode
[    1.454424] davinci_mdio 8000f00.mdio: davinci mdio revision 9.7, bus freq 1000000
[    1.462759] davinci_mdio 8000f00.mdio: phy[0]: device 8000f00.mdio:00, driver TI DP83822
[    7.328751] davinci_mdio 300b2400.mdio: Configuring MDIO in manual mode
[    7.362521] davinci_mdio 300b2400.mdio: davinci mdio revision 1.7, bus freq 1000000
[    7.438926] davinci_mdio 300b2400.mdio: phy[2]: device 300b2400.mdio:02, driver TI DP83822
[   15.353893] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83822] (irq=POLL)


root@am64xx-evm:~#  ls -l /lib/firmware/ti-pruss/
total 664
-rw-r--r-- 1 root root 38800 Mar  9  2018 am65x-sr2-pru0-prueth-fw.elf
-rw-r--r-- 1 root root 38360 Mar  9  2018 am65x-sr2-pru0-pruhsr-fw.elf
-rw-r--r-- 1 root root 43624 Mar  9  2018 am65x-sr2-pru0-prusw-fw.elf
-rw-r--r-- 1 root root 39072 Mar  9  2018 am65x-sr2-pru1-prueth-fw.elf
-rw-r--r-- 1 root root 38576 Mar  9  2018 am65x-sr2-pru1-pruhsr-fw.elf
-rw-r--r-- 1 root root 43876 Mar  9  2018 am65x-sr2-pru1-prusw-fw.elf
-rw-r--r-- 1 root root 30968 Mar  9  2018 am65x-sr2-rtu0-prueth-fw.elf
-rw-r--r-- 1 root root 33160 Mar  9  2018 am65x-sr2-rtu0-pruhsr-fw.elf
-rw-r--r-- 1 root root 32252 Mar  9  2018 am65x-sr2-rtu0-prusw-fw.elf
-rw-r--r-- 1 root root 30204 Mar  9  2018 am65x-sr2-rtu1-prueth-fw.elf
-rw-r--r-- 1 root root 32372 Mar  9  2018 am65x-sr2-rtu1-pruhsr-fw.elf
-rw-r--r-- 1 root root 31500 Mar  9  2018 am65x-sr2-rtu1-prusw-fw.elf
-rw-r--r-- 1 root root 37328 Mar  9  2018 am65x-sr2-txpru0-prueth-fw.elf
-rw-r--r-- 1 root root 36328 Mar  9  2018 am65x-sr2-txpru0-pruhsr-fw.elf
-rw-r--r-- 1 root root 36648 Mar  9  2018 am65x-sr2-txpru0-prusw-fw.elf
-rw-r--r-- 1 root root 35836 Mar  9  2018 am65x-sr2-txpru1-prueth-fw.elf
-rw-r--r-- 1 root root 34836 Mar  9  2018 am65x-sr2-txpru1-pruhsr-fw.elf
-rw-r--r-- 1 root root 35156 Mar  9  2018 am65x-sr2-txpru1-prusw-fw.elf

We see there is a difference in pru firmware between on prebuilt image and custom built using source with same sdk.

 Also there is an error on custom board


[   14.801002] icssg-prueth icssg1-eth eth1: Failed to update Rx Flow ID -22
[   14.801015] remoteproc remoteproc3: stopped remote processor 3008a000.txpru
[   14.801036] remoteproc remoteproc5: stopped remote processor 300b4000.pru

   Please suggest what  we are missing to get icss1-eth  working.

 Thank You