public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] AM335x Ethernet pin mux confusion
@ 2014-11-24 14:27 Andy Pont
  2014-11-25  6:24 ` Mugunthan V N
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Pont @ 2014-11-24 14:27 UTC (permalink / raw)
  To: u-boot

Hello,

I am working on porting U-Boot 2014.07 to a custom TI AM3354 based hardware
platform and am confused trying to set the pin mux for the two Ethernet
interfaces that are on the board.  

RGMII1_ pins are connected to an ATHEROS AR8031 PHY (PHY ADDR 04) and the
pins GPMC_A0 .. GPMC_A11 are connected to a Micrel KSZ8041NL (PHY ADDR 01).
The output of the "mii info" command looks OK so the MDIO interface looks to
be OK as it gives:

PHY 0x00: OUI = 0x0885, Model = 0x11, Rev = 0x03,  10baseT, HDX
PHY 0x01: OUI = 0x0885, Model = 0x11, Rev = 0x03,  10baseT, HDX
PHY 0x04: OUI = 0x1374, Model = 0x07, Rev = 0x04, 1000baseX, FDX

However, with debug enabled, it is reporting the PHYs incorrectly as it
gives:

cpsw connected to Micrel KSZ804
cpsw connected to Micrel KSZ804
cpsw

The AR8031 provides a connection to the outside world and the KSZ8041
connects to an Ethernet switch which then connects on to other devices on
the board to form a private network.  The DHCP command just sits in a loop
waiting for PHY auto negotiation to complete but timing out!

In the SPL code I am setting up the pin mux as follows:

static struct module_pin_mux rgmii1_pin_mux[] = {
	{OFFSET(mii1_txen), MODE(2)},			/* RGMII1_TCTL */
	{OFFSET(mii1_rxdv), MODE(2) | RXACTIVE},	/* RGMII1_RCTL */
	{OFFSET(mii1_txd3), MODE(2)},			/* RGMII1_TD3 */
	{OFFSET(mii1_txd2), MODE(2)},			/* RGMII1_TD2 */
	{OFFSET(mii1_txd1), MODE(2)},			/* RGMII1_TD1 */
	{OFFSET(mii1_txd0), MODE(2)},			/* RGMII1_TD0 */
	{OFFSET(mii1_txclk), MODE(2)},			/* RGMII1_TCLK */
	{OFFSET(mii1_rxclk), MODE(2) | RXACTIVE},	/* RGMII1_RCLK */
	{OFFSET(mii1_rxd3), MODE(2) | RXACTIVE},	/* RGMII1_RD3 */
	{OFFSET(mii1_rxd2), MODE(2) | RXACTIVE},	/* RGMII1_RD2 */
	{OFFSET(mii1_rxd1), MODE(2) | RXACTIVE},	/* RGMII1_RD1 */
	{OFFSET(mii1_rxd0), MODE(2) | RXACTIVE},	/* RGMII1_RD0 */
	{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN},  /* MDIO_DATA
*/
	{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},	/* MDIO_CLK */
	{-1},
};

static struct module_pin_mux rmii2_pin_mux[] = {
	{OFFSET(gpmc_a0), MODE(2)},			/* RMII2_TXEN */
	{OFFSET(gpmc_a1), MODE(2) | RXACTIVE},		/* RMII2_RXDV */
	{OFFSET(gpmc_a2), MODE(2)},			/* RMII2_TXD3 */
	{OFFSET(gpmc_a3), MODE(2)},			/* RMII2_TXD2 */
	{OFFSET(gpmc_a4), MODE(2)},			/* RMII2_TXD1 */
	{OFFSET(gpmc_a5), MODE(2)},			/* RMII2_TXD0 */
	{OFFSET(gpmc_a6), MODE(2)},			/* RMII2_TXCLK */
	{OFFSET(gpmc_a7), MODE(2) | RXACTIVE},		/* RMII2_RXCLK */
	{OFFSET(gpmc_a8), MODE(2) | RXACTIVE},		/* RMII2_RXD3 */
	{OFFSET(gpmc_a9), MODE(2) | RXACTIVE},		/* RMII2_RXD2 */
	{OFFSET(gpmc_a10), MODE(2) | RXACTIVE},		/* RMII2_RXD1 */
	{OFFSET(gpmc_a11), MODE(2) | RXACTIVE},		/* RMII2_RXD0 */
	{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN}, /* MDIO_DATA */
	{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},	/* MDIO_CLK */
	{-1},
};

Any help would be much appreciated?

Thanks,

Andy.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] AM335x Ethernet pin mux confusion
  2014-11-24 14:27 [U-Boot] AM335x Ethernet pin mux confusion Andy Pont
@ 2014-11-25  6:24 ` Mugunthan V N
  2014-11-25 13:47   ` Andy Pont
  0 siblings, 1 reply; 3+ messages in thread
From: Mugunthan V N @ 2014-11-25  6:24 UTC (permalink / raw)
  To: u-boot

On Monday 24 November 2014 07:57 PM, Andy Pont wrote:
> Hello,
> 
> I am working on porting U-Boot 2014.07 to a custom TI AM3354 based hardware
> platform and am confused trying to set the pin mux for the two Ethernet
> interfaces that are on the board.  
> 
> RGMII1_ pins are connected to an ATHEROS AR8031 PHY (PHY ADDR 04) and the
> pins GPMC_A0 .. GPMC_A11 are connected to a Micrel KSZ8041NL (PHY ADDR 01).
> The output of the "mii info" command looks OK so the MDIO interface looks to
> be OK as it gives:
> 
> PHY 0x00: OUI = 0x0885, Model = 0x11, Rev = 0x03,  10baseT, HDX
> PHY 0x01: OUI = 0x0885, Model = 0x11, Rev = 0x03,  10baseT, HDX
> PHY 0x04: OUI = 0x1374, Model = 0x07, Rev = 0x04, 1000baseX, FDX
> 
> However, with debug enabled, it is reporting the PHYs incorrectly as it
> gives:
> 
> cpsw connected to Micrel KSZ804
> cpsw connected to Micrel KSZ804
> cpsw
> 
> The AR8031 provides a connection to the outside world and the KSZ8041
> connects to an Ethernet switch which then connects on to other devices on
> the board to form a private network.  The DHCP command just sits in a loop
> waiting for PHY auto negotiation to complete but timing out!
> 
> In the SPL code I am setting up the pin mux as follows:
> 
> static struct module_pin_mux rgmii1_pin_mux[] = {
> 	{OFFSET(mii1_txen), MODE(2)},			/* RGMII1_TCTL */
> 	{OFFSET(mii1_rxdv), MODE(2) | RXACTIVE},	/* RGMII1_RCTL */
> 	{OFFSET(mii1_txd3), MODE(2)},			/* RGMII1_TD3 */
> 	{OFFSET(mii1_txd2), MODE(2)},			/* RGMII1_TD2 */
> 	{OFFSET(mii1_txd1), MODE(2)},			/* RGMII1_TD1 */
> 	{OFFSET(mii1_txd0), MODE(2)},			/* RGMII1_TD0 */
> 	{OFFSET(mii1_txclk), MODE(2)},			/* RGMII1_TCLK */
> 	{OFFSET(mii1_rxclk), MODE(2) | RXACTIVE},	/* RGMII1_RCLK */
> 	{OFFSET(mii1_rxd3), MODE(2) | RXACTIVE},	/* RGMII1_RD3 */
> 	{OFFSET(mii1_rxd2), MODE(2) | RXACTIVE},	/* RGMII1_RD2 */
> 	{OFFSET(mii1_rxd1), MODE(2) | RXACTIVE},	/* RGMII1_RD1 */
> 	{OFFSET(mii1_rxd0), MODE(2) | RXACTIVE},	/* RGMII1_RD0 */
> 	{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN},  /* MDIO_DATA
> */
> 	{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},	/* MDIO_CLK */
> 	{-1},
> };
> 
> static struct module_pin_mux rmii2_pin_mux[] = {
> 	{OFFSET(gpmc_a0), MODE(2)},			/* RMII2_TXEN */
> 	{OFFSET(gpmc_a1), MODE(2) | RXACTIVE},		/* RMII2_RXDV */
> 	{OFFSET(gpmc_a2), MODE(2)},			/* RMII2_TXD3 */
> 	{OFFSET(gpmc_a3), MODE(2)},			/* RMII2_TXD2 */
> 	{OFFSET(gpmc_a4), MODE(2)},			/* RMII2_TXD1 */
> 	{OFFSET(gpmc_a5), MODE(2)},			/* RMII2_TXD0 */
> 	{OFFSET(gpmc_a6), MODE(2)},			/* RMII2_TXCLK */
> 	{OFFSET(gpmc_a7), MODE(2) | RXACTIVE},		/* RMII2_RXCLK */
> 	{OFFSET(gpmc_a8), MODE(2) | RXACTIVE},		/* RMII2_RXD3 */
> 	{OFFSET(gpmc_a9), MODE(2) | RXACTIVE},		/* RMII2_RXD2 */
> 	{OFFSET(gpmc_a10), MODE(2) | RXACTIVE},		/* RMII2_RXD1 */
> 	{OFFSET(gpmc_a11), MODE(2) | RXACTIVE},		/* RMII2_RXD0 */
> 	{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN}, /* MDIO_DATA */
> 	{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},	/* MDIO_CLK */
> 	{-1},
> };
> 
> Any help would be much appreciated?

There is no relation between pinmux and phy attached to the slave.
Is your cpsw slave structures are populated with proper phy ids?

Regards
Mugunthan V N

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] AM335x Ethernet pin mux confusion
  2014-11-25  6:24 ` Mugunthan V N
@ 2014-11-25 13:47   ` Andy Pont
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Pont @ 2014-11-25 13:47 UTC (permalink / raw)
  To: u-boot

Hello Mugunthan,

> There is no relation between pinmux and phy attached to the slave.
> Is your cpsw slave structures are populated with proper phy ids?

Thanks for giving me the steer on this.  I hadn't updated the slave
structure.  Having updated the slave structure it is now correctly detecting
both PHYs and I can communicate with the network. :-)

Now to fix all the issues I am having with the Linux kernel...

Regards,

Andy.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-25 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-24 14:27 [U-Boot] AM335x Ethernet pin mux confusion Andy Pont
2014-11-25  6:24 ` Mugunthan V N
2014-11-25 13:47   ` Andy Pont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox