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/AM3359: icss-emac test on custom board with linux uio_module_drv

Part Number: AM3359

Tool/software: Linux

Hi Team,

I confront with a problem in testing icss-emac on our custom board.

Problem description:

 it looks like no frame send out when execute icss_emacMainTest_am335x.out.

Custom board hardware description:

same as https://e2e.ti.com/support/processors/f/791/t/793086?tisearch=e2e-sitesearch&keymatch=%20user:380684  

software description:

1 gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf 

2 am335x-evm-linux-rt-sdk-src-04.03.00.05

3 the file system is created by buildroot

icss_emacMainTest_am335x.out is copyed from TI's file system 'arago'.

uio_module_drv  moudle is compiled from am335x-evm-linux-rt-sdk-src-04.03.00.05.tar\am335x-evm-linux-rt-sdk-src-04.03.00.05\board-support\extra-drivers\uio-module-drv-2.2.1.0+gitAUTOINC+bda9260f22

dts file:

/*
 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
/dts-v1/;

#include "am33xx.dtsi"
#include <dt-bindings/interrupt-controller/irq.h>

/ {
	model = "TI AM3359 ICE-V2";
	compatible = "ti,am3359-icev2", "ti,am33xx";

	cpus {
		cpu@0 {
			cpu0-supply = <&vdd1_reg>;
		};
	};

	memory@80000000 {
		device_type = "memory";
		reg = <0x80000000 0x10000000>; /* 256 MB */
	};

	chosen {
		stdout-path = &uart0;
	};

	vbat: fixedregulator0 {
		compatible = "regulator-fixed";
		regulator-name = "vbat";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-boot-on;
	};

	lis3_reg: fixedregulator1 {
		compatible = "regulator-fixed";
		regulator-name = "lis3_reg";
		regulator-boot-on;
	};
	
	/* Dual mac ethernet application node on icss */
	pruss_eth {
		compatible = "ti,am3359-prueth";
		pruss = <&pruss>;
		sram = <&ocmcram>;
		interrupt-parent = <&pruss_intc>;
		status = "disabled";

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

		pruss_emac0: ethernet-mii0 {
			phy-handle = <&pruss_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];
		};

		pruss_emac1: ethernet-mii1 {
			phy-handle = <&pruss_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];
		};
	};
};

&am33xx_pinmux {
	pinctrl-names = "default";

	i2c0_pins: pinmux_i2c0_pins {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
			AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
		>;
	};

	i2c1_pins: pinmux_i2c1_pins {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_d1.i2c1_sda */
			AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_cs0.i2c1_scl */
		>;
	};

	uart0_pins: pinmux_uart0_pins {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)	/* uart0_rxd.uart0_rxd */
			AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart0_txd.uart0_txd */
		>;
	};

	uart1_pins: pinmux_uart1_pins {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x978, PIN_INPUT | MUX_MODE0)		/* uart1_ctsn.uart1_ctsn */
			AM33XX_IOPAD(0x97C, PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart1_rtsn.uart1_rtsn */
			AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0)	/* uart1_rxd.uart1_rxd */
			AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart1_txd.uart1_txd */
		>;
	};

	nandflash_pins_s0: nandflash_pins_s0 {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad0.gpmc_ad0 */
			AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad1.gpmc_ad1 */
			AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad2.gpmc_ad2 */
			AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad3.gpmc_ad3 */
			AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad4.gpmc_ad4 */
			AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad5.gpmc_ad5 */
			AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad6.gpmc_ad6 */
			AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad7.gpmc_ad7 */
			//AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_wait0.gpmc_wait0 */
			//AM33XX_IOPAD(0x874, PIN_INPUT_PULLUP | MUX_MODE7)	/* gpmc_wpn.gpio0_30 */
			AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE0)		/* gpmc_csn0.gpmc_csn0  */
			AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE0)		/* gpmc_advn_ale.gpmc_advn_ale */
			AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE0)		/* gpmc_oen_ren.gpmc_oen_ren */
			AM33XX_IOPAD(0x898, PIN_OUTPUT | MUX_MODE0)		/* gpmc_wen.gpmc_wen */
			AM33XX_IOPAD(0x89c, PIN_OUTPUT | MUX_MODE0)		/* gpmc_be0n_cle.gpmc_be0n_cle */
		>;
	};

	cpsw_default: cpsw_default {
		pinctrl-single,pins = <
			/* Slave 1 */
			0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* mii1_txen.rgmii1_tctl */
			0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* mii1_txd1.rgmii1_td1 */
			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* mii1_txd0.rgmii1_td0 */
			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE1)	/* mii1_rxd1.rgmii1_rd1 */
			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE1)	/* mii1_rxd0.rgmii1_rd0 */
			0x10C (PIN_INPUT_PULLDOWN | MUX_MODE1)	/* mii1_crs */
			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE1)	/* mii1_rx_er */
			0x144 (PIN_INPUT_PULLDOWN | MUX_MODE0)	/* mii1_ref_clk */
		>;
	};

	cpsw_sleep: cpsw_sleep {
		pinctrl-single,pins = <
			/* Slave 1 reset value */
			0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* mii1_txen.rgmii1_tctl */
			0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* mii1_txd1.rgmii1_td1 */
			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* mii1_txd0.rgmii1_td0 */
			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* mii1_rxd1.rgmii1_rd1 */
			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* mii1_rxd0.rgmii1_rd0 */
			0x10C (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* mii1_crs */
			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* mii1_rx_er */
			0x144 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* mii1_ref_clk */
		>;
	};

	davinci_mdio_default: davinci_mdio_default {
		pinctrl-single,pins = <
			/* MDIO */
			AM33XX_IOPAD(0x948, (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0))	/* mdio_data.mdio_data */
			AM33XX_IOPAD(0x94c, (PIN_OUTPUT_PULLUP | MUX_MODE0))			/* mdio_clk.mdio_clk */
			AM33XX_IOPAD(0x8e0, PIN_OUTPUT | MUX_MODE7)		/* PHY-SELECT */
			AM33XX_IOPAD(0x9a4, PIN_OUTPUT | MUX_MODE7)		/* PHY-RESET */
		>;
	};

	davinci_mdio_sleep: davinci_mdio_sleep {
		pinctrl-single,pins = <
			/* MDIO reset value */
			AM33XX_IOPAD(0x948, (PIN_INPUT_PULLDOWN | MUX_MODE7))
			AM33XX_IOPAD(0x94c, (PIN_INPUT_PULLDOWN | MUX_MODE7))
		>;
	};
	
	pruss_mdio_default: pruss_mdio_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x88c, (PIN_OUTPUT | MUX_MODE5))		/* gpmc_clk.pr1_mdio_mdclk */
			AM33XX_IOPAD(0x888, (PIN_INPUT  | MUX_MODE5))		/* gpmc_csn3.pr1_mdio_data */
			//AM33XX_IOPAD(0x89c, (PIN_INPUT_PULLUP | MUX_MODE7))	/* gpmc_ben0_cle.gpio2_5 */
		>;
	};
	
	pruss_eth_default: pruss_eth_default {
		pinctrl-single,pins = <
			0x20 ( PIN_INPUT | MUX_MODE5 ) /* (U10) gpmc_ad8.pr1_mii_mt0_clk */
			0x38 ( PIN_OUTPUT | MUX_MODE5 ) /* (V13) gpmc_ad14.pr1_mii0_txd0 */
			0x34 ( PIN_OUTPUT | MUX_MODE5 ) /* (R12) gpmc_ad13.pr1_mii0_txd1 */
			0x30 ( PIN_OUTPUT | MUX_MODE5 ) /* (T12) gpmc_ad12.pr1_mii0_txd2 */
			0x2c ( PIN_OUTPUT | MUX_MODE5 ) /* (U12) gpmc_ad11.pr1_mii0_txd3 */
			0xcc ( PIN_INPUT | MUX_MODE5 ) /* (U4) lcd_data11.pr1_mii0_rxd0 */
			0xc8 ( PIN_INPUT | MUX_MODE5 ) /* (U3) lcd_data10.pr1_mii0_rxd1 */
			0xc4 ( PIN_INPUT | MUX_MODE5 ) /* (U2) lcd_data9.pr1_mii0_rxd2 */
			0xc0 ( PIN_INPUT | MUX_MODE5 ) /* (U1) lcd_data8.pr1_mii0_rxd3 */
			0x28 ( PIN_OUTPUT | MUX_MODE5 ) /* (T11) gpmc_ad10.pr1_mii0_txen */
			0xd8 ( PIN_INPUT | MUX_MODE5 ) /* (V4) lcd_data14.pr1_mii_mr0_clk */
			0xdc ( PIN_INPUT | MUX_MODE5 ) /* (T5) lcd_data15.pr1_mii0_rxdv */
			0xd4 ( PIN_INPUT | MUX_MODE5 ) /* (V3) lcd_data13.pr1_mii0_rxer */
			0xd0 ( PIN_INPUT | MUX_MODE5 ) /* (V2) lcd_data12.pr1_mii0_rxlink */
			0xe8 ( PIN_INPUT | MUX_MODE2 ) /* (V5) lcd_pclk.pr1_mii0_crs */
			//0x24 ( PIN_INPUT | MUX_MODE5 ) /* (T10) gpmc_ad9.pr1_mii0_col */

			AM33XX_IOPAD(0x840, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a0.pr1_mii_mt1_clk */
			AM33XX_IOPAD(0x850, (PIN_OUTPUT | MUX_MODE5))	/* gpmc_a4.pr1_mii1_txd0 */
			AM33XX_IOPAD(0x84c, (PIN_OUTPUT | MUX_MODE5))	/* gpmc_a3.pr1_mii1_txd1 */
			AM33XX_IOPAD(0x848, (PIN_OUTPUT | MUX_MODE5))	/* gpmc_a2.pr1_mii1_txd2 */
			AM33XX_IOPAD(0x844, (PIN_OUTPUT | MUX_MODE5))	/* gpmc_a1.pr1_mii1_txd3 */
			AM33XX_IOPAD(0x860, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a8.pr1_mii1_rxd0 */
			AM33XX_IOPAD(0x85c, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a7.pr1_mii1_rxd1 */
			AM33XX_IOPAD(0x858, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a6.pr1_mii1_rxd2 */
			AM33XX_IOPAD(0x854, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a5.pr1_mii1_rxd3 */
			AM33XX_IOPAD(0x874, (PIN_OUTPUT | MUX_MODE5))	/* gpmc_wpn.pr1_mii1_txen */
			AM33XX_IOPAD(0x864, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a9.pr1_mii_mr1_clk */
			AM33XX_IOPAD(0x868, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a10.pr1_mii1_rxdv */
			AM33XX_IOPAD(0x86c, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a11.pr1_mii1_rxer */
			AM33XX_IOPAD(0x878, (PIN_INPUT  | MUX_MODE5))	/* gpmc_ben1.pr1_mii1_rxlink */
			AM33XX_IOPAD(0x8ec, (PIN_INPUT  | MUX_MODE2))	/* lcd_ac_bias_en.pr1_mii1_crs */
			//AM33XX_IOPAD(0x870, (PIN_INPUT  | MUX_MODE5))	/* gpmc_wait0.pr1_mii1_col */
		>;
	};	
};

&uart0 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart0_pins>;

	status = "okay";
};

&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart1_pins>;

	status = "okay";
};

&i2c0 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c0_pins>;

	status = "okay";
	clock-frequency = <400000>;

	tps: tps@2d {
		reg = <0x2d>;
	};
};

&cppi41dma  {
	status = "okay";
};

&i2c1 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c1_pins>;

	status = "disable";
	clock-frequency = <100000>;
};

&elm {
	status = "okay";
};

&gpmc {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&nandflash_pins_s0>;
	ranges = <0 0 0x08000000 0x1000000>;	/* CS0: 16MB for NAND */
	nand@0,0 {
		compatible = "ti,omap2-nand";
		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
		interrupt-parent = <&gpmc>;
		interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
			     <1 IRQ_TYPE_NONE>;	/* termcount */
		rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
		ti,nand-xfer-type = "prefetch-dma";
		ti,nand-ecc-opt = "bch8";
		ti,elm-id = <&elm>;
		nand-bus-width = <8>;
		gpmc,device-width = <1>;
		gpmc,sync-clk-ps = <0>;
		gpmc,cs-on-ns = <0>;
		gpmc,cs-rd-off-ns = <44>;
		gpmc,cs-wr-off-ns = <44>;
		gpmc,adv-on-ns = <6>;
		gpmc,adv-rd-off-ns = <34>;
		gpmc,adv-wr-off-ns = <44>;
		gpmc,we-on-ns = <0>;
		gpmc,we-off-ns = <40>;
		gpmc,oe-on-ns = <0>;
		gpmc,oe-off-ns = <54>;
		gpmc,access-ns = <64>;
		gpmc,rd-cycle-ns = <82>;
		gpmc,wr-cycle-ns = <82>;
		gpmc,bus-turnaround-ns = <0>;
		gpmc,cycle2cycle-delay-ns = <0>;
		gpmc,clk-activation-ns = <0>;
		gpmc,wr-access-ns = <40>;
		gpmc,wr-data-mux-bus-ns = <0>;
		/* MTD partition table */
		/* All SPL-* partitions are sized to minimal length
		 * which can be independently programmable. For
		 * NAND flash this is equal to size of erase-block */
		#address-cells = <1>;
		#size-cells = <1>;
		/* MTD partition table */
		partition@0 {
			label = "SPL1";
			reg = <0x00000000 0x000020000>;
		};

		partition@1 {
			label = "SPL2";
			reg = <0x00020000 0x00020000>;
		};

		partition@2 {
			label = "SPL3";
			reg = <0x00040000 0x00020000>;
		};

		partition@3 {
			label = "SPL4";
			reg = <0x00060000 0x00020000>;
		};

		partition@4 {
			label = "U-boot";
			reg = <0x00080000 0x001e0000>;
		};

		partition@5 {
			label = "environment";
			reg = <0x00260000 0x00020000>;
		};

		partition@6 {
			label = "Kernel";
			reg = <0x00280000 0x00500000>;
		};

		partition@7 {
			label = "File-System";
			reg = <0x00780000 0x0f880000>;
		};
	};
};

#include "tps65910.dtsi"

&tps {
	vcc1-supply = <&vbat>;
	vcc2-supply = <&vbat>;
	vcc3-supply = <&vbat>;
	vcc4-supply = <&vbat>;
	vcc5-supply = <&vbat>;
	vcc6-supply = <&vbat>;
	vcc7-supply = <&vbat>;
	vccio-supply = <&vbat>;

	regulators {
		vrtc_reg: regulator@0 {
			regulator-always-on;
		};

		vio_reg: regulator@1 {
			regulator-always-on;
		};

		vdd1_reg: regulator@2 {
			/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
			regulator-name = "vdd_mpu";
			regulator-min-microvolt = <912500>;
			regulator-max-microvolt = <1351500>;
			regulator-boot-on;
			regulator-always-on;
		};

		vdd2_reg: regulator@3 {
			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
			regulator-name = "vdd_core";
			regulator-min-microvolt = <912500>;
			regulator-max-microvolt = <1150000>;
			regulator-boot-on;
			regulator-always-on;
		};

		vdd3_reg: regulator@4 {
			regulator-always-on;
		};

		vdig1_reg: regulator@5 {
			regulator-always-on;
		};

		vdig2_reg: regulator@6 {
			regulator-always-on;
		};

		vpll_reg: regulator@7 {
			regulator-always-on;
		};

		vdac_reg: regulator@8 {
			regulator-always-on;
		};

		vaux1_reg: regulator@9 {
			regulator-always-on;
		};

		vaux2_reg: regulator@10 {
			regulator-always-on;
		};

		vaux33_reg: regulator@11 {
			regulator-always-on;
		};

		vmmc_reg: regulator@12 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
		};
	};
};

&mac {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&cpsw_default>;
	pinctrl-1 = <&cpsw_sleep>;
	slaves = <1>;
	status = "okay";
};

&davinci_mdio {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&davinci_mdio_default>;
	pinctrl-1 = <&davinci_mdio_sleep>;
	status = "okay";
	reset-gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
	reset-delay-us = <2>;   /* PHY datasheet states 1uS min */
};

&cpsw_emac0 {
	phy_id = <&davinci_mdio>, <1>;
	phy-mode = "rmii";
};

&phy_sel {
        rmii-clock-ext = <1>;
};

&pruss_soc_bus {
	status = "okay";

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

		pru0: pru@4a334000 {
			status = "okay";
		};

		pru1: pru@4a338000 {
			status = "okay";
		};
	};
};

&pruss_mdio {
	pinctrl-0 = <&pruss_mdio_default>;
	pinctrl-names = "default";
	reset-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>;
	reset-delay-us = <2>; /* PHY datasheet states 1uS min */
	status = "disabled";

	pruss_eth0_phy: ethernet-phy@1 {
		 reg = <1>;
	 };

	pruss_eth1_phy: ethernet-phy@0 {
		 reg = <0>;
	 };
};


&pruss_soc_bus {
		uio_pruss_mdio: uio_pruss_mdio@4a332400 {
			compatible = "ti,davinci_mdio";
			reg = <0x4a332400 0x90>;
			clocks = <&dpll_core_m4_ck>;
			clock-names = "fck";
			bus_freq = <1000000>;
			#address-cells = <1>;
			#size-cells = <0>;
			status = "disabled";
		};

		uio_pruss_mem: uio_pruss_mem {
			compatible = "ti,uio-module-drv";
			mem = <0x4a300000 0x2000>,
			      <0x4a302000 0x2000>,
			      <0x4a310000 0x3000>,
			      <0x4a320000 0x2000>,
			      <0x4a326000 0x2000>,
			      <0x4a32e000 0x31c>,
			      <0x4a332000 0x58>;
			mem-names = "dram0", "dram1", "shrdram2", "intc", "cfg",
				    "iep", "mii_rt";

			status = "okay";
		};
		uio_pruss_mem2: uio_pruss_mem2 {
			compatible = "ti,uio-module-drv";
			mem = <0x4a328000 0xd4>,
			      <0x4a330000 0x174>,
			      <0x4a332400 0x90>,
			      <0x40302000 0x0e000>;
			mem-names = "uart", "ecap", "mdio", "ocmc";
			status = "okay";
		};

		uio_pruss_evt0: uio_pruss_evt0 {
			compatible = "ti,uio-module-drv";
                        interrupts = <20>;
			interrupt-mode = <1>;
			status = "okay";
		};
		uio_pruss_evt1: uio_pruss_evt1 {
			compatible = "ti,uio-module-drv";
                        interrupts = <21>;
			interrupt-mode = <1>;
			status = "okay";
		};
		uio_pruss_evt2: uio_pruss_evt2 {
			compatible = "ti,uio-module-drv";
                        interrupts = <22>;
			interrupt-mode = <1>;
			status = "okay";
		};
		uio_pruss_evt3: uio_pruss_evt3 {
			compatible = "ti,uio-module-drv";
                        interrupts = <23>;
			interrupt-mode = <1>;
			status = "okay";
		};
		uio_pruss_evt4: uio_pruss_evt4 {
			compatible = "ti,uio-module-drv";
                        interrupts = <24>;
			interrupt-mode = <1>;
			status = "okay";
		};
		uio_pruss_evt5: uio_pruss_evt5 {
			compatible = "ti,uio-module-drv";
                        interrupts = <25>;
			interrupt-mode = <1>;
			status = "okay";
		};
		uio_pruss_evt6: uio_pruss_evt6 {
			compatible = "ti,uio-module-drv";
                        interrupts = <26>;
			interrupt-mode = <1>;
			status = "okay";
		};
		uio_pruss_evt7: uio_pruss_evt7 {
			compatible = "ti,uio-module-drv";
                        interrupts = <27>;
			interrupt-mode = <1>;
			status = "okay";
		};

		uio_pruss_0_mem: uio_pruss_0_mem {
			compatible = "ti,uio-module-drv";
			mem = <0x4a334000 0x2000>,
			      <0x4a322000 0x400>,
			      <0x4a322400 0x100>;
			mem-names = "iram", "control", "debug";
			status = "okay";
		};

		uio_pruss_1_mem: uio_pruss_1_mem {
			compatible = "ti,uio-module-drv";
			mem = <0x4a338000 0x2000>,
			      <0x4a324000 0x400>,
			      <0x4a324400 0x100>;
			mem-names = "iram", "control", "debug";
			status = "okay";
		};
};

&am33xx_pinmux {
	uio_pruss_mdio_eth_default: uio_pruss_mdio_eht_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x88c, (PIN_OUTPUT | MUX_MODE5))           /* gpmc_clk.pr1_mdio_mdclk */
			AM33XX_IOPAD(0x888, (PIN_INPUT  | MUX_MODE5))           /* gpmc_csn3.pr1_mdio_data */
			0x20 ( PIN_INPUT | MUX_MODE5 ) /* (U10) gpmc_ad8.pr1_mii_mt0_clk */
			0x38 ( PIN_OUTPUT | MUX_MODE5 ) /* (V13) gpmc_ad14.pr1_mii0_txd0 */
			0x34 ( PIN_OUTPUT | MUX_MODE5 ) /* (R12) gpmc_ad13.pr1_mii0_txd1 */
			0x30 ( PIN_OUTPUT | MUX_MODE5 ) /* (T12) gpmc_ad12.pr1_mii0_txd2 */
			0x2c ( PIN_OUTPUT | MUX_MODE5 ) /* (U12) gpmc_ad11.pr1_mii0_txd3 */
			0xcc ( PIN_INPUT | MUX_MODE5 ) /* (U4) lcd_data11.pr1_mii0_rxd0 */
			0xc8 ( PIN_INPUT | MUX_MODE5 ) /* (U3) lcd_data10.pr1_mii0_rxd1 */
			0xc4 ( PIN_INPUT | MUX_MODE5 ) /* (U2) lcd_data9.pr1_mii0_rxd2 */
			0xc0 ( PIN_INPUT | MUX_MODE5 ) /* (U1) lcd_data8.pr1_mii0_rxd3 */
			0x28 ( PIN_OUTPUT | MUX_MODE5 ) /* (T11) gpmc_ad10.pr1_mii0_txen */
			0xd8 ( PIN_INPUT | MUX_MODE5 ) /* (V4) lcd_data14.pr1_mii_mr0_clk */
			0xdc ( PIN_INPUT | MUX_MODE5 ) /* (T5) lcd_data15.pr1_mii0_rxdv */
			0xd4 ( PIN_INPUT | MUX_MODE5 ) /* (V3) lcd_data13.pr1_mii0_rxer */
			0xd0 ( PIN_INPUT | MUX_MODE5 ) /* (V2) lcd_data12.pr1_mii0_rxlink */
			0xe8 ( PIN_INPUT | MUX_MODE2 ) /* (V5) lcd_pclk.pr1_mii0_crs */
			//0x24 ( PIN_INPUT | MUX_MODE5 ) /* (T10) gpmc_ad9.pr1_mii0_col */

			AM33XX_IOPAD(0x840, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a0.pr1_mii_mt1_clk */
			AM33XX_IOPAD(0x850, (PIN_OUTPUT | MUX_MODE5))	/* gpmc_a4.pr1_mii1_txd0 */
			AM33XX_IOPAD(0x84c, (PIN_OUTPUT | MUX_MODE5))	/* gpmc_a3.pr1_mii1_txd1 */
			AM33XX_IOPAD(0x848, (PIN_OUTPUT | MUX_MODE5))	/* gpmc_a2.pr1_mii1_txd2 */
			AM33XX_IOPAD(0x844, (PIN_OUTPUT | MUX_MODE5))	/* gpmc_a1.pr1_mii1_txd3 */
			AM33XX_IOPAD(0x860, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a8.pr1_mii1_rxd0 */
			AM33XX_IOPAD(0x85c, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a7.pr1_mii1_rxd1 */
			AM33XX_IOPAD(0x858, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a6.pr1_mii1_rxd2 */
			AM33XX_IOPAD(0x854, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a5.pr1_mii1_rxd3 */
			AM33XX_IOPAD(0x874, (PIN_OUTPUT | MUX_MODE5))	/* gpmc_wpn.pr1_mii1_txen */
			AM33XX_IOPAD(0x864, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a9.pr1_mii_mr1_clk */
			AM33XX_IOPAD(0x868, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a10.pr1_mii1_rxdv */
			AM33XX_IOPAD(0x86c, (PIN_INPUT  | MUX_MODE5))	/* gpmc_a11.pr1_mii1_rxer */
			AM33XX_IOPAD(0x878, (PIN_INPUT  | MUX_MODE5))	/* gpmc_ben1.pr1_mii1_rxlink */
			AM33XX_IOPAD(0x8ec, (PIN_INPUT  | MUX_MODE2))	/* lcd_ac_bias_en.pr1_mii1_crs */
			//AM33XX_IOPAD(0x870, (PIN_INPUT  | MUX_MODE5))	/* gpmc_wait0.pr1_mii1_col */
		>;
	};
};

&uio_pruss_mdio {
	pinctrl-0 = <&uio_pruss_mdio_eth_default>;
	pinctrl-names = "default";
	reset-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>;
	reset-delay-us = <2>; /* PHY datasheet states 1uS min */
	status = "okay";

	uio_pruss_eth0_phy: ethernet-phy@1 {
		reg = <1>;
	};

	uio_pruss_eth1_phy: ethernet-phy@0 {
		reg = <0>;
	};
};

&pruss {
	status = "disabled";
};

&pru0 {
	status = "disabled";
};

&pru1 {
	status = "disabled";
};

&pruss_intc {
	status = "disabled";
};

&pruss_mdio {
	status = "disabled";
};

&pruss_emac0 {
	status = "disabled";
};

&pruss_emac1 {
	status = "disabled";
};

 

after the system boot and by execute insmod to insert some modules,

we can run the icss_emacMainTest_am335x.out example which is shown as follow:

# ./icss_emacMainTest_am335x.out
ICSS_EMAC_testDrvInit: instance: 1, data0RamSize: 0x2000, data1RamSize: 0x2000, sharedDataRamSize: 0x3000, l3OcmcSize: 0x10000
ICSS_EMAC_testDrvInit: instance: 1, data0RamSize: 0x2000, data1RamSize: 0x2000, sharedDataRamSize: 0x3000, l3OcmcSize: 0x10000
Validate Firmware: Release1: 0x11, Release2: 0x85010004
ICSS_EMAC_testTaskPruss1: PRU1 ETH0: LINK IS UP, eth0 state: 1

============================================================
ICSS_EMAC_testTaskPruss1: Testing NonPromiscuous Mode
sending Unicast packets as destination address == eth own address
============================================================

packet transmission complete for packet(ICSS_EMAC_TEST_PRU1ETH0): 0

We connect the pru_eth0 to our host pc and we can't see anything in wireshark.

Theoretically, there will be an arp package send to the host, the package is defined in Test_common_utils.c.

Same experiment is done on AM3359ICEV2, and we got an arp package in wireshark.

So i think the frame is not send out.

by execute ping in the host pc side, we get the following result:

<After execute ping 192.168.1.1>
parser returned correct value: rdBufferL3Addr 0xb6e5f840, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured
parser returned correct value: rdBufferL3Addr 0xb6e5f880, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured
parser returned correct value: rdBufferL3Addr 0xb6e5f8c0, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured
parser returned correct value: rdBufferL3Addr 0xb6e5f900, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured
parser returned correct value: rdBufferL3Addr 0xb6e5f940, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured
parser returned correct value: rdBufferL3Addr 0xb6e5f980, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured

It looks like the ping frame is received by pru_eth0.

so the problem is why frame can't send out from the pru_eth0? 

in addition, there is no problem in our cumtom board, because some other experiment has been done on our board, especially with pru_eth0 an pru_eth1

 

some useful information can be found on the log file:

# lsmod
Module                  Size  Used by    Tainted: G  
uio_module_drv          7349  0 
uio                     9158  1 uio_module_drv
pruss_soc_bus           3649  0 
# 

# cd /
# find -name uio*
./dev/uio_pruss_1_mem
./dev/uio_pruss_0_mem
./dev/uio7
./dev/uio6
./dev/uio5
./dev/uio4
./dev/uio3
./dev/uio2
./dev/uio1
./dev/uio0
./dev/uio_pruss_mem2
./dev/uio_pruss_mem
./lib/modules/4.9.65-rt23-g7069a470d5/kernel/drivers/uio
./lib/modules/4.9.65-rt23-g7069a470d5/kernel/drivers/uio/uio.ko
./lib/modules/4.9.65-rt23-g7069a470d5/kernel/drivers/uio/uio_pruss.ko
./lib/modules/4.9.65-rt23-g7069a470d5/extra/uio_module_drv.ko
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_0_mem/misc/uio_pruss_0_mem
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt7/uio
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt7/uio/uio7
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt5/uio
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt5/uio/uio5
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_mem2/misc/uio_pruss_mem2
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt3/uio
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt3/uio/uio3
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_1_mem/misc/uio_pruss_1_mem
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt1/uio
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt1/uio/uio1
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_mem/misc/uio_pruss_mem
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt6/uio
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt6/uio/uio6
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt4/uio
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt4/uio/uio4
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt2/uio
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt2/uio/uio2
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt0/uio
./sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:uio_pruss_evt0/uio/uio0
./sys/class/misc/uio_pruss_mem2
./sys/class/misc/uio_pruss_0_mem
./sys/class/misc/uio_pruss_mem
./sys/class/misc/uio_pruss_1_mem
./sys/class/uio
./sys/class/uio/uio3
./sys/class/uio/uio1
./sys/class/uio/uio6
./sys/class/uio/uio4
./sys/class/uio/uio2
./sys/class/uio/uio0
./sys/class/uio/uio7
./sys/class/uio/uio5
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_mem2
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_evt3
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_evt1
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_evt6
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_0_mem
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_evt4
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_evt2
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_mem
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_evt0
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_1_mem
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_mdio@4a332400
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_evt7
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/uio_pruss_evt5
./sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/uio_pruss_mdio_eht_default
./sys/bus/platform/drivers/uio_module_drv
./sys/module/uio
./sys/module/uio/holders/uio_module_drv
./sys/module/uio_module_drv
./proc/irq/182/uio_pruss_evt0
./proc/irq/183/uio_pruss_evt1
./proc/irq/184/uio_pruss_evt2
./proc/irq/185/uio_pruss_evt3
./proc/irq/186/uio_pruss_evt4
./proc/irq/187/uio_pruss_evt5
./proc/irq/188/uio_pruss_evt6
./proc/irq/189/uio_pruss_evt7

# find -name pru*
./lib/modules/4.9.65-rt23-g7069a470d5/kernel/drivers/remoteproc/pruss_soc_bus.ko
./lib/modules/4.9.65-rt23-g7069a470d5/kernel/drivers/remoteproc/pru_rproc.ko
./lib/modules/4.9.65-rt23-g7069a470d5/kernel/drivers/remoteproc/pruss_intc.ko
./lib/modules/4.9.65-rt23-g7069a470d5/kernel/drivers/remoteproc/pruss.ko
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/pruss@4a300000
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000
./sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000
./sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pruss_eth_default
./sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pruss_mdio_default
./sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/prcm@200000/clocks/pruss_ocp_gclk@530
./sys/firmware/devicetree/base/pruss_eth
./sys/firmware/devicetree/base/pruss_eth/pruss
./sys/bus/platform/drivers/pruss-soc-bus
./sys/module/pruss_soc_bus


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# ./icss_emacMainTest_am335x.out 
ICSS_EMAC_testDrvInit: instance: 1, data0RamSize: 0x2000, data1RamSize: 0x2000, sharedDataRamSize: 0x3000, l3OcmcSize: 0x10000
ICSS_EMAC_testDrvInit: instance: 1, data0RamSize: 0x2000, data1RamSize: 0x2000, sharedDataRamSize: 0x3000, l3OcmcSize: 0x10000
Validate Firmware: Release1: 0x11, Release2: 0x85010004
ICSS_EMAC_testTaskPruss1: PRU1 ETH0: LINK IS UP, eth0 state: 1



============================================================
 ICSS_EMAC_testTaskPruss1: Testing NonPromiscuous Mode 
 sending Unicast packets as destination address == eth own address
============================================================

packet transmission complete for packet(ICSS_EMAC_TEST_PRU1ETH0): 0
<Here we can't see anything in wireshark. Theoretically, there will be an ARG package send to the host>

<After execute ping 192.168.1.1>
parser returned correct value: rdBufferL3Addr 0xb6e5f840, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured
parser returned correct value: rdBufferL3Addr 0xb6e5f880, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured
parser returned correct value: rdBufferL3Addr 0xb6e5f8c0, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured
parser returned correct value: rdBufferL3Addr 0xb6e5f900, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured
parser returned correct value: rdBufferL3Addr 0xb6e5f940, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured
parser returned correct value: rdBufferL3Addr 0xb6e5f980, port: 0x1, queue: 0x1
Unit Test Failure, packet mismatch occured


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<by using pru_eth.ko and am335x-evm-prueth.dts>
the following test showed that pru-eth hardware is good!


lsmod
Module                  Size  Used by    Not tainted
ti_prueth              54754  0 
pruss_soc_bus           3649  0 
pru_rproc              10682  1 ti_prueth
pruss                   9725  2 ti_prueth,pru_rproc
pruss_intc              7249  5 pru_rproc
remoteproc             28648  2 ti_prueth,pru_rproc

# ifconfig
eth1      Link encap:Ethernet  HWaddr 96:07:8A:91:03:0D  
          inet addr:192.168.1.20  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:267 errors:0 dropped:49 overruns:0 frame:0
          TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:28459 (27.7 KiB)  TX bytes:7924 (7.7 KiB)

eth2      Link encap:Ethernet  HWaddr BA:D8:94:B6:9C:91  
          inet addr:192.168.2.20  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1122 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:106966 (104.4 KiB)  TX bytes:798 (798.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:51 errors:0 dropped:0 overruns:0 frame:0
          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:5712 (5.5 KiB)  TX bytes:5712 (5.5 KiB)

# ping 192.168.2.105
PING 192.168.2.105 (192.168.2.105): 56 data bytes
64 bytes from 192.168.2.105: seq=0 ttl=128 time=1.033 ms
64 bytes from 192.168.2.105: seq=1 ttl=128 time=0.519 ms
64 bytes from 192.168.2.105: seq=2 ttl=128 time=0.419 ms
^C
--- 192.168.2.105 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.419/0.657/1.033 ms
# ping 192.168.1.105
PING 192.168.1.105 (192.168.1.105): 56 data bytes
64 bytes from 192.168.1.105: seq=0 ttl=128 time=0.875 ms
64 bytes from 192.168.1.105: seq=1 ttl=128 time=0.417 ms
64 bytes from 192.168.1.105: seq=2 ttl=128 time=0.385 ms
^C
--- 192.168.1.105 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss

 

Need your help.

Thanks very much!

 

  • For future readers, this is a continuation of the discussion at https://e2e.ti.com/support/processors/f/791/p/795148/2940767 

    1) In the previous post, it sounded like you got the loopback test working with a loopback plug. Is the loopback plug test still working?

    2) to clarify, did you verify the ethernet hardware by getting PRUETH working on your board before starting to look at ICSS_EMAC development?

    3) A TI EVM is a good way to test out and develop ICSS_EMAC software on hardware that we know works.

    Regards,

    Nick

  • thanks Nick.

    1. I dit get the loop back test working with a loopback plug on TI'S AM335XICEV2 Board! It can still working now.

    2. the ethernet hardware on our custom board is good, beacause we carried out icss-emac test base on TI-RTOS, an the test is passed.

    In addition, we also test the hardware by TI's pru_eth driver in linux envoirment, and it work well. the result is shown as:

    lsmod
    Module                  Size  Used by    Not tainted
    ti_prueth              54754  0
    pruss_soc_bus           3649  0
    pru_rproc              10682  1 ti_prueth
    pruss                   9725  2 ti_prueth,pru_rproc
    pruss_intc              7249  5 pru_rproc
    remoteproc             28648  2 ti_prueth,pru_rproc

    # ifconfig
    eth1      Link encap:Ethernet  HWaddr 96:07:8A:91:03:0D  
              inet addr:192.168.1.20  Bcast:192.168.1.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:267 errors:0 dropped:49 overruns:0 frame:0
              TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:28459 (27.7 KiB)  TX bytes:7924 (7.7 KiB)

    eth2      Link encap:Ethernet  HWaddr BA:D8:94:B6:9C:91  
              inet addr:192.168.2.20  Bcast:192.168.2.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:1122 errors:0 dropped:0 overruns:0 frame:0
              TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:106966 (104.4 KiB)  TX bytes:798 (798.0 B)

    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:51 errors:0 dropped:0 overruns:0 frame:0
              TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1
              RX bytes:5712 (5.5 KiB)  TX bytes:5712 (5.5 KiB)

    # ping 192.168.2.105
    PING 192.168.2.105 (192.168.2.105): 56 data bytes
    64 bytes from 192.168.2.105: seq=0 ttl=128 time=1.033 ms
    64 bytes from 192.168.2.105: seq=1 ttl=128 time=0.519 ms
    64 bytes from 192.168.2.105: seq=2 ttl=128 time=0.419 ms
    ^C
    --- 192.168.2.105 ping statistics ---
    3 packets transmitted, 3 packets received, 0% packet loss
    round-trip min/avg/max = 0.419/0.657/1.033 ms
    # ping 192.168.1.105
    PING 192.168.1.105 (192.168.1.105): 56 data bytes
    64 bytes from 192.168.1.105: seq=0 ttl=128 time=0.875 ms
    64 bytes from 192.168.1.105: seq=1 ttl=128 time=0.417 ms
    64 bytes from 192.168.1.105: seq=2 ttl=128 time=0.385 ms
    ^C
    --- 192.168.1.105 ping statistics ---
    3 packets transmitted, 3 packets received, 0% packet loss

    I think these experiment can prove that our hardware is good.

    3. I want to implement icss-emac TTS on our board, so firstly I carry out the  icss_emacMainTest_am335x.out test on our own board.

    I  compiled uio_module_drv  moudle, modified the dts file according to am335x-icev2-pru-excl-uio.dts and am335x-pru-uio.dtsi.

    now the result is there is no frame send out.

    # lsmod
    Module                  Size  Used by    Tainted: G  
    uio_module_drv          7349  0
    uio                     9158  1 uio_module_drv
    pruss_soc_bus           3649  0
    # ./icss_emacMainTest_am335x.out

    <no frame send out>

    <but can get frame recieved,  I send ping frame to it, it can print:>

    parser returned correct value: rdBufferL3Addr 0xb6e5f840, port: 0x1, queue: 0x1
    Unit Test Failure, packet mismatch occured

    So I think there must be some modules I missed, or make mistakes in the dts files. Can you help me to check it?

    the dts files is shown: am335x-evm-uioeth.txt

    some useful test-log:icss-test-log.txt

    On the other hand,  When I compare the UIO device

    On TI's AM335xICEV2,  We can find:  sys/devices/platform/ocp/4a326004.pruss-soc-bus/4a326004.pruss_soc_bus:<xxxxxxxxxxxxx>

    On my board, We find:                          sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a326000.pruss_soc_bus:<xxxxxxxxxxxxx>

    What can cause this difference?, did the difference make the frame send failed?

    Please help me check the experiment.

    Thanks Nick!

  • The unit test is designed to be done with a loopback plug. I would not expect the unit test to "pass" if it was connected to another device.

    The output you are reporting now:
    parser returned correct value: rdBufferL3Addr 0xb6e5f840, port: 0x1, queue: 0x1
    Unit Test Failure, packet mismatch occured

    Looks a lot like the output you reported when connecting ethernet cables between AM335x ICE board ports instead of using loopback plugs:
    parser returned correct value: rdBufferL3Addr 0xb6dda8c0, port: 0x2, queue: 0x3
    Unit Test Failure, packet mismatch occured

    Do you get the expected output when you connect a loopback plug to the port on your custom board?

    Regards,
    Nick
  • Thanks for the reply, Nick.
    I did implement the experiment by insert a loopback plug in port0. But it looks like the test is failed.
    I got the following result:

    # ./icss_emacMainTest_am335x.out
    ICSS_EMAC_testDrvInit: instance: 1, data0RamSize: 0x2000, data1RamSize: 0x2000, sharedDataRamSize: 0x3000, l3OcmcSize: 0x10000
    ICSS_EMAC_testDrvInit: instance: 1, data0RamSize: 0x2000, data1RamSize: 0x2000, sharedDataRamSize: 0x3000, l3OcmcSize: 0x10000
    Validate Firmware: Release1: 0x11, Release2: 0x85010004
    ICSS_EMAC_testTaskPruss1: PRU1 ETH0: LINK IS UP, eth0 state: 1

    ============================================================
    ICSS_EMAC_testTaskPruss1: Testing NonPromiscuous Mode
    sending Unicast packets as destination address == eth own address
    ============================================================

    packet transmission complete for packet(ICSS_EMAC_TEST_PRU1ETH0): 0

    It looks like no package has send out from port0, so it stopped here.
    (to demanstrate it, i remove the loopback plug, and connect port0 to PC's wireshark, I find that no frame is send out).
    Theoretically, there will be an package send and loop back, and the test will continue to do next step.
    The problem is no frame send out from port0!
  • Hello,

    I am sorry for the delayed response.

    DEBUGGING TRANSMIT PROBLEMS

    Debugging tips for transmission can be found at processors.wiki.ti.com/.../ICSS_EMAC_LLD_debug_guide

    It is possible some device tree entries are not properly configured. You can run "cat /proc/interrupts | grep pru" to check your interrupt status. The event numbers for the interrupts are set in test/src/main_a8.c, and listed below.

    int eth0_rxIntNum = 0,
    eth0_txIntNum = 2,
    eth0_linkIntNum = 6,
    eth1_rxIntNum = 1,
    eth1_txIntNum = 3,
    eth1_linkIntNum = 7;


    GENERAL ICSS-EMAC DEVELOPMENT RESOURCES

    The ICSS-EMAC unit test for Linux user space is ported from RTOS. So, the Linux documentation has the software stack with uio details, and the steps for building and executing the binaries:
    software-dl.ti.com/.../Foundational_Components_PRU-ICSS_PRU_ICSSG.html

    Details on developing/debugging ICSS-EMAC can be found from the RTOS documentation, which also points to multiple wiki pages:
    software-dl.ti.com/.../index_device_drv.html


    Regards,
    Nick
  • Hello,

    I am going to mark this thread resolved for bookkeeping purposes. Feel free to reply to continue the discussion.

    Regards,
    Nick
  • I'm sorry Nick
    The test is still failed on our board.
    It looks like the PR1_MII0_COL is high when the test is run. this signal cause no frame can send out. But I don't know why it can become high.
    Although I don't connect it to the PHY and config it as POLL-DOWN in the dts file.
    When the test run, PR1_MII0_COL become high.

    Now, our application can only implement in TI-RTOS, and all ICSS-EMAC fuction can work well under TI-RTOS(SYS/BIOS).
    Because it is difficult to extend current functionality in TI-RTOS envoirment,
    I want to make ICSS-MAC and TTS work in Linux. But the experiment always failed!


    Thanks!
  • Hello,

    I am sorry for the delayed response. I just got back from vacation, and will give a longer response soon.

    Regards,

    Nick

  • Glad to hear from you again Nick!

    Thank for the reply. I'll wait for it.

  • Hello,

    It looks like pr1_mii0_col is only used in half-duplex mode, and is a signal from the PHY to the MAC. I'm not sure if iCSS_EMAC explicitly sets half or full duplex, but my hunch is that the loopback test would require full duplex mode so the PHY could receive the packets it was sending. At this point, I do not think that signal matters for us.

    Does your hardware design allow you to connect code composer studio to check the transmission debugging steps listed in the ICSS_EMAC_LLD_debug_guide? (e.g., something like JTAG?)

    Regards,

    Nick

  • Thanks Nick.

    The loopback test is build from main_a8.c, In which we can  see

    icss_emacTestInitCfg0->halfDuplexEnable = 1;

    So I think the experiment set the icss_emac in half dulplex mode.

    Yes my custom board can debug by JTAG, how can I debug the problem?

    Can you give us some details?  

  • Hello,

    I was hoping that we could get some more insight into what is going on by following the debug steps in the ICSS EMAC LLD Debug Guide. In particular, sections "Checking if Transmit is working" and "Check Statistics" look like they could be helpful, but there could be good information in other sections too.

    Regards,

    Nick