Patchwork [U-Boot,v2] net: sh-eth: Add support Gigabit of SH7734

login
register
mail settings
Submitter Nobuhiro Iwamatsu
Date May 16, 2012, 1:49 a.m.
Message ID <1337132979-5517-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com>
Download mbox | patch
Permalink /patch/159486/
State Accepted
Commit 4398d55991eb3c2484a2a8e991d701e5d7a64874
Delegated to: Joe Hershberger
Headers show

Comments

Nobuhiro Iwamatsu - May 16, 2012, 1:49 a.m.
SH7734 support GMII. This add register infomation and the function
which enable GMII.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
V2: Remove debug code

 drivers/net/sh_eth.c |   11 ++++++++++-
 drivers/net/sh_eth.h |    1 +
 2 files changed, 11 insertions(+), 1 deletion(-)
Joe Hershberger - May 23, 2012, 8:17 p.m.
Hi Nobuhiro Iwamatsu,

On Tue, May 15, 2012 at 8:49 PM, Nobuhiro Iwamatsu
<nobuhiro.iwamatsu.yj@renesas.com> wrote:
> SH7734 support GMII. This add register infomation and the function
> which enable GMII.
>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>

Applied, thanks.

-Joe

Patch

diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index c1abe7c..0f6fdde 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -348,7 +348,7 @@  static int sh_eth_phy_config(struct sh_eth_dev *eth)
 
 	phydev = phy_connect(
 			miiphy_get_dev_by_name(dev->name),
-			port_info->phy_addr, dev, PHY_INTERFACE_MODE_MII);
+			port_info->phy_addr, dev, CONFIG_SH_ETHER_PHY_MODE);
 	port_info->phydev = phydev;
 	phy_config(phydev);
 
@@ -405,6 +405,9 @@  static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd)
 	outl(TPAUSER_UNLIMITED, TPAUSER(port));
 #endif
 
+#if defined(CONFIG_CPU_SH7734)
+	outl(CONFIG_SH_ETHER_SH7734_MII, RMII_MII(port));
+#endif
 	/* Configure phy */
 	ret = sh_eth_phy_config(eth);
 	if (ret) {
@@ -434,6 +437,12 @@  static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd)
 		outl(0, RTRATE(port));
 #endif
 	}
+#if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734)
+	else if (phy->speed == 1000) {
+		printf(SHETHER_NAME ": 1000Base/");
+		outl(GECMR_1000B, GECMR(port));
+	}
+#endif
 
 	/* Check if full duplex mode is supported by the phy */
 	if (phy->duplex) {
diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h
index 46d8b81..132ea7a 100644
--- a/drivers/net/sh_eth.h
+++ b/drivers/net/sh_eth.h
@@ -225,6 +225,7 @@  struct sh_eth_dev {
 #define GECMR(port)		(BASE_IO_ADDR + 0x05b0)
 #define MAHR(port)		(BASE_IO_ADDR + 0x05C0)
 #define MALR(port)		(BASE_IO_ADDR + 0x05C8)
+#define RMII_MII(port)  (BASE_IO_ADDR + 0x0790)
 
 #endif