* [PATCH] drivers/net: spidernet driver on Celleb
@ 2006-12-12 5:25 Ishizaki Kou
2006-12-12 12:24 ` Christoph Hellwig
2006-12-13 1:14 ` Linas Vepstas
0 siblings, 2 replies; 7+ messages in thread
From: Ishizaki Kou @ 2006-12-12 5:25 UTC (permalink / raw)
To: jim, netdev; +Cc: linuxppc-dev
Following are the changes.
-This patch enables auto-negotiation.
-Loading firmware is done when spidernet_open() is called.
-And this patch adds other several small changes for Celleb.
-This patch is not tested on CellBlade.
Signed-off-by: Kou Ishizaki <kou.ishizaki at toshiba.co.jp>
---
Dear everyone,
This is the patch (besed on powerpc-git (2006-12-05)) for spidernet driver to
work on Toshiba Cell reference set(Celleb).
The reference set consists of Cell, 512MB memory, Super Companion Chip(SCC)
and some peripherals such as HDD, GbE, etc. You can see brief explanation
and picture of Cell reference set at following URLs.
http://www.toshiba.co.jp/about/press/2005_09/pr2001.htm
http://cell-industries.com/toshiba_announces.php
This patch set is intended to be merged to 2.6.20.
If you have any comment, please write to me.
---
Index: linux-2.6.19/drivers/net/Kconfig
diff -u linux-2.6.19/drivers/net/Kconfig:1.1.1.4 linux-2.6.19/drivers/net/Kconfig:1.6
--- linux-2.6.19/drivers/net/Kconfig:1.1.1.4 Tue Nov 14 11:15:25 2006
+++ linux-2.6.19/drivers/net/Kconfig Fri Dec 1 15:16:10 2006
@@ -2245,7 +2245,7 @@
config SPIDER_NET
tristate "Spider Gigabit Ethernet driver"
- depends on PCI && PPC_IBM_CELL_BLADE
+ depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB)
select FW_LOADER
help
This driver supports the Gigabit Ethernet chips present on the
Index: linux-2.6.19/drivers/net/spider_net.h
diff -u linux-2.6.19/drivers/net/spider_net.h:1.1.1.2 linux-2.6.19/drivers/net/spider_net.h:1.5
--- linux-2.6.19/drivers/net/spider_net.h:1.1.1.2 Tue Oct 17 08:42:39 2006
+++ linux-2.6.19/drivers/net/spider_net.h Tue Nov 7 12:36:35 2006
@@ -1,7 +1,8 @@
/*
- * Network device driver for Cell Processor-Based Blade
+ * Network device driver for Cell Processor-Based Blade and Celleb platform
*
* (C) Copyright IBM Corp. 2005
+ * (C) Copyright 2006 TOSHIBA CORPORATION
*
* Authors : Utz Bacher <utz.bacher@de.ibm.com>
* Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
@@ -50,6 +51,7 @@
#define SPIDER_NET_TX_DESCRIPTORS_MAX 512
#define SPIDER_NET_TX_TIMER (HZ/5)
+#define SPIDER_NET_ANEG_TIMER (HZ*2)
#define SPIDER_NET_RX_CSUM_DEFAULT 1
@@ -104,6 +106,7 @@
#define SPIDER_NET_GMACOPEMD 0x00000100
#define SPIDER_NET_GMACLENLMT 0x00000108
+#define SPIDER_NET_GMACST 0x00000110
#define SPIDER_NET_GMACINTEN 0x00000118
#define SPIDER_NET_GMACPHYCTRL 0x00000120
@@ -180,8 +183,8 @@
#define SPIDER_NET_IPSECINIT_VALUE 0x6f716f71
/* pause frames: automatic, no upper retransmission count */
-/* outside loopback mode: ETOMOD signal dont matter, not connected */
-#define SPIDER_NET_OPMODE_VALUE 0x00000063
+/* ETOMOD signal is brought to PHY reset. bit2 must be 1 in Celleb */
+#define SPIDER_NET_OPMODE_VALUE 0x00000067
/*#define SPIDER_NET_OPMODE_VALUE 0x001b0062*/
#define SPIDER_NET_LENLMT_VALUE 0x00000908
@@ -333,9 +336,12 @@
/* We rely on flagged descriptor interrupts */
#define SPIDER_NET_RXINT ( (1 << SPIDER_NET_GDAFDCINT) )
+#define SPIDER_NET_LINKINT ( 1 << SPIDER_NET_GMAC2INT )
+
#define SPIDER_NET_ERRINT ( 0xffffffff & \
(~SPIDER_NET_TXINT) & \
- (~SPIDER_NET_RXINT) )
+ (~SPIDER_NET_RXINT) & \
+ (~SPIDER_NET_LINKINT) )
#define SPIDER_NET_GPREXEC 0x80000000
#define SPIDER_NET_GPRDAT_MASK 0x0000ffff
@@ -447,6 +453,8 @@
spinlock_t intmask_lock;
struct tasklet_struct rxram_full_tl;
+ int aneg_count;
+ struct timer_list aneg_timer;
struct timer_list tx_timer;
struct work_struct tx_timeout_task;
Index: linux-2.6.19/drivers/net/spider_net.c
diff -u linux-2.6.19/drivers/net/spider_net.c:1.1.1.2 linux-2.6.19/drivers/net/spider_net.c:1.10
--- linux-2.6.19/drivers/net/spider_net.c:1.1.1.2 Tue Oct 17 08:42:39 2006
+++ linux-2.6.19/drivers/net/spider_net.c Tue Dec 5 20:30:42 2006
@@ -1,7 +1,8 @@
/*
- * Network device driver for Cell Processor-Based Blade
+ * Network device driver for Cell Processor-Based Blade and Celleb platform
*
* (C) Copyright IBM Corp. 2005
+ * (C) Copyright 2006 TOSHIBA CORPORATION
*
* Authors : Utz Bacher <utz.bacher@de.ibm.com>
* Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
@@ -78,6 +79,8 @@
MODULE_DEVICE_TABLE(pci, spider_net_pci_tbl);
+static int is1000 = 1;
+
/**
* spider_net_read_reg - reads an SMMIO register of a card
* @card: device structure
@@ -163,6 +166,53 @@
return readvalue;
}
+static void
+spider_net_setup_aneg(struct spider_net_card *card, int is1000)
+{
+ struct mii_phy *phy = &card->phy;
+ u32 advertise = 0;
+ u16 bmcr, bmsr, ctrl1000, stat1000, estat;
+
+ bmcr = spider_net_read_phy(card->netdev, phy->mii_id, MII_BMCR);
+ bmsr = spider_net_read_phy(card->netdev, phy->mii_id, MII_BMSR);
+ ctrl1000 = spider_net_read_phy(card->netdev, phy->mii_id, MII_CTRL1000);
+ stat1000 = spider_net_read_phy(card->netdev, phy->mii_id, MII_STAT1000);
+ estat = spider_net_read_phy(card->netdev, phy->mii_id, MII_ESTATUS);
+
+ if (bmsr & BMSR_10HALF)
+ advertise |= ADVERTISE_10HALF;
+ if (bmsr & BMSR_10FULL)
+ advertise |= ADVERTISE_10FULL;
+ if (bmsr & BMSR_100HALF)
+ advertise |= ADVERTISE_100HALF;
+ if (bmsr & BMSR_100FULL)
+ advertise |= ADVERTISE_100FULL;
+ if (bmsr & BMSR_100BASE4)
+ advertise |= ADVERTISE_100BASE4;
+
+ if (is1000) {
+ if ((bmsr & BMSR_ESTATEN) && (estat & ESTATUS_1000_TFULL)) {
+ advertise |= ADVERTISE_1000XFULL;
+ ctrl1000 |= ADVERTISE_1000FULL;
+ }
+ if ((bmsr & BMSR_ESTATEN) && (estat & ESTATUS_1000_THALF)) {
+ advertise |= ADVERTISE_1000XHALF;
+ ctrl1000 |= ADVERTISE_1000HALF;
+ }
+
+ spider_net_write_phy(card->netdev, phy->mii_id,
+ MII_CTRL1000, ctrl1000);
+ spider_net_write_reg(card, SPIDER_NET_GMACMODE, 0x00000001);
+
+ phy->def->ops->setup_aneg(phy, advertise);
+ } else {
+ spider_net_write_reg(card, SPIDER_NET_GMACMODE, 0);
+ bmcr |= (BMCR_ANRESTART | BMCR_ANENABLE);
+ spider_net_write_phy(card->netdev, phy->mii_id,
+ MII_BMCR, bmcr);
+ }
+}
+
/**
* spider_net_rx_irq_off - switch off rx irq on this spider card
* @card: device structure
@@ -1233,6 +1283,31 @@
}
/**
+ * spider_net_link_reset
+ * @netdev: net device structure
+ *
+ */
+static void
+spider_net_link_reset(struct net_device *netdev)
+{
+
+ struct spider_net_card *card=netdev_priv(netdev);
+
+ del_timer_sync(&card->aneg_timer);
+
+ spider_net_write_reg(card, SPIDER_NET_GMACST,
+ spider_net_read_reg(card, SPIDER_NET_GMACST));
+ spider_net_write_reg(card, SPIDER_NET_GMACINTEN, 0);
+
+ mii_phy_probe(&card->phy, card->phy.mii_id);
+ spider_net_setup_aneg(card, is1000);
+ if (card->phy.def->phy_id)
+ mod_timer(&card->aneg_timer, jiffies + SPIDER_NET_ANEG_TIMER);
+ else
+ pr_err("No phy is available\n");
+}
+
+/**
* spider_net_handle_rxram_full - cleans up RX ring upon RX RAM full interrupt
* @card: card structure
*
@@ -1362,8 +1437,8 @@
switch (i)
{
case SPIDER_NET_GTMFLLINT:
- if (netif_msg_intr(card) && net_ratelimit())
- pr_err("Spider TX RAM full\n");
+ /* if (netif_msg_intr(card) && net_ratelimit())
+ pr_err("Spider TX RAM full\n"); */
show_error = 0;
break;
case SPIDER_NET_GRFDFLLINT: /* fallthrough */
@@ -1503,6 +1578,9 @@
if (status_reg & SPIDER_NET_TXINT)
netif_rx_schedule(netdev);
+ if (status_reg & SPIDER_NET_LINKINT)
+ spider_net_link_reset(netdev);
+
if (status_reg & SPIDER_NET_ERRINT )
spider_net_handle_error_irq(card, status_reg);
@@ -1543,6 +1621,10 @@
spider_net_write_reg(card, SPIDER_NET_CKRCTRL,
SPIDER_NET_CKRCTRL_RUN_VALUE);
+
+ spider_net_write_reg(card, SPIDER_NET_GMACOPEMD,
+ spider_net_read_reg(card, SPIDER_NET_GMACOPEMD) | 0x4);
+
}
/**
@@ -1627,8 +1709,6 @@
spider_net_write_reg(card, SPIDER_NET_GMACLENLMT,
SPIDER_NET_LENLMT_VALUE);
- spider_net_write_reg(card, SPIDER_NET_GMACMODE,
- SPIDER_NET_MACMODE_VALUE);
spider_net_write_reg(card, SPIDER_NET_GMACOPEMD,
SPIDER_NET_OPMODE_VALUE);
@@ -1644,6 +1724,7 @@
SPIDER_NET_GDTBSTA | SPIDER_NET_GDTDCEIDIS);
}
+static int spider_net_init_firmware(struct spider_net_card *);
/**
* spider_net_open - called upon ifonfig up
* @netdev: interface device structure
@@ -1661,6 +1742,16 @@
int i, result;
result = -ENOMEM;
+ if (spider_net_init_firmware(card))
+ goto init_firmware_failed;
+
+ spider_net_setup_aneg(card, is1000);
+ if (card->phy.def->phy_id)
+ mod_timer(&card->aneg_timer, jiffies + SPIDER_NET_ANEG_TIMER);
+ else
+ pr_err("No phy is available\n");
+
+
if (spider_net_init_chain(card, &card->tx_chain, card->descr,
card->num_tx_desc))
goto alloc_tx_failed;
@@ -1705,9 +1796,60 @@
alloc_rx_failed:
spider_net_free_chain(card, &card->tx_chain);
alloc_tx_failed:
+init_firmware_failed:
return result;
}
+static void spider_net_init_card(struct spider_net_card *);
+/**
+ * spider_net_link_phy
+ * @data: used for pointer to card structure
+ *
+ */
+static void spider_net_link_phy(unsigned long data)
+{
+ struct spider_net_card *card = (struct spider_net_card *)data;
+ struct mii_phy *phy = &card->phy;
+
+ if (card->aneg_count > 10) {
+ /* timeout */
+ card->aneg_count = 0;
+ is1000 = !is1000;
+ goto re_setup;
+ }
+
+ if (!(phy->def->ops->poll_link(phy))) {
+ card->aneg_count++;
+ mod_timer(&card->aneg_timer, jiffies + SPIDER_NET_ANEG_TIMER);
+ return;
+ }
+
+ phy->def->ops->read_link(phy);
+
+ if (phy->speed == 1000 && !is1000) {
+ is1000 = 1;
+ goto re_setup;
+ } else if(phy->speed != 1000 && is1000) {
+ is1000 = 0;
+ goto re_setup;
+ }
+
+ spider_net_write_reg(card, SPIDER_NET_GMACST,
+ spider_net_read_reg(card, SPIDER_NET_GMACST));
+ spider_net_write_reg(card, SPIDER_NET_GMACINTEN, 0x4);
+
+ pr_info("Found %s with %i Mbps, %s-duplex.\n",
+ phy->def->name, phy->speed, phy->duplex==1 ? "Full" : "Half");
+
+ return;
+
+re_setup:
+ mii_phy_probe(phy, phy->mii_id);
+ spider_net_setup_aneg(card, is1000);
+ card->aneg_count = 0;
+ mod_timer(&card->aneg_timer, jiffies + SPIDER_NET_ANEG_TIMER);
+}
+
/**
* spider_net_setup_phy - setup PHY
* @card: card structure
@@ -1726,21 +1868,19 @@
SPIDER_NET_DMASEL_VALUE);
spider_net_write_reg(card, SPIDER_NET_GPCCTRL,
SPIDER_NET_PHY_CTRL_VALUE);
- phy->mii_id = 1;
+
phy->dev = card->netdev;
phy->mdio_read = spider_net_read_phy;
phy->mdio_write = spider_net_write_phy;
- mii_phy_probe(phy, phy->mii_id);
-
- if (phy->def->ops->setup_forced)
- phy->def->ops->setup_forced(phy, SPEED_1000, DUPLEX_FULL);
-
- phy->def->ops->enable_fiber(phy);
-
- phy->def->ops->read_link(phy);
- pr_info("Found %s with %i Mbps, %s-duplex.\n", phy->def->name,
- phy->speed, phy->duplex==1 ? "Full" : "Half");
+ for (phy->mii_id = 1; phy->mii_id <= 31; phy->mii_id++) {
+ unsigned short id;
+ id = spider_net_read_phy(card->netdev, phy->mii_id, MII_BMSR);
+ if (id != 0x0000 && id != 0xffff) {
+ mii_phy_probe(phy, phy->mii_id);
+ break;
+ }
+ }
return 0;
}
@@ -1913,11 +2053,13 @@
netif_carrier_off(netdev);
netif_stop_queue(netdev);
del_timer_sync(&card->tx_timer);
+ del_timer_sync(&card->aneg_timer);
/* disable/mask all interrupts */
spider_net_write_reg(card, SPIDER_NET_GHIINT0MSK, 0);
spider_net_write_reg(card, SPIDER_NET_GHIINT1MSK, 0);
spider_net_write_reg(card, SPIDER_NET_GHIINT2MSK, 0);
+ spider_net_write_reg(card, SPIDER_NET_GMACINTEN, 0);
/* free_irq(netdev->irq, netdev);*/
free_irq(to_pci_dev(netdev->class_dev.dev)->irq, netdev);
@@ -1961,8 +2103,6 @@
if (spider_net_setup_phy(card))
goto out;
- if (spider_net_init_firmware(card))
- goto out;
spider_net_open(netdev);
spider_net_kick_tx_dma(card);
@@ -2058,6 +2198,11 @@
card->tx_timer.data = (unsigned long) card;
netdev->irq = card->pdev->irq;
+ card->aneg_count = 0;
+ init_timer(&card->aneg_timer);
+ card->aneg_timer.function = spider_net_link_phy;
+ card->aneg_timer.data = (unsigned long) card;
+
card->options.rx_csum = SPIDER_NET_RX_CSUM_DEFAULT;
card->num_tx_desc = tx_descriptors;
@@ -2236,10 +2381,6 @@
if (err)
goto out_undo_pci;
- err = spider_net_init_firmware(card);
- if (err)
- goto out_undo_pci;
-
err = spider_net_setup_netdev(card);
if (err)
goto out_undo_pci;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drivers/net: spidernet driver on Celleb
2006-12-12 5:25 [PATCH] drivers/net: spidernet driver on Celleb Ishizaki Kou
@ 2006-12-12 12:24 ` Christoph Hellwig
2006-12-14 11:02 ` Ishizaki Kou
2006-12-13 1:14 ` Linas Vepstas
1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2006-12-12 12:24 UTC (permalink / raw)
To: Ishizaki Kou; +Cc: jim, netdev, linuxppc-dev
On Tue, Dec 12, 2006 at 02:25:50PM +0900, Ishizaki Kou wrote:
>
> Following are the changes.
> -This patch enables auto-negotiation.
> -Loading firmware is done when spidernet_open() is called.
> -And this patch adds other several small changes for Celleb.
This should be split into three separate patches, sent as a patch
series.
> -/* outside loopback mode: ETOMOD signal dont matter, not connected */
> -#define SPIDER_NET_OPMODE_VALUE 0x00000063
> +/* ETOMOD signal is brought to PHY reset. bit2 must be 1 in Celleb */
> +#define SPIDER_NET_OPMODE_VALUE 0x00000067
Is it okay to simple change this value for the ibm blades?
> +static int is1000 = 1;
This should be in struct spider_net_card instead of a global flag.
> case SPIDER_NET_GTMFLLINT:
> - if (netif_msg_intr(card) && net_ratelimit())
> - pr_err("Spider TX RAM full\n");
> + /* if (netif_msg_intr(card) && net_ratelimit())
> + pr_err("Spider TX RAM full\n"); */
Either this should be kept or removed entirely. In the latter case you
need a good description why it's removed in the patch header.
> +
> + spider_net_write_reg(card, SPIDER_NET_GMACOPEMD,
> + spider_net_read_reg(card, SPIDER_NET_GMACOPEMD) | 0x4);
Please make sure this doesn't overflow the 80 characters per line limit.
> +static int spider_net_init_firmware(struct spider_net_card *);
Random forward declarations in the middle of the file aren't very nice.
If you really need them put them at the beggining of the file, but it would
be even better if you moved spider_net_init_firmware further up in the
file so we wouldn't need the forward-declaration at all.
> + if (card->phy.def->phy_id)
> + mod_timer(&card->aneg_timer, jiffies + SPIDER_NET_ANEG_TIMER);
> + else
> + pr_err("No phy is available\n");
What is this idiom about? Is not having a phy a fatal error in which case
we should abort here, or is it tolerable in which case pr_err is too much.
> +static void spider_net_init_card(struct spider_net_card *);
Same comment above forward declarations as above.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drivers/net: spidernet driver on Celleb
2006-12-12 5:25 [PATCH] drivers/net: spidernet driver on Celleb Ishizaki Kou
2006-12-12 12:24 ` Christoph Hellwig
@ 2006-12-13 1:14 ` Linas Vepstas
2006-12-13 3:54 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 7+ messages in thread
From: Linas Vepstas @ 2006-12-13 1:14 UTC (permalink / raw)
To: Ishizaki Kou; +Cc: jim, netdev, linuxppc-dev
On Tue, Dec 12, 2006 at 02:25:50PM +0900, Ishizaki Kou wrote:
>
> Following are the changes.
> -This patch enables auto-negotiation.
> -Loading firmware is done when spidernet_open() is called.
> -And this patch adds other several small changes for Celleb.
> -This patch is not tested on CellBlade.
I just tested this, and it does not work. Jim Lewis is gone
until the new year. However, as he was leaving, he grumbled something
about how autonegotiation simply won't work on the spider.
(I didn't think to ask about the details). Perhaps he'll
look at his email soon?
I've been trying to figure out how to modify the patch to make it
work anyway, but so far, no success.
Basically, in genmii_poll_link(),
status = phy_read(phy, MII_BMSR);
status & BMSR_LSTATUS will always be zero.
So I tried ignoring this value, and calling setup_forced()
However, this still doesn't get the thing working.
I am somewhat at a loss to see why right now, since
I don't see what may be causing this.
--linas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drivers/net: spidernet driver on Celleb
2006-12-13 1:14 ` Linas Vepstas
@ 2006-12-13 3:54 ` Benjamin Herrenschmidt
2006-12-13 6:30 ` Jim Lewis
2006-12-13 16:52 ` Linas Vepstas
0 siblings, 2 replies; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2006-12-13 3:54 UTC (permalink / raw)
To: Linas Vepstas; +Cc: Ishizaki Kou, netdev, jim, linuxppc-dev
On Tue, 2006-12-12 at 19:14 -0600, Linas Vepstas wrote:
> On Tue, Dec 12, 2006 at 02:25:50PM +0900, Ishizaki Kou wrote:
> >
> > Following are the changes.
> > -This patch enables auto-negotiation.
> > -Loading firmware is done when spidernet_open() is called.
> > -And this patch adds other several small changes for Celleb.
> > -This patch is not tested on CellBlade.
>
> I just tested this, and it does not work. Jim Lewis is gone
> until the new year. However, as he was leaving, he grumbled something
> about how autonegotiation simply won't work on the spider.
> (I didn't think to ask about the details). Perhaps he'll
> look at his email soon?
Duh ? Autoneg is completely local to the PHY. It will not work on the
Cell blade because it's using a fiber link though, thus we probably need
to disable this code when running on a fiber link.
> I've been trying to figure out how to modify the patch to make it
> work anyway, but so far, no success.
>
> Basically, in genmii_poll_link(),
> status = phy_read(phy, MII_BMSR);
> status & BMSR_LSTATUS will always be zero.
>
> So I tried ignoring this value, and calling setup_forced()
> However, this still doesn't get the thing working.
> I am somewhat at a loss to see why right now, since
> I don't see what may be causing this.
I can have a look, most of the code was borrowed from sungem and I wrote
the MII code for it :-)
Ben.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drivers/net: spidernet driver on Celleb
2006-12-13 3:54 ` Benjamin Herrenschmidt
@ 2006-12-13 6:30 ` Jim Lewis
2006-12-13 16:52 ` Linas Vepstas
1 sibling, 0 replies; 7+ messages in thread
From: Jim Lewis @ 2006-12-13 6:30 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Linas Vepstas, Ishizaki Kou, netdev, linuxppc-dev
I got a note from Jens earlier today that mentioned some changes he has
made to the PHY code. He plans to get those in soon, so this might be
solved already.
Jim Lewis
On Wed, 2006-12-13 at 14:54 +1100, Benjamin Herrenschmidt wrote:
> On Tue, 2006-12-12 at 19:14 -0600, Linas Vepstas wrote:
> > On Tue, Dec 12, 2006 at 02:25:50PM +0900, Ishizaki Kou wrote:
> > >
> > > Following are the changes.
> > > -This patch enables auto-negotiation.
> > > -Loading firmware is done when spidernet_open() is called.
> > > -And this patch adds other several small changes for Celleb.
> > > -This patch is not tested on CellBlade.
> >
> > I just tested this, and it does not work. Jim Lewis is gone
> > until the new year. However, as he was leaving, he grumbled something
> > about how autonegotiation simply won't work on the spider.
> > (I didn't think to ask about the details). Perhaps he'll
> > look at his email soon?
>
> Duh ? Autoneg is completely local to the PHY. It will not work on the
> Cell blade because it's using a fiber link though, thus we probably need
> to disable this code when running on a fiber link.
>
> > I've been trying to figure out how to modify the patch to make it
> > work anyway, but so far, no success.
> >
> > Basically, in genmii_poll_link(),
> > status = phy_read(phy, MII_BMSR);
> > status & BMSR_LSTATUS will always be zero.
> >
> > So I tried ignoring this value, and calling setup_forced()
> > However, this still doesn't get the thing working.
> > I am somewhat at a loss to see why right now, since
> > I don't see what may be causing this.
>
> I can have a look, most of the code was borrowed from sungem and I wrote
> the MII code for it :-)
>
> Ben.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drivers/net: spidernet driver on Celleb
2006-12-13 3:54 ` Benjamin Herrenschmidt
2006-12-13 6:30 ` Jim Lewis
@ 2006-12-13 16:52 ` Linas Vepstas
1 sibling, 0 replies; 7+ messages in thread
From: Linas Vepstas @ 2006-12-13 16:52 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Ishizaki Kou, netdev, jim, linuxppc-dev
On Wed, Dec 13, 2006 at 02:54:37PM +1100, Benjamin Herrenschmidt wrote:
> Cell blade because it's using a fiber link
Oh. I didn't know that.
--linas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drivers/net: spidernet driver on Celleb
2006-12-12 12:24 ` Christoph Hellwig
@ 2006-12-14 11:02 ` Ishizaki Kou
0 siblings, 0 replies; 7+ messages in thread
From: Ishizaki Kou @ 2006-12-14 11:02 UTC (permalink / raw)
To: hch; +Cc: netdev, jim, linuxppc-dev
Christoph-san,
Thanks for your comments.
>On Tue, Dec 12, 2006 at 02:25:50PM +0900, Ishizaki Kou wrote:
>>
>> Following are the changes.
>> -This patch enables auto-negotiation.
>> -Loading firmware is done when spidernet_open() is called.
>> -And this patch adds other several small changes for Celleb.
>
>This should be split into three separate patches, sent as a patch
>series.
We are now working to separeting the patch. We'll send later.
>> -/* outside loopback mode: ETOMOD signal dont matter, not connected */
>> -#define SPIDER_NET_OPMODE_VALUE 0x00000063
>> +/* ETOMOD signal is brought to PHY reset. bit2 must be 1 in Celleb */
>> +#define SPIDER_NET_OPMODE_VALUE 0x00000067
>
>Is it okay to simple change this value for the ibm blades?
Sorry, we didn't test on ibm blades, because we don't have one.
We hope to develop together so that the driver works on both platform.
>> +static int is1000 = 1;
>
>This should be in struct spider_net_card instead of a global flag.
We'll move it in struct spider_net_card.
>> case SPIDER_NET_GTMFLLINT:
>> - if (netif_msg_intr(card) && net_ratelimit())
>> - pr_err("Spider TX RAM full\n");
>> + /* if (netif_msg_intr(card) && net_ratelimit())
>> + pr_err("Spider TX RAM full\n"); */
>
>Either this should be kept or removed entirely. In the latter case you
>need a good description why it's removed in the patch header.
We'll remove it entirely.
GTMFLLINT occures frequently when we use 100M HUB. We didn't find any
bad influence by this interrupt so far, so we removed the output.
>> +
>> + spider_net_write_reg(card, SPIDER_NET_GMACOPEMD,
>> + spider_net_read_reg(card, SPIDER_NET_GMACOPEMD) | 0x4);
>
>Please make sure this doesn't overflow the 80 characters per line limit.
We'll correct it.
>> +static int spider_net_init_firmware(struct spider_net_card *);
>
>Random forward declarations in the middle of the file aren't very nice.
>If you really need them put them at the beggining of the file, but it would
>be even better if you moved spider_net_init_firmware further up in the
>file so we wouldn't need the forward-declaration at all.
We'll move some functions.
>> + if (card->phy.def->phy_id)
>> + mod_timer(&card->aneg_timer, jiffies + SPIDER_NET_ANEG_TIMER);
>> + else
>> + pr_err("No phy is available\n");
>
>What is this idiom about? Is not having a phy a fatal error in which case
>we should abort here, or is it tolerable in which case pr_err is too much.
Checking phy_id is not required here, so we'll change to call
mod_timer() simply.
>> +static void spider_net_init_card(struct spider_net_card *);
>
>Same comment above forward declarations as above.
Thank you,
Kou Ishizaki
Toshiba
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-12-14 11:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-12 5:25 [PATCH] drivers/net: spidernet driver on Celleb Ishizaki Kou
2006-12-12 12:24 ` Christoph Hellwig
2006-12-14 11:02 ` Ishizaki Kou
2006-12-13 1:14 ` Linas Vepstas
2006-12-13 3:54 ` Benjamin Herrenschmidt
2006-12-13 6:30 ` Jim Lewis
2006-12-13 16:52 ` Linas Vepstas
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).