* [PATCH 11/14] spidernet: fix Kconfig after BPA->CELL rename
[not found] <20051206035220.097737000@localhost>
@ 2005-12-06 3:52 ` Arnd Bergmann
2005-12-06 3:52 ` [PATCH 12/14] spidernet: check if firmware was loaded correctly Arnd Bergmann
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2005-12-06 3:52 UTC (permalink / raw)
To: paulus; +Cc: linuxppc64-dev, netdev, Arnd Bergmann, Jens.Osterkamp
[-- Attachment #1: spidernet-with-pci-and-cell.diff --]
[-- Type: text/plain, Size: 710 bytes --]
We changed the name of the Kconfig symbols along with
the move to arch/powerpc. This one hunk got lost during
the conversion.
From: Jens.Osterkamp@de.ibm.com
Cc: netdev@vger.kernel.org
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Index: linux-2.6.15-rc1/drivers/net/Kconfig
===================================================================
--- linux-2.6.15-rc1.orig/drivers/net/Kconfig
+++ linux-2.6.15-rc1/drivers/net/Kconfig
@@ -2120,7 +2120,7 @@ config BNX2
config SPIDER_NET
tristate "Spider Gigabit Ethernet driver"
- depends on PCI && PPC_BPA
+ depends on PCI && PPC_CELL
help
This driver supports the Gigabit Ethernet chips present on the
Cell Processor-Based Blades from IBM.
--
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 12/14] spidernet: check if firmware was loaded correctly
[not found] <20051206035220.097737000@localhost>
2005-12-06 3:52 ` [PATCH 11/14] spidernet: fix Kconfig after BPA->CELL rename Arnd Bergmann
@ 2005-12-06 3:52 ` Arnd Bergmann
2005-12-06 0:59 ` Paul Mackerras
2005-12-06 3:52 ` [PATCH 13/14] spidernet: read firmware from the OF device tree Arnd Bergmann
2005-12-06 3:52 ` [PATCH 14/14] spidernet: fix HW structures for 64 bit dma_addr_t Arnd Bergmann
3 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2005-12-06 3:52 UTC (permalink / raw)
To: paulus; +Cc: linuxppc64-dev, netdev, Arnd Bergmann, Jens.Osterkamp
[-- Attachment #1: spidernet-programcheck.diff --]
[-- Type: text/plain, Size: 1798 bytes --]
Uploading the device firmware may fail if wrong input data
was provided by the user. This checks for the condition.
From: Jens.Osterkamp@de.ibm.com
Cc: netdev@vger.kernel.org
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Index: linux-2.6.15-rc/drivers/net/spider_net.c
===================================================================
--- linux-2.6.15-rc.orig/drivers/net/spider_net.c
+++ linux-2.6.15-rc/drivers/net/spider_net.c
@@ -1836,7 +1836,7 @@ spider_net_setup_phy(struct spider_net_c
* spider_net_download_firmware loads the firmware opened by
* spider_net_init_firmware into the adapter.
*/
-static void
+static int
spider_net_download_firmware(struct spider_net_card *card,
const struct firmware *firmware)
{
@@ -1857,8 +1857,13 @@ spider_net_download_firmware(struct spid
}
}
+ if (spider_net_read_reg(card, SPIDER_NET_GSINIT))
+ return -EIO;
+
spider_net_write_reg(card, SPIDER_NET_GSINIT,
SPIDER_NET_RUN_SEQ_VALUE);
+
+ return 0;
}
/**
@@ -1909,9 +1914,8 @@ spider_net_init_firmware(struct spider_n
goto out;
}
- spider_net_download_firmware(card, firmware);
-
- err = 0;
+ if (!spider_net_download_firmware(card, firmware))
+ err = 0;
out:
release_firmware(firmware);
Index: linux-2.6.15-rc/drivers/net/spider_net.h
===================================================================
--- linux-2.6.15-rc.orig/drivers/net/spider_net.h
+++ linux-2.6.15-rc/drivers/net/spider_net.h
@@ -155,7 +155,7 @@ extern char spider_net_driver_name[];
/* set this first, then the FRAMENUM_VALUE */
#define SPIDER_NET_GFXFRAMES_VALUE 0x00000000
-#define SPIDER_NET_STOP_SEQ_VALUE 0x00000000
+#define SPIDER_NET_STOP_SEQ_VALUE 0x007e0000
#define SPIDER_NET_RUN_SEQ_VALUE 0x0000007e
#define SPIDER_NET_PHY_CTRL_VALUE 0x00040040
--
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 12/14] spidernet: check if firmware was loaded correctly
2005-12-06 3:52 ` [PATCH 12/14] spidernet: check if firmware was loaded correctly Arnd Bergmann
@ 2005-12-06 0:59 ` Paul Mackerras
2005-12-06 10:23 ` Arnd Bergmann
0 siblings, 1 reply; 7+ messages in thread
From: Paul Mackerras @ 2005-12-06 0:59 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc64-dev, netdev, Arnd Bergmann, Jens.Osterkamp
Arnd Bergmann writes:
> Uploading the device firmware may fail if wrong input data
> was provided by the user. This checks for the condition.
>
> From: Jens.Osterkamp@de.ibm.com
> Cc: netdev@vger.kernel.org
This one should be sent to Jeff Garzik, along with patches 11, 13 and
14.
Paul.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 12/14] spidernet: check if firmware was loaded correctly
2005-12-06 0:59 ` Paul Mackerras
@ 2005-12-06 10:23 ` Arnd Bergmann
2005-12-07 9:53 ` Jens Osterkamp
0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2005-12-06 10:23 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc64-dev, netdev, Jens.Osterkamp
On Dinsdag 06 Dezember 2005 01:59, Paul Mackerras wrote:
> Arnd Bergmann writes:
>
> > Uploading the device firmware may fail if wrong input data
> > was provided by the user. This checks for the condition.
> >
> > From: Jens.Osterkamp@de.ibm.com
> > Cc: netdev@vger.kernel.org
>
> This one should be sent to Jeff Garzik, along with patches 11, 13 and
> 14.
Ok.
Jens, is it ok for you if you send the network driver stuff to
jgarzik@pobox.com, Cc: netdev@vger.kernel.org yourself in the future?
Arnd <><
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 12/14] spidernet: check if firmware was loaded correctly
2005-12-06 10:23 ` Arnd Bergmann
@ 2005-12-07 9:53 ` Jens Osterkamp
0 siblings, 0 replies; 7+ messages in thread
From: Jens Osterkamp @ 2005-12-07 9:53 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc64-dev, Paul Mackerras, netdev
Arnd Bergmann <arnd@arndb.de> wrote on 12/06/2005 11:23:39 AM:
> On Dinsdag 06 Dezember 2005 01:59, Paul Mackerras wrote:
> > Arnd Bergmann writes:
> >
> > > Uploading the device firmware may fail if wrong input data
> > > was provided by the user. This checks for the condition.
> > >
> > > From: Jens.Osterkamp@de.ibm.com
> > > Cc: netdev@vger.kernel.org
> >
> > This one should be sent to Jeff Garzik, along with patches 11, 13 and
> > 14.
>
> Ok.
>
> Jens, is it ok for you if you send the network driver stuff to
> jgarzik@pobox.com, Cc: netdev@vger.kernel.org yourself in the future?
Sure, I will do so for our next updates.
Jens
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 13/14] spidernet: read firmware from the OF device tree
[not found] <20051206035220.097737000@localhost>
2005-12-06 3:52 ` [PATCH 11/14] spidernet: fix Kconfig after BPA->CELL rename Arnd Bergmann
2005-12-06 3:52 ` [PATCH 12/14] spidernet: check if firmware was loaded correctly Arnd Bergmann
@ 2005-12-06 3:52 ` Arnd Bergmann
2005-12-06 3:52 ` [PATCH 14/14] spidernet: fix HW structures for 64 bit dma_addr_t Arnd Bergmann
3 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2005-12-06 3:52 UTC (permalink / raw)
To: paulus; +Cc: linuxppc64-dev, netdev, Arnd Bergmann, Jens.Osterkamp
[-- Attachment #1: spidernet-fw-from-dt-2.diff --]
[-- Type: text/plain, Size: 1584 bytes --]
request_firmware() is sometimes problematic, especially
in initramfs, reading the firmware from Open Firmware
is much preferrable.
We still try to get the firmware from the file system
first, in order to support old SLOF releases and to allow
updates of the spidernet firmware without reflashing
the system.
From: Jens.Osterkamp@de.ibm.com
Cc: netdev@vger.kernel.org
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Index: linux-2.6.15-rc/drivers/net/spider_net.c
===================================================================
--- linux-2.6.15-rc.orig/drivers/net/spider_net.c
+++ linux-2.6.15-rc/drivers/net/spider_net.c
@@ -1895,16 +1895,27 @@ spider_net_download_firmware(struct spid
static int
spider_net_init_firmware(struct spider_net_card *card)
{
- const struct firmware *firmware;
+ struct firmware *firmware;
+ struct device_node *dn;
+ u8 *fw_prop;
int err = -EIO;
- if (request_firmware(&firmware,
+ if (request_firmware((const struct firmware **)&firmware,
SPIDER_NET_FIRMWARE_NAME, &card->pdev->dev) < 0) {
if (netif_msg_probe(card))
pr_err("Couldn't read in sequencer data file %s.\n",
SPIDER_NET_FIRMWARE_NAME);
- firmware = NULL;
- goto out;
+
+ dn = pci_device_to_OF_node(card->pdev);
+ if (!dn)
+ goto out;
+
+ fw_prop = (u8 *)get_property(dn, "firmware", NULL);
+ if (!fw_prop)
+ goto out;
+
+ memcpy(firmware->data, fw_prop, 6 * SPIDER_NET_FIRMWARE_LEN * sizeof(u32));
+ firmware->size = 6 * SPIDER_NET_FIRMWARE_LEN * sizeof(u32);
}
if (firmware->size != 6 * SPIDER_NET_FIRMWARE_LEN * sizeof(u32)) {
--
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 14/14] spidernet: fix HW structures for 64 bit dma_addr_t
[not found] <20051206035220.097737000@localhost>
` (2 preceding siblings ...)
2005-12-06 3:52 ` [PATCH 13/14] spidernet: read firmware from the OF device tree Arnd Bergmann
@ 2005-12-06 3:52 ` Arnd Bergmann
3 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2005-12-06 3:52 UTC (permalink / raw)
To: paulus; +Cc: linuxppc64-dev, netdev, Arnd Bergmann, Jens.Osterkamp
[-- Attachment #1: spidernet-dma_addr_t-fix-2.diff --]
[-- Type: text/plain, Size: 2460 bytes --]
The driver incorrectly used dma_addr_t to describe
HW structures and consequently broke when that type
was changed in 2.6.15-rc.
This changed spidernet to use u32 for 32 bit HW defined
structure elements.
From: Jens.Osterkamp@de.ibm.com
Cc: netdev@vger.kernel.org
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Index: linux-2.6.15-rc/drivers/net/spider_net.h
===================================================================
--- linux-2.6.15-rc.orig/drivers/net/spider_net.h
+++ linux-2.6.15-rc/drivers/net/spider_net.h
@@ -373,9 +373,9 @@ enum spider_net_descr_status {
struct spider_net_descr {
/* as defined by the hardware */
- dma_addr_t buf_addr;
+ u32 buf_addr;
u32 buf_size;
- dma_addr_t next_descr_addr;
+ u32 next_descr_addr;
u32 dmac_cmd_status;
u32 result_size;
u32 valid_size; /* all zeroes for tx */
Index: linux-2.6.15-rc/drivers/net/spider_net.c
===================================================================
--- linux-2.6.15-rc.orig/drivers/net/spider_net.c
+++ linux-2.6.15-rc/drivers/net/spider_net.c
@@ -480,6 +480,7 @@ static int
spider_net_prepare_rx_descr(struct spider_net_card *card,
struct spider_net_descr *descr)
{
+ dma_addr_t buf;
int error = 0;
int offset;
int bufsize;
@@ -510,10 +511,11 @@ spider_net_prepare_rx_descr(struct spide
if (offset)
skb_reserve(descr->skb, SPIDER_NET_RXBUF_ALIGN - offset);
/* io-mmu-map the skb */
- descr->buf_addr = pci_map_single(card->pdev, descr->skb->data,
+ buf = pci_map_single(card->pdev, descr->skb->data,
SPIDER_NET_MAX_MTU,
PCI_DMA_BIDIRECTIONAL);
- if (descr->buf_addr == DMA_ERROR_CODE) {
+ descr->buf_addr = buf;
+ if (buf == DMA_ERROR_CODE) {
dev_kfree_skb_any(descr->skb);
if (netif_msg_rx_err(card))
pr_err("Could not iommu-map rx buffer\n");
@@ -914,15 +916,16 @@ spider_net_prepare_tx_descr(struct spide
struct spider_net_descr *descr,
struct sk_buff *skb)
{
- descr->buf_addr = pci_map_single(card->pdev, skb->data,
- skb->len, PCI_DMA_BIDIRECTIONAL);
- if (descr->buf_addr == DMA_ERROR_CODE) {
+ dma_addr_t buf = pci_map_single(card->pdev, skb->data,
+ skb->len, PCI_DMA_BIDIRECTIONAL);
+ if (buf == DMA_ERROR_CODE) {
if (netif_msg_tx_err(card))
pr_err("could not iommu-map packet (%p, %i). "
"Dropping packet\n", skb->data, skb->len);
return -ENOMEM;
}
+ descr->buf_addr = buf;
descr->buf_size = skb->len;
descr->skb = skb;
descr->data_status = 0;
--
^ permalink raw reply [flat|nested] 7+ messages in thread