* [PATCH 0/6] ibm_newemac: Pending patches for review
@ 2007-11-08 8:06 Benjamin Herrenschmidt
2007-11-08 8:06 ` [PATCH 1/6] ibm_newemac: Add BCM5248 and Marvell 88E1111 PHY support Benjamin Herrenschmidt
` (5 more replies)
0 siblings, 6 replies; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-08 8:06 UTC (permalink / raw)
To: linuxppc-dev
Here are the patches I have pending for EMAC. With those and some not
yet released patches from Hugh Blemings to port Taishan support to
arch/powerpc, I get the board booting.
There's a question about the RGMII/MDIO thingy & sequoia, somebody
who knows that board should reply.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/6] ibm_newemac: Add BCM5248 and Marvell 88E1111 PHY support
2007-11-08 8:06 [PATCH 0/6] ibm_newemac: Pending patches for review Benjamin Herrenschmidt
@ 2007-11-08 8:06 ` Benjamin Herrenschmidt
2007-11-08 8:06 ` [PATCH 2/6] ibm_newemac: Add ET1011c " Benjamin Herrenschmidt
` (4 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-08 8:06 UTC (permalink / raw)
To: linuxppc-dev
From: Stefan Roese <sr@denx.de>
This patch adds BCM5248 and Marvell 88E1111 PHY support to NEW EMAC driver.
These PHY chips are used on PowerPC 440EPx boards.
The PHY code is based on the previous work by Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
--- linux.orig/drivers/net/ibm_newemac/phy.c 2007-06-15 21:45:18.000000000 +0400
+++ linux/drivers/net/ibm_newemac/phy.c 2007-06-15 20:45:15.000000000 +0400
@@ -306,8 +306,47 @@
.ops = &cis8201_phy_ops
};
+static struct mii_phy_def bcm5248_phy_def = {
+
+ .phy_id = 0x0143bc00,
+ .phy_id_mask = 0x0ffffff0,
+ .name = "BCM5248 10/100 SMII Ethernet",
+ .ops = &generic_phy_ops
+};
+
+static int m88e1111_init(struct mii_phy *phy)
+{
+ printk("%s: Marvell 88E1111 Ethernet\n", __FUNCTION__);
+ phy_write(phy, 0x14, 0x0ce3);
+ phy_write(phy, 0x18, 0x4101);
+ phy_write(phy, 0x09, 0x0e00);
+ phy_write(phy, 0x04, 0x01e1);
+ phy_write(phy, 0x00, 0x9140);
+ phy_write(phy, 0x00, 0x1140);
+
+ return 0;
+}
+
+static struct mii_phy_ops m88e1111_phy_ops = {
+ .init = m88e1111_init,
+ .setup_aneg = genmii_setup_aneg,
+ .setup_forced = genmii_setup_forced,
+ .poll_link = genmii_poll_link,
+ .read_link = genmii_read_link
+};
+
+static struct mii_phy_def m88e1111_phy_def = {
+
+ .phy_id = 0x01410CC0,
+ .phy_id_mask = 0x0ffffff0,
+ .name = "Marvell 88E1111 Ethernet",
+ .ops = &m88e1111_phy_ops,
+};
+
static struct mii_phy_def *mii_phy_table[] = {
&cis8201_phy_def,
+ &bcm5248_phy_def,
+ &m88e1111_phy_def,
&genmii_phy_def,
NULL
};
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/6] ibm_newemac: Add ET1011c PHY support
2007-11-08 8:06 [PATCH 0/6] ibm_newemac: Pending patches for review Benjamin Herrenschmidt
2007-11-08 8:06 ` [PATCH 1/6] ibm_newemac: Add BCM5248 and Marvell 88E1111 PHY support Benjamin Herrenschmidt
@ 2007-11-08 8:06 ` Benjamin Herrenschmidt
2007-11-08 8:41 ` Stefan Roese
2007-11-08 8:06 ` [PATCH 3/6] ibm_newemac: Fix ZMII refcounting bug Benjamin Herrenschmidt
` (3 subsequent siblings)
5 siblings, 1 reply; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-08 8:06 UTC (permalink / raw)
To: linuxppc-dev
This adds support for the ET1011c PHY as found on the taishan
board.
The code comes from the kernel distributed with the board by
AMCC and developped by DENX.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
And don't ask me about using phylib, it's in plan :-)
drivers/net/ibm_newemac/phy.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
Index: linux-work/drivers/net/ibm_newemac/phy.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/phy.c 2007-11-08 15:11:30.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/phy.c 2007-11-08 15:11:54.000000000 +1100
@@ -327,6 +327,42 @@ static int m88e1111_init(struct mii_phy
return 0;
}
+static int et1011c_init(struct mii_phy *phy)
+{
+ u16 reg_short;
+
+ reg_short = (u16)(phy_read(phy,0x16));
+ reg_short &= ~(0x7);
+ reg_short |= 0x6; /* RGMII Trace Delay*/
+ phy_write(phy, 0x16, reg_short);
+
+ reg_short = (u16)(phy_read(phy, 0x17));
+ reg_short &= ~(0x40);
+ phy_write(phy, 0x17, reg_short);
+
+ phy_write(phy,0x1c,0x74f0);
+ return 0;
+}
+
+static struct mii_phy_ops et1011c_phy_ops = {
+ .init = et1011c_init,
+ .setup_aneg = genmii_setup_aneg,
+ .setup_forced = genmii_setup_forced,
+ .poll_link = genmii_poll_link,
+ .read_link = genmii_read_link
+};
+
+static struct mii_phy_def et1011c_phy_def = {
+ .phy_id = 0x0282f000,
+ .phy_id_mask = 0x0fffff00,
+ .name = "ET1011C Gigabit Ethernet",
+ .ops = &et1011c_phy_ops
+};
+
+
+
+
+
static struct mii_phy_ops m88e1111_phy_ops = {
.init = m88e1111_init,
.setup_aneg = genmii_setup_aneg,
@@ -344,6 +380,7 @@ static struct mii_phy_def m88e1111_phy_d
};
static struct mii_phy_def *mii_phy_table[] = {
+ &et1011c_phy_def,
&cis8201_phy_def,
&bcm5248_phy_def,
&m88e1111_phy_def,
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 3/6] ibm_newemac: Fix ZMII refcounting bug
2007-11-08 8:06 [PATCH 0/6] ibm_newemac: Pending patches for review Benjamin Herrenschmidt
2007-11-08 8:06 ` [PATCH 1/6] ibm_newemac: Add BCM5248 and Marvell 88E1111 PHY support Benjamin Herrenschmidt
2007-11-08 8:06 ` [PATCH 2/6] ibm_newemac: Add ET1011c " Benjamin Herrenschmidt
@ 2007-11-08 8:06 ` Benjamin Herrenschmidt
2007-11-08 8:43 ` Stefan Roese
2007-11-08 8:06 ` [PATCH 4/6] ibm_newemac: Workaround reset timeout when no link Benjamin Herrenschmidt
` (2 subsequent siblings)
5 siblings, 1 reply; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-08 8:06 UTC (permalink / raw)
To: linuxppc-dev
When using ZMII for MDIO only (such as 440GX with RGMII for data and ZMII for
MDIO), the ZMII code would fail to properly refcount, thus triggering a
BUG_ON().
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/net/ibm_newemac/zmii.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: linux-work/drivers/net/ibm_newemac/zmii.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/zmii.c 2007-11-08 15:45:32.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/zmii.c 2007-11-08 15:46:21.000000000 +1100
@@ -83,12 +83,14 @@ int __devinit zmii_attach(struct of_devi
ZMII_DBG(dev, "init(%d, %d)" NL, input, *mode);
- if (!zmii_valid_mode(*mode))
+ if (!zmii_valid_mode(*mode)) {
/* Probably an EMAC connected to RGMII,
* but it still may need ZMII for MDIO so
* we don't fail here.
*/
+ dev->users++;
return 0;
+ }
mutex_lock(&dev->lock);
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 4/6] ibm_newemac: Workaround reset timeout when no link
2007-11-08 8:06 [PATCH 0/6] ibm_newemac: Pending patches for review Benjamin Herrenschmidt
` (2 preceding siblings ...)
2007-11-08 8:06 ` [PATCH 3/6] ibm_newemac: Fix ZMII refcounting bug Benjamin Herrenschmidt
@ 2007-11-08 8:06 ` Benjamin Herrenschmidt
2007-11-08 8:44 ` Stefan Roese
2007-11-08 8:07 ` [PATCH 5/6] ibm_newemac: Cleanup/Fix RGMII MDIO support detection Benjamin Herrenschmidt
2007-11-08 8:07 ` [PATCH 6/6] ibm_newemac: Cleanup/fix support for STACR register variants Benjamin Herrenschmidt
5 siblings, 1 reply; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-08 8:06 UTC (permalink / raw)
To: linuxppc-dev
With some PHYs, when the link goes away, the EMAC reset fails due
to the loss of the RX clock I believe.
The old EMAC driver worked around that using some internal chip-specific
clock force bits that are different on various 44x implementations.
This is an attempt at doing it differently, by avoiding the reset when
there is no link, but forcing loopback mode instead. It seems to work
on my Taishan 440GX based board so far.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/net/ibm_newemac/core.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
Index: linux-work/drivers/net/ibm_newemac/core.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/core.c 2007-11-08 17:38:44.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/core.c 2007-11-08 18:03:44.000000000 +1100
@@ -464,26 +464,34 @@ static int emac_configure(struct emac_in
{
struct emac_regs __iomem *p = dev->emacp;
struct net_device *ndev = dev->ndev;
- int tx_size, rx_size;
+ int tx_size, rx_size, link = netif_carrier_ok(dev->ndev);
u32 r, mr1 = 0;
DBG(dev, "configure" NL);
- if (emac_reset(dev) < 0)
+ if (!link) {
+ out_be32(&p->mr1, in_be32(&p->mr1)
+ | EMAC_MR1_FDE | EMAC_MR1_ILE);
+ udelay(100);
+ } else if (emac_reset(dev) < 0)
return -ETIMEDOUT;
if (emac_has_feature(dev, EMAC_FTR_HAS_TAH))
tah_reset(dev->tah_dev);
- DBG(dev, " duplex = %d, pause = %d, asym_pause = %d\n",
- dev->phy.duplex, dev->phy.pause, dev->phy.asym_pause);
+ DBG(dev, " link = %d duplex = %d, pause = %d, asym_pause = %d\n",
+ link, dev->phy.duplex, dev->phy.pause, dev->phy.asym_pause);
/* Default fifo sizes */
tx_size = dev->tx_fifo_size;
rx_size = dev->rx_fifo_size;
+ /* No link, force loopback */
+ if (!link)
+ mr1 = EMAC_MR1_FDE | EMAC_MR1_ILE;
+
/* Check for full duplex */
- if (dev->phy.duplex == DUPLEX_FULL)
+ else if (dev->phy.duplex == DUPLEX_FULL)
mr1 |= EMAC_MR1_FDE | EMAC_MR1_MWSW_001;
/* Adjust fifo sizes, mr1 and timeouts based on link speed */
@@ -1162,9 +1170,9 @@ static void emac_link_timer(struct work_
link_poll_interval = PHY_POLL_LINK_ON;
} else {
if (netif_carrier_ok(dev->ndev)) {
- emac_reinitialize(dev);
netif_carrier_off(dev->ndev);
netif_tx_disable(dev->ndev);
+ emac_reinitialize(dev);
emac_print_link_status(dev);
}
link_poll_interval = PHY_POLL_LINK_OFF;
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 5/6] ibm_newemac: Cleanup/Fix RGMII MDIO support detection
2007-11-08 8:06 [PATCH 0/6] ibm_newemac: Pending patches for review Benjamin Herrenschmidt
` (3 preceding siblings ...)
2007-11-08 8:06 ` [PATCH 4/6] ibm_newemac: Workaround reset timeout when no link Benjamin Herrenschmidt
@ 2007-11-08 8:07 ` Benjamin Herrenschmidt
2007-11-08 9:24 ` Stefan Roese
2007-11-08 8:07 ` [PATCH 6/6] ibm_newemac: Cleanup/fix support for STACR register variants Benjamin Herrenschmidt
5 siblings, 1 reply; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-08 8:07 UTC (permalink / raw)
To: linuxppc-dev
More than just "AXON" version of EMAC RGMII supports MDIO, so replace
the current test with a generic property in the device-tree that
indicates such support.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Should we set that in Sequoia DTS ?
drivers/net/ibm_newemac/rgmii.c | 20 +++++++++++---------
drivers/net/ibm_newemac/rgmii.h | 5 +++--
2 files changed, 14 insertions(+), 11 deletions(-)
Index: linux-work/drivers/net/ibm_newemac/rgmii.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/rgmii.c 2007-11-08 18:46:06.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/rgmii.c 2007-11-08 18:51:00.000000000 +1100
@@ -140,7 +140,7 @@ void rgmii_get_mdio(struct of_device *of
RGMII_DBG2(dev, "get_mdio(%d)" NL, input);
- if (dev->type != RGMII_AXON)
+ if (!(dev->flags & EMAC_RGMII_FLAG_HAS_MDIO))
return;
mutex_lock(&dev->lock);
@@ -161,7 +161,7 @@ void rgmii_put_mdio(struct of_device *of
RGMII_DBG2(dev, "put_mdio(%d)" NL, input);
- if (dev->type != RGMII_AXON)
+ if (!(dev->flags & EMAC_RGMII_FLAG_HAS_MDIO))
return;
fer = in_be32(&p->fer);
@@ -250,11 +250,13 @@ static int __devinit rgmii_probe(struct
goto err_free;
}
- /* Check for RGMII type */
+ /* Check for RGMII flags */
+ if (of_get_property(ofdev->node, "has-mdio", NULL))
+ dev->flags |= EMAC_RGMII_FLAG_HAS_MDIO;
+
+ /* CAB lacks the right properties, fix this up */
if (of_device_is_compatible(ofdev->node, "ibm,rgmii-axon"))
- dev->type = RGMII_AXON;
- else
- dev->type = RGMII_STANDARD;
+ dev->flags |= EMAC_RGMII_FLAG_HAS_MDIO;
DBG2(dev, " Boot FER = 0x%08x, SSR = 0x%08x\n",
in_be32(&dev->base->fer), in_be32(&dev->base->ssr));
@@ -263,9 +265,9 @@ static int __devinit rgmii_probe(struct
out_be32(&dev->base->fer, 0);
printk(KERN_INFO
- "RGMII %s %s initialized\n",
- dev->type == RGMII_STANDARD ? "standard" : "axon",
- ofdev->node->full_name);
+ "RGMII %s initialized with%s MDIO support\n",
+ ofdev->node->full_name,
+ (dev->flags & EMAC_RGMII_FLAG_HAS_MDIO) ? "" : "out");
wmb();
dev_set_drvdata(&ofdev->dev, dev);
Index: linux-work/drivers/net/ibm_newemac/rgmii.h
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/rgmii.h 2007-11-08 18:46:06.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/rgmii.h 2007-11-08 18:47:32.000000000 +1100
@@ -35,8 +35,9 @@ struct rgmii_regs {
struct rgmii_instance {
struct rgmii_regs __iomem *base;
- /* Type of RGMII bridge */
- int type;
+ /* RGMII bridge flags */
+ int flags;
+#define EMAC_RGMII_FLAG_HAS_MDIO 0x00000001
/* Only one EMAC whacks us at a time */
struct mutex lock;
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 6/6] ibm_newemac: Cleanup/fix support for STACR register variants
2007-11-08 8:06 [PATCH 0/6] ibm_newemac: Pending patches for review Benjamin Herrenschmidt
` (4 preceding siblings ...)
2007-11-08 8:07 ` [PATCH 5/6] ibm_newemac: Cleanup/Fix RGMII MDIO support detection Benjamin Herrenschmidt
@ 2007-11-08 8:07 ` Benjamin Herrenschmidt
2007-11-08 9:38 ` Stefan Roese
5 siblings, 1 reply; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-08 8:07 UTC (permalink / raw)
To: linuxppc-dev
There are a few variants of the STACR register that affect more than
just the "AXON" version of EMAC. Replace the current test of various
chip models with tests for generic properties in the device-tree.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/boot/dts/sequoia.dts | 4 ++++
drivers/net/ibm_newemac/core.c | 23 +++++++++++++----------
drivers/net/ibm_newemac/core.h | 6 +++---
3 files changed, 20 insertions(+), 13 deletions(-)
Index: linux-work/arch/powerpc/boot/dts/sequoia.dts
===================================================================
--- linux-work.orig/arch/powerpc/boot/dts/sequoia.dts 2007-11-08 18:49:53.000000000 +1100
+++ linux-work/arch/powerpc/boot/dts/sequoia.dts 2007-11-08 18:49:59.000000000 +1100
@@ -273,6 +273,8 @@
zmii-channel = <0>;
rgmii-device = <&RGMII0>;
rgmii-channel = <0>;
+ has-inverted-stacr-oc;
+ has-new-stacr-staopc;
};
EMAC1: ethernet@ef600f00 {
@@ -301,6 +303,8 @@
zmii-channel = <1>;
rgmii-device = <&RGMII0>;
rgmii-channel = <1>;
+ has-inverted-stacr-oc;
+ has-new-stacr-staopc;
};
};
};
Index: linux-work/drivers/net/ibm_newemac/core.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/core.c 2007-11-08 18:49:53.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/core.c 2007-11-08 18:50:17.000000000 +1100
@@ -709,7 +709,7 @@ static int __emac_mdio_read(struct emac_
r = EMAC_STACR_BASE(dev->opb_bus_freq);
if (emac_has_feature(dev, EMAC_FTR_STACR_OC_INVERT))
r |= EMAC_STACR_OC;
- if (emac_has_feature(dev, EMAC_FTR_HAS_AXON_STACR))
+ if (emac_has_feature(dev, EMAC_FTR_HAS_NEW_STACR))
r |= EMACX_STACR_STAC_READ;
else
r |= EMAC_STACR_STAC_READ;
@@ -781,7 +781,7 @@ static void __emac_mdio_write(struct ema
r = EMAC_STACR_BASE(dev->opb_bus_freq);
if (emac_has_feature(dev, EMAC_FTR_STACR_OC_INVERT))
r |= EMAC_STACR_OC;
- if (emac_has_feature(dev, EMAC_FTR_HAS_AXON_STACR))
+ if (emac_has_feature(dev, EMAC_FTR_HAS_NEW_STACR))
r |= EMACX_STACR_STAC_WRITE;
else
r |= EMAC_STACR_STAC_WRITE;
@@ -2473,16 +2473,19 @@ static int __devinit emac_init_config(st
/* Check EMAC version */
if (of_device_is_compatible(np, "ibm,emac4"))
dev->features |= EMAC_FTR_EMAC4;
- if (of_device_is_compatible(np, "ibm,emac-axon")
- || of_device_is_compatible(np, "ibm,emac-440epx"))
- dev->features |= EMAC_FTR_HAS_AXON_STACR
- | EMAC_FTR_STACR_OC_INVERT;
- if (of_device_is_compatible(np, "ibm,emac-440spe"))
+
+ /* Fixup some feature bits based on the device tree */
+ if (of_get_property(np, "has-inverted-stacr-oc", NULL))
dev->features |= EMAC_FTR_STACR_OC_INVERT;
+ if (of_get_property(np, "has-new-stacr-staopc", NULL))
+ dev->features |= EMAC_FTR_HAS_NEW_STACR;
- /* Fixup some feature bits based on the device tree and verify
- * we have support for them compiled in
- */
+ /* CAB lacks the appropriate properties */
+ if (of_device_is_compatible(np, "ibm,emac-axon"))
+ dev->features |= EMAC_FTR_HAS_NEW_STACR |
+ EMAC_FTR_STACR_OC_INVERT;
+
+ /* Enable TAH/ZMII/RGMII features as found */
if (dev->tah_ph != 0) {
#ifdef CONFIG_IBM_NEW_EMAC_TAH
dev->features |= EMAC_FTR_HAS_TAH;
Index: linux-work/drivers/net/ibm_newemac/core.h
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/core.h 2007-11-08 18:49:53.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/core.h 2007-11-08 18:49:59.000000000 +1100
@@ -292,9 +292,9 @@ struct emac_instance {
*/
#define EMAC_FTR_HAS_RGMII 0x00000020
/*
- * Set if we have axon-type STACR
+ * Set if we have new type STACR with STAOPC
*/
-#define EMAC_FTR_HAS_AXON_STACR 0x00000040
+#define EMAC_FTR_HAS_NEW_STACR 0x00000040
/* Right now, we don't quite handle the always/possible masks on the
@@ -306,7 +306,7 @@ enum {
EMAC_FTRS_POSSIBLE =
#ifdef CONFIG_IBM_NEW_EMAC_EMAC4
- EMAC_FTR_EMAC4 | EMAC_FTR_HAS_AXON_STACR |
+ EMAC_FTR_EMAC4 | EMAC_FTR_HAS_NEW_STACR |
EMAC_FTR_STACR_OC_INVERT |
#endif
#ifdef CONFIG_IBM_NEW_EMAC_TAH
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/6] ibm_newemac: Add ET1011c PHY support
2007-11-08 8:06 ` [PATCH 2/6] ibm_newemac: Add ET1011c " Benjamin Herrenschmidt
@ 2007-11-08 8:41 ` Stefan Roese
2007-11-08 8:42 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 16+ messages in thread
From: Stefan Roese @ 2007-11-08 8:41 UTC (permalink / raw)
To: linuxppc-dev
On Thursday 08 November 2007, Benjamin Herrenschmidt wrote:
> This adds support for the ET1011c PHY as found on the taishan
> board.
>
> The code comes from the kernel distributed with the board by
> AMCC and developped by DENX.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> And don't ask me about using phylib, it's in plan :-)
>
> drivers/net/ibm_newemac/phy.c | 37 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> Index: linux-work/drivers/net/ibm_newemac/phy.c
> ===================================================================
> --- linux-work.orig/drivers/net/ibm_newemac/phy.c 2007-11-08
> 15:11:30.000000000 +1100 +++
> linux-work/drivers/net/ibm_newemac/phy.c 2007-11-08 15:11:54.000000000
> +1100 @@ -327,6 +327,42 @@ static int m88e1111_init(struct mii_phy
> return 0;
> }
>
> +static int et1011c_init(struct mii_phy *phy)
> +{
> + u16 reg_short;
> +
> + reg_short = (u16)(phy_read(phy,0x16));
> + reg_short &= ~(0x7);
> + reg_short |= 0x6; /* RGMII Trace Delay*/
> + phy_write(phy, 0x16, reg_short);
> +
> + reg_short = (u16)(phy_read(phy, 0x17));
> + reg_short &= ~(0x40);
> + phy_write(phy, 0x17, reg_short);
> +
> + phy_write(phy,0x1c,0x74f0);
> + return 0;
> +}
> +
> +static struct mii_phy_ops et1011c_phy_ops = {
> + .init = et1011c_init,
> + .setup_aneg = genmii_setup_aneg,
> + .setup_forced = genmii_setup_forced,
> + .poll_link = genmii_poll_link,
> + .read_link = genmii_read_link
> +};
> +
> +static struct mii_phy_def et1011c_phy_def = {
> + .phy_id = 0x0282f000,
> + .phy_id_mask = 0x0fffff00,
> + .name = "ET1011C Gigabit Ethernet",
> + .ops = &et1011c_phy_ops
> +};
> +
> +
> +
> +
> +
Nitpicking: Too many empty lines for my taste.
Other then that:
Acked-by: Stefan Roese <sr@denx.de>
Thanks.
Best regards,
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/6] ibm_newemac: Add ET1011c PHY support
2007-11-08 8:41 ` Stefan Roese
@ 2007-11-08 8:42 ` Benjamin Herrenschmidt
2007-11-08 12:08 ` Josh Boyer
0 siblings, 1 reply; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-08 8:42 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev
> > +static struct mii_phy_def et1011c_phy_def = {
> > + .phy_id = 0x0282f000,
> > + .phy_id_mask = 0x0fffff00,
> > + .name = "ET1011C Gigabit Ethernet",
> > + .ops = &et1011c_phy_ops
> > +};
> > +
> > +
> > +
> > +
> > +
>
> Nitpicking: Too many empty lines for my taste.
Agreed, I though I had removed them, looks like I didn't. Will fix that
before submitting.
Thanks,
Ben.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/6] ibm_newemac: Fix ZMII refcounting bug
2007-11-08 8:06 ` [PATCH 3/6] ibm_newemac: Fix ZMII refcounting bug Benjamin Herrenschmidt
@ 2007-11-08 8:43 ` Stefan Roese
0 siblings, 0 replies; 16+ messages in thread
From: Stefan Roese @ 2007-11-08 8:43 UTC (permalink / raw)
To: linuxppc-dev
On Thursday 08 November 2007, Benjamin Herrenschmidt wrote:
> When using ZMII for MDIO only (such as 440GX with RGMII for data and ZMII
> for MDIO), the ZMII code would fail to properly refcount, thus triggering a
> BUG_ON().
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
Best regards,
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 4/6] ibm_newemac: Workaround reset timeout when no link
2007-11-08 8:06 ` [PATCH 4/6] ibm_newemac: Workaround reset timeout when no link Benjamin Herrenschmidt
@ 2007-11-08 8:44 ` Stefan Roese
0 siblings, 0 replies; 16+ messages in thread
From: Stefan Roese @ 2007-11-08 8:44 UTC (permalink / raw)
To: linuxppc-dev
On Thursday 08 November 2007, Benjamin Herrenschmidt wrote:
> With some PHYs, when the link goes away, the EMAC reset fails due
> to the loss of the RX clock I believe.
>
> The old EMAC driver worked around that using some internal chip-specific
> clock force bits that are different on various 44x implementations.
>
> This is an attempt at doing it differently, by avoiding the reset when
> there is no link, but forcing loopback mode instead. It seems to work
> on my Taishan 440GX based board so far.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
Best regards,
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 5/6] ibm_newemac: Cleanup/Fix RGMII MDIO support detection
2007-11-08 8:07 ` [PATCH 5/6] ibm_newemac: Cleanup/Fix RGMII MDIO support detection Benjamin Herrenschmidt
@ 2007-11-08 9:24 ` Stefan Roese
0 siblings, 0 replies; 16+ messages in thread
From: Stefan Roese @ 2007-11-08 9:24 UTC (permalink / raw)
To: linuxppc-dev
On Thursday 08 November 2007, Benjamin Herrenschmidt wrote:
> More than just "AXON" version of EMAC RGMII supports MDIO, so replace
> the current test with a generic property in the device-tree that
> indicates such support.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
> Should we set that in Sequoia DTS ?
I suppose yes. 440EPx support MDIO over ZMII and RGMII, but Sequoia uses RGMII
so we should enable it.
I tested it with your patches and has-mdio set on Sequoia and it works (though
it also works without this property in the RGMII node).
Thanks.
Best regards,
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 6/6] ibm_newemac: Cleanup/fix support for STACR register variants
2007-11-08 8:07 ` [PATCH 6/6] ibm_newemac: Cleanup/fix support for STACR register variants Benjamin Herrenschmidt
@ 2007-11-08 9:38 ` Stefan Roese
0 siblings, 0 replies; 16+ messages in thread
From: Stefan Roese @ 2007-11-08 9:38 UTC (permalink / raw)
To: linuxppc-dev
On Thursday 08 November 2007, Benjamin Herrenschmidt wrote:
> There are a few variants of the STACR register that affect more than
> just the "AXON" version of EMAC. Replace the current test of various
> chip models with tests for generic properties in the device-tree.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
Best regards,
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/6] ibm_newemac: Add ET1011c PHY support
2007-11-08 8:42 ` Benjamin Herrenschmidt
@ 2007-11-08 12:08 ` Josh Boyer
2007-11-08 20:55 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 16+ messages in thread
From: Josh Boyer @ 2007-11-08 12:08 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev, Stefan Roese
On Thu, 08 Nov 2007 19:42:24 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > > +static struct mii_phy_def et1011c_phy_def = {
> > > + .phy_id = 0x0282f000,
> > > + .phy_id_mask = 0x0fffff00,
> > > + .name = "ET1011C Gigabit Ethernet",
> > > + .ops = &et1011c_phy_ops
> > > +};
> > > +
> > > +
> > > +
> > > +
> > > +
> >
> > Nitpicking: Too many empty lines for my taste.
>
> Agreed, I though I had removed them, looks like I didn't. Will fix that
> before submitting.
DENX is pretty good about having Signed-off-by lines in their tree...
maybe you should add the original authors as well if it's there.
josh
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/6] ibm_newemac: Add ET1011c PHY support
2007-11-08 12:08 ` Josh Boyer
@ 2007-11-08 20:55 ` Benjamin Herrenschmidt
2007-11-09 5:44 ` Stefan Roese
0 siblings, 1 reply; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-08 20:55 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev, Stefan Roese
On Thu, 2007-11-08 at 06:08 -0600, Josh Boyer wrote:
> > Agreed, I though I had removed them, looks like I didn't. Will fix
> that
> > before submitting.
>
> DENX is pretty good about having Signed-off-by lines in their tree...
> maybe you should add the original authors as well if it's there.
I picked it up from an already patched tree. Stefan, can you provide me
the proper SOB ?
Thanks,
Ben.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/6] ibm_newemac: Add ET1011c PHY support
2007-11-08 20:55 ` Benjamin Herrenschmidt
@ 2007-11-09 5:44 ` Stefan Roese
0 siblings, 0 replies; 16+ messages in thread
From: Stefan Roese @ 2007-11-09 5:44 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
On Thursday 08 November 2007, Benjamin Herrenschmidt wrote:
> > DENX is pretty good about having Signed-off-by lines in their tree...
> > maybe you should add the original authors as well if it's there.
>
> I picked it up from an already patched tree. Stefan, can you provide me
> the proper SOB ?
Sure:
Signed-off-by: Stefan Roese <sr@denx.de>
Thanks.
Best regards,
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2007-11-09 5:45 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08 8:06 [PATCH 0/6] ibm_newemac: Pending patches for review Benjamin Herrenschmidt
2007-11-08 8:06 ` [PATCH 1/6] ibm_newemac: Add BCM5248 and Marvell 88E1111 PHY support Benjamin Herrenschmidt
2007-11-08 8:06 ` [PATCH 2/6] ibm_newemac: Add ET1011c " Benjamin Herrenschmidt
2007-11-08 8:41 ` Stefan Roese
2007-11-08 8:42 ` Benjamin Herrenschmidt
2007-11-08 12:08 ` Josh Boyer
2007-11-08 20:55 ` Benjamin Herrenschmidt
2007-11-09 5:44 ` Stefan Roese
2007-11-08 8:06 ` [PATCH 3/6] ibm_newemac: Fix ZMII refcounting bug Benjamin Herrenschmidt
2007-11-08 8:43 ` Stefan Roese
2007-11-08 8:06 ` [PATCH 4/6] ibm_newemac: Workaround reset timeout when no link Benjamin Herrenschmidt
2007-11-08 8:44 ` Stefan Roese
2007-11-08 8:07 ` [PATCH 5/6] ibm_newemac: Cleanup/Fix RGMII MDIO support detection Benjamin Herrenschmidt
2007-11-08 9:24 ` Stefan Roese
2007-11-08 8:07 ` [PATCH 6/6] ibm_newemac: Cleanup/fix support for STACR register variants Benjamin Herrenschmidt
2007-11-08 9:38 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).