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/AM3354: Linux / AM3354: No receive on eth1

Part Number: AM3354
Other Parts Discussed in Thread: TLK110,

Tool/software: Linux

Hi,

we have a design with AM3354 and two TLK110 PHYs. eth0 is working fine. eth1 tx path is also fine, but no rx at all.

We are using TI SDK 04.01 with linux kernel 4.14.12.

	cpsw_default: cpsw_default {
		pinctrl-single,pins = <
			/* Slave 1, RMII mode */
			0x10c ( PIN_INPUT_PULLDOWN | MUX_MODE1 ) /* (H17) gmii1_crs.rmii1_crs_dv */
			0x110 ( PIN_INPUT_PULLDOWN | MUX_MODE1 ) /* (J15) gmii1_rxer.rmii1_rxer */
			0x114 ( PIN_OUTPUT_PULLDOWN | MUX_MODE1 ) /* (J16) gmii1_txen.rmii1_txen */
			0x124 ( PIN_OUTPUT_PULLDOWN | MUX_MODE1 ) /* (K16) gmii1_txd1.rmii1_txd1 */
			0x128 ( PIN_OUTPUT_PULLDOWN | MUX_MODE1 ) /* (K17) gmii1_txd0.rmii1_txd0 */
			0x13c ( PIN_INPUT_PULLDOWN | MUX_MODE1 ) /* (L15) gmii1_rxd1.rmii1_rxd1 */
			0x140 ( PIN_INPUT_PULLDOWN | MUX_MODE1 ) /* (M16) gmii1_rxd0.rmii1_rxd0 */
			0x144 ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (H18) rmii1_refclk.rmii1_refclk */
			/* Slave 2, RMII mode */
			0x40 ( PIN_OUTPUT_PULLDOWN | MUX_MODE3 ) /* (R13) gpmc_a0.rmii2_txen */
			0x50 ( PIN_OUTPUT_PULLDOWN | MUX_MODE3 ) /* (R14) gpmc_a4.rmii2_txd1 */
			0x54 ( PIN_OUTPUT_PULLDOWN | MUX_MODE3 ) /* (V15) gpmc_a5.rmii2_txd0 */
			0x64 ( PIN_INPUT_PULLDOWN | MUX_MODE3 ) /* (U16) gpmc_a9.rmii2_crs_dv */
			0x68 ( PIN_INPUT_PULLDOWN | MUX_MODE3 ) /* (T16) gpmc_a10.rmii2_rxd1 */
			0x6c ( PIN_INPUT_PULLDOWN | MUX_MODE3 ) /* (V17) gpmc_a11.rmii2_rxd0 */
			0x74 ( PIN_INPUT_PULLDOWN | MUX_MODE3 ) /* (U17) gpmc_wpn.rmii2_rxer */
			0x108 ( PIN_INPUT_PULLDOWN | MUX_MODE1 ) /* (H16) gmii1_col.rmii2_refclk */
		>;
	};

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

&davinci_mdio {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&mdio_default>;
	pinctrl-1 = <&mdio_sleep>;
	status = "okay";
};

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

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

&phy_sel {
	rmii-clock-ext;
};

Reading the related thread this looks pretty much like our problem, as we also use pin U16 for signal rmii2_crs_dv.

Like another user in this thread, i have no idea where i could find the function am33xx_select_rmii2_crs_dv() that solved the problem.

Can you give me a hint where to find this function or which steps are necessary to fix this issue, please?

Thank you and best regards,

Matt

  • Hi,
    Could you please attach the link to the post that you are referring to? I could not find the function either, perhaps the thread you are referring too is discussing code that has been deprecated etc. Currently to my knowledge there is nothing required to call function wise to setup an interface. This should just all be handled in the DTS file.

    Thanks for posting the emac portion of the DTS file. The problem you describe might be clock related. I will have to check with a colleague on this.

    Best Regards,
    Schuyler
  • Hi,
    Apologies, I did not see that this post was based on the post you were referring to.

    The original thread mentioned using barebox, which is the equivalent of u-boot to fix the problem. Ideally this should not have to be fixed in U-Boot since the kernel does a re-initialization of the interface. Like I mentioned earlier I will need to check with a colleague.

    Could you also please attach a snippet of the schematic that shows the emac interfaces and the PHYs? Thanks.

    Best Regards,
    Schuyler
  • Hi,
    Could post a scope capture to see if there is data on the RX lines between the PHY and the MAC?
    Best Regards,
    Schuyler
  • Hi Schuyler,

    thank you for your quick answers!

    Your hint regarding barebox was the information that brought me forward! (I was googling in parallel and i found out about barebox as alternative bootloader as well.)

    In the barebox sources i found the function am33xx_select_rmii2_crs_dv() mentioned in the related post.

    It revealed that the only thing to be done was setting bit # 0 (Select RMII2_CRS_DV on GPMC_A9 pin in MODE3) in sma2 register (offset 0x1320).

    After integrating this into the U-Boot board_init() - function in board/ti/am335x/board.c my eth1 port worked like a charm!

    Maybe there is a more elegant way to achive this - please let me know if this is the case.

    Otherwise from my point of view the issue is solved and the thread may be closed.

    For completeness, i attach snippets of  the schematic. Unfortunately there are no scope captures, as i already removed the soldered probes.

    Thank you again and best regards,

    Matt