* debian/patches/debian/dfsg/drivers-net-bnx2-request_firmware-1.patch: Fix.

* debian/patches/series/1~experimental.1: Fix.

svn path=/dists/trunk/linux-2.6/; revision=12013
This commit is contained in:
Bastian Blank 2008-08-10 08:56:21 +00:00
parent bebd42376b
commit ac5e820387
2 changed files with 154 additions and 92 deletions

View File

@ -1,27 +1,29 @@
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 8b552c6..ec72b56 100644
index 5ebde67..5401dab 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -46,11 +46,10 @@
@@ -46,12 +46,12 @@
#include <linux/crc32.h>
#include <linux/prefetch.h>
#include <linux/cache.h>
-#include <linux/zlib.h>
+#include <linux/firmware.h>
#include <linux/log2.h>
#include "bnx2.h"
-#include "bnx2_fw.h"
-#include "bnx2_fw2.h"
+#include "bnx2_cpu.h"
+#include "bnx2_fw_file.h"
#define FW_BUF_SIZE 0x10000
@@ -58,12 +57,20 @@
@@ -59,12 +59,20 @@
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.7.5"
#define DRV_MODULE_RELDATE "April 29, 2008"
+#define FW_FILE_06 "bnx2-06-4.0.5.fw"
+#define FW_FILE_09 "bnx2-09-4.0.5.fw"
#define DRV_MODULE_VERSION "1.7.9"
#define DRV_MODULE_RELDATE "July 18, 2008"
+#define FW_FILE_06 "bnx2-06-4.4.1.fw"
+#define FW_FILE_09 "bnx2-09-4.4.26.fw"
#define RUN_AT(x) (jiffies + (x))
@ -37,8 +39,8 @@ index 8b552c6..ec72b56 100644
static char version[] __devinitdata =
"Broadcom NetXtreme II Gigabit Ethernet Driver " DRV_MODULE_NAME " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
@@ -71,6 +78,8 @@ MODULE_AUTHOR("Michael Chan <mchan@broadcom.com>");
MODULE_DESCRIPTION("Broadcom NetXtreme II BCM5706/5708 Driver");
@@ -72,6 +80,8 @@ MODULE_AUTHOR("Michael Chan <mchan@broadcom.com>");
MODULE_DESCRIPTION("Broadcom NetXtreme II BCM5706/5708/5709 Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_MODULE_VERSION);
+MODULE_FIRMWARE(FW_FILE_06);
@ -46,7 +48,7 @@ index 8b552c6..ec72b56 100644
static int disable_msi = 0;
@@ -3161,32 +3170,32 @@ bnx2_set_rx_mode(struct net_device *dev)
@@ -3315,32 +3325,32 @@ bnx2_set_rx_mode(struct net_device *dev)
spin_unlock_bh(&bp->phy_lock);
}
@ -61,26 +63,26 @@ index 8b552c6..ec72b56 100644
+ u32 *data;
u32 val;
+ len = be32_to_cpu(fw_section->len);
+ offset = be32_to_cpu(fw_section->offset);
+
+ if (!len || !offset || len + offset > bp->firmware->size)
+ return -EINVAL;
+ DPRINTK("load rv2p firmware with length %u from file offset %u\n", len, offset);
+
+ data = (u32 *)(bp->firmware->data + offset);
- if (rv2p_proc == RV2P_PROC2 && CHIP_NUM(bp) == CHIP_NUM_5709) {
- val = le32_to_cpu(rv2p_code[XI_RV2P_PROC2_MAX_BD_PAGE_LOC]);
- val &= ~XI_RV2P_PROC2_BD_PAGE_SIZE_MSK;
- val |= XI_RV2P_PROC2_BD_PAGE_SIZE;
- rv2p_code[XI_RV2P_PROC2_MAX_BD_PAGE_LOC] = cpu_to_le32(val);
- }
+ len = be32_to_cpu(fw_section->len);
+ offset = be32_to_cpu(fw_section->offset);
+
+ if (!len || !offset || len + offset > bp->firmware->size)
+ return -EINVAL;
+ DPRINTK("load rv2p firmware with length %u from file offset %u\n", len, offset);
- for (i = 0; i < rv2p_code_len; i += 8) {
- REG_WR(bp, BNX2_RV2P_INSTR_HIGH, le32_to_cpu(*rv2p_code));
- rv2p_code++;
- REG_WR(bp, BNX2_RV2P_INSTR_LOW, le32_to_cpu(*rv2p_code));
- rv2p_code++;
+ data = (u32 *)(bp->firmware->data + offset);
+
+ for (i = 0; i < (len / 4); i += 2) {
+ REG_WR(bp, BNX2_RV2P_INSTR_HIGH, be32_to_cpu(data[i]));
+ REG_WR(bp, BNX2_RV2P_INSTR_LOW, be32_to_cpu(data[i+1]));
@ -96,7 +98,7 @@ index 8b552c6..ec72b56 100644
REG_WR(bp, BNX2_RV2P_PROC2_ADDR_CMD, val);
}
}
@@ -3192,14 +3207,18 @@ load_rv2p_fw(struct bnx2 *bp, __le32 *rv2p_code, u32 rv2p_code_len,
@@ -3352,14 +3362,18 @@ load_rv2p_fw(struct bnx2 *bp, __le32 *rv2p_code, u32 rv2p_code_len,
else {
REG_WR(bp, BNX2_RV2P_COMMAND, BNX2_RV2P_COMMAND_PROC2_RESET);
}
@ -105,8 +107,8 @@ index 8b552c6..ec72b56 100644
}
static int
-load_cpu_fw(struct bnx2 *bp, struct cpu_reg *cpu_reg, struct fw_info *fw)
+load_cpu_fw(struct bnx2 *bp, struct cpu_reg *cpu_reg,
-load_cpu_fw(struct bnx2 *bp, const struct cpu_reg *cpu_reg, struct fw_info *fw)
+load_cpu_fw(struct bnx2 *bp, const struct cpu_reg *cpu_reg,
+ const struct bnx2_fw_file_entry *fw_entry)
{
+ u32 addr, len, file_offset;
@ -117,7 +119,7 @@ index 8b552c6..ec72b56 100644
/* Halt the CPU. */
val = bnx2_reg_rd_ind(bp, cpu_reg->mode);
@@ -3208,64 +3227,87 @@ load_cpu_fw(struct bnx2 *bp, struct cpu_reg *cpu_reg, struct fw_info *fw)
@@ -3368,64 +3382,87 @@ load_cpu_fw(struct bnx2 *bp, const struct cpu_reg *cpu_reg, struct fw_info *fw)
bnx2_reg_wr_ind(bp, cpu_reg->state, cpu_reg->state_value_clear);
/* Load the Text area. */
@ -230,10 +232,10 @@ index 8b552c6..ec72b56 100644
/* Start the CPU. */
val = bnx2_reg_rd_ind(bp, cpu_reg->mode);
@@ -3280,39 +3322,14 @@ static int
@@ -3439,92 +3476,37 @@ load_cpu_fw(struct bnx2 *bp, const struct cpu_reg *cpu_reg, struct fw_info *fw)
static int
bnx2_init_cpus(struct bnx2 *bp)
{
struct cpu_reg cpu_reg;
- struct fw_info *fw;
- int rc, rv2p_len;
- void *text, *rv2p;
@ -252,12 +254,11 @@ index 8b552c6..ec72b56 100644
- rc = zlib_inflate_blob(text, FW_BUF_SIZE, rv2p, rv2p_len);
- if (rc < 0)
- goto init_cpu_err;
-
- load_rv2p_fw(bp, text, rc /* == len */, RV2P_PROC1);
+ const struct bnx2_fw_file *fw = NULL;
+ int rc;
- load_rv2p_fw(bp, text, rc /* == len */, RV2P_PROC1);
+ fw = (struct bnx2_fw_file *)bp->firmware->data;
- if (CHIP_NUM(bp) == CHIP_NUM_5709) {
- rv2p = bnx2_xi_rv2p_proc2;
- rv2p_len = sizeof(bnx2_xi_rv2p_proc2);
@ -268,106 +269,74 @@ index 8b552c6..ec72b56 100644
- rc = zlib_inflate_blob(text, FW_BUF_SIZE, rv2p, rv2p_len);
- if (rc < 0)
- goto init_cpu_err;
-
+ fw = (struct bnx2_fw_file *)bp->firmware->data;
- load_rv2p_fw(bp, text, rc /* == len */, RV2P_PROC2);
+ /* Initialize the RV2P processor. */
+ load_rv2p_fw(bp, RV2P_PROC1, &fw->rv2p_proc1);
+ load_rv2p_fw(bp, RV2P_PROC2, &fw->rv2p_proc2);
/* Initialize the RX Processor. */
cpu_reg.mode = BNX2_RXP_CPU_MODE;
@@ -3328,15 +3345,9 @@ bnx2_init_cpus(struct bnx2 *bp)
cpu_reg.spad_base = BNX2_RXP_SCRATCH;
cpu_reg.mips_view_base = 0x8000000;
- if (CHIP_NUM(bp) == CHIP_NUM_5709)
- fw = &bnx2_rxp_fw_09;
- else
- fw = &bnx2_rxp_fw_06;
-
- fw->text = text;
- rc = load_cpu_fw(bp, &cpu_reg, fw);
+ rc = load_cpu_fw(bp, &cpu_reg, &fw->rxp);
- rc = load_cpu_fw(bp, &cpu_reg_rxp, fw);
+ rc = load_cpu_fw(bp, &cpu_reg_rxp, &fw->rxp);
if (rc)
- goto init_cpu_err;
+ return rc;
goto init_cpu_err;
/* Initialize the TX Processor. */
cpu_reg.mode = BNX2_TXP_CPU_MODE;
@@ -3352,15 +3363,9 @@ bnx2_init_cpus(struct bnx2 *bp)
cpu_reg.spad_base = BNX2_TXP_SCRATCH;
cpu_reg.mips_view_base = 0x8000000;
- if (CHIP_NUM(bp) == CHIP_NUM_5709)
- fw = &bnx2_txp_fw_09;
- else
- fw = &bnx2_txp_fw_06;
-
- fw->text = text;
- rc = load_cpu_fw(bp, &cpu_reg, fw);
+ rc = load_cpu_fw(bp, &cpu_reg, &fw->txp);
- rc = load_cpu_fw(bp, &cpu_reg_txp, fw);
+ rc = load_cpu_fw(bp, &cpu_reg_txp, &fw->txp);
if (rc)
- goto init_cpu_err;
+ return rc;
goto init_cpu_err;
/* Initialize the TX Patch-up Processor. */
cpu_reg.mode = BNX2_TPAT_CPU_MODE;
@@ -3376,15 +3381,9 @@ bnx2_init_cpus(struct bnx2 *bp)
cpu_reg.spad_base = BNX2_TPAT_SCRATCH;
cpu_reg.mips_view_base = 0x8000000;
- if (CHIP_NUM(bp) == CHIP_NUM_5709)
- fw = &bnx2_tpat_fw_09;
- else
- fw = &bnx2_tpat_fw_06;
-
- fw->text = text;
- rc = load_cpu_fw(bp, &cpu_reg, fw);
+ rc = load_cpu_fw(bp, &cpu_reg, &fw->tpat);
- rc = load_cpu_fw(bp, &cpu_reg_tpat, fw);
+ rc = load_cpu_fw(bp, &cpu_reg_tpat, &fw->tpat);
if (rc)
- goto init_cpu_err;
+ return rc;
goto init_cpu_err;
/* Initialize the Completion Processor. */
cpu_reg.mode = BNX2_COM_CPU_MODE;
@@ -3400,15 +3399,9 @@ bnx2_init_cpus(struct bnx2 *bp)
cpu_reg.spad_base = BNX2_COM_SCRATCH;
cpu_reg.mips_view_base = 0x8000000;
- if (CHIP_NUM(bp) == CHIP_NUM_5709)
- fw = &bnx2_com_fw_09;
- else
- fw = &bnx2_com_fw_06;
-
- fw->text = text;
- rc = load_cpu_fw(bp, &cpu_reg, fw);
+ rc = load_cpu_fw(bp, &cpu_reg, &fw->com);
- rc = load_cpu_fw(bp, &cpu_reg_com, fw);
+ rc = load_cpu_fw(bp, &cpu_reg_com, &fw->com);
if (rc)
- goto init_cpu_err;
+ return rc;
goto init_cpu_err;
/* Initialize the Command Processor. */
cpu_reg.mode = BNX2_CP_CPU_MODE;
@@ -3424,17 +3417,7 @@ bnx2_init_cpus(struct bnx2 *bp)
cpu_reg.spad_base = BNX2_CP_SCRATCH;
cpu_reg.mips_view_base = 0x8000000;
- if (CHIP_NUM(bp) == CHIP_NUM_5709)
- fw = &bnx2_cp_fw_09;
- else
- fw = &bnx2_cp_fw_06;
-
- fw->text = text;
- rc = load_cpu_fw(bp, &cpu_reg, fw);
-
-init_cpu_err:
- vfree(text);
- return rc;
+ return load_cpu_fw(bp, &cpu_reg, &fw->cp);
}
- rc = load_cpu_fw(bp, &cpu_reg_cp, fw);
+ rc = load_cpu_fw(bp, &cpu_reg_cp, &fw->cp);
static int
@@ -7456,6 +7439,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
init_cpu_err:
vfree(text);
@@ -7656,6 +7638,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
struct bnx2 *bp;
int rc;
char str[40];
@ -375,7 +344,7 @@ index 8b552c6..ec72b56 100644
DECLARE_MAC_BUF(mac);
if (version_printed++ == 0)
@@ -7497,6 +7481,23 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -7697,6 +7680,23 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_drvdata(pdev, dev);
@ -399,7 +368,7 @@ index 8b552c6..ec72b56 100644
memcpy(dev->dev_addr, bp->mac_addr, 6);
memcpy(dev->perm_addr, bp->mac_addr, 6);
bp->name = board_info[ent->driver_data].name;
@@ -7514,13 +7515,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -7714,13 +7714,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if ((rc = register_netdev(dev))) {
dev_err(&pdev->dev, "Cannot register net device\n");
@ -414,7 +383,7 @@ index 8b552c6..ec72b56 100644
}
printk(KERN_INFO "%s: %s (%c%d) %s found at mem %lx, "
@@ -7534,6 +7529,15 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -7734,6 +7728,15 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
bp->pdev->irq, print_mac(mac, dev->dev_addr));
return 0;
@ -430,7 +399,7 @@ index 8b552c6..ec72b56 100644
}
static void __devexit
@@ -7549,6 +7553,8 @@ bnx2_remove_one(struct pci_dev *pdev)
@@ -7749,6 +7752,8 @@ bnx2_remove_one(struct pci_dev *pdev)
if (bp->regview)
iounmap(bp->regview);
@ -440,19 +409,19 @@ index 8b552c6..ec72b56 100644
pci_release_regions(pdev);
pci_disable_device(pdev);
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index 3aa0364..b9a052f 100644
index c3c579f..15e837e 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -6812,6 +6812,8 @@ struct bnx2 {
@@ -6860,6 +6860,8 @@ struct bnx2 {
struct bnx2_irq irq_tbl[BNX2_MAX_MSIX_VEC];
int irq_nvecs;
u8 num_tx_rings;
u8 num_rx_rings;
+
+ const struct firmware *firmware;
};
#define REG_RD(bp, offset) \
@@ -6842,44 +6844,6 @@ struct cpu_reg {
@@ -6890,44 +6892,6 @@ struct cpu_reg {
u32 mips_view_base;
};
@ -497,6 +466,100 @@ index 3aa0364..b9a052f 100644
#define RV2P_PROC1 0
#define RV2P_PROC2 1
diff --git a/drivers/net/bnx2_cpu.h b/drivers/net/bnx2_cpu.h
new file mode 100644
index 0000000..940eb91
--- /dev/null
+++ b/drivers/net/bnx2_cpu.h
@@ -0,0 +1,88 @@
+/* bnx2_fw.h: Broadcom NX2 network driver.
+ *
+ * Copyright (c) 2004, 2005, 2006, 2007 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation.
+ */
+
+/* Initialized Values for the Completion Processor. */
+static const struct cpu_reg cpu_reg_com = {
+ .mode = BNX2_COM_CPU_MODE,
+ .mode_value_halt = BNX2_COM_CPU_MODE_SOFT_HALT,
+ .mode_value_sstep = BNX2_COM_CPU_MODE_STEP_ENA,
+ .state = BNX2_COM_CPU_STATE,
+ .state_value_clear = 0xffffff,
+ .gpr0 = BNX2_COM_CPU_REG_FILE,
+ .evmask = BNX2_COM_CPU_EVENT_MASK,
+ .pc = BNX2_COM_CPU_PROGRAM_COUNTER,
+ .inst = BNX2_COM_CPU_INSTRUCTION,
+ .bp = BNX2_COM_CPU_HW_BREAKPOINT,
+ .spad_base = BNX2_COM_SCRATCH,
+ .mips_view_base = 0x8000000,
+};
+
+/* Initialized Values the Command Processor. */
+static const struct cpu_reg cpu_reg_cp = {
+ .mode = BNX2_CP_CPU_MODE,
+ .mode_value_halt = BNX2_CP_CPU_MODE_SOFT_HALT,
+ .mode_value_sstep = BNX2_CP_CPU_MODE_STEP_ENA,
+ .state = BNX2_CP_CPU_STATE,
+ .state_value_clear = 0xffffff,
+ .gpr0 = BNX2_CP_CPU_REG_FILE,
+ .evmask = BNX2_CP_CPU_EVENT_MASK,
+ .pc = BNX2_CP_CPU_PROGRAM_COUNTER,
+ .inst = BNX2_CP_CPU_INSTRUCTION,
+ .bp = BNX2_CP_CPU_HW_BREAKPOINT,
+ .spad_base = BNX2_CP_SCRATCH,
+ .mips_view_base = 0x8000000,
+};
+
+/* Initialized Values for the RX Processor. */
+static const struct cpu_reg cpu_reg_rxp = {
+ .mode = BNX2_RXP_CPU_MODE,
+ .mode_value_halt = BNX2_RXP_CPU_MODE_SOFT_HALT,
+ .mode_value_sstep = BNX2_RXP_CPU_MODE_STEP_ENA,
+ .state = BNX2_RXP_CPU_STATE,
+ .state_value_clear = 0xffffff,
+ .gpr0 = BNX2_RXP_CPU_REG_FILE,
+ .evmask = BNX2_RXP_CPU_EVENT_MASK,
+ .pc = BNX2_RXP_CPU_PROGRAM_COUNTER,
+ .inst = BNX2_RXP_CPU_INSTRUCTION,
+ .bp = BNX2_RXP_CPU_HW_BREAKPOINT,
+ .spad_base = BNX2_RXP_SCRATCH,
+ .mips_view_base = 0x8000000,
+};
+
+/* Initialized Values for the TX Patch-up Processor. */
+static const struct cpu_reg cpu_reg_tpat = {
+ .mode = BNX2_TPAT_CPU_MODE,
+ .mode_value_halt = BNX2_TPAT_CPU_MODE_SOFT_HALT,
+ .mode_value_sstep = BNX2_TPAT_CPU_MODE_STEP_ENA,
+ .state = BNX2_TPAT_CPU_STATE,
+ .state_value_clear = 0xffffff,
+ .gpr0 = BNX2_TPAT_CPU_REG_FILE,
+ .evmask = BNX2_TPAT_CPU_EVENT_MASK,
+ .pc = BNX2_TPAT_CPU_PROGRAM_COUNTER,
+ .inst = BNX2_TPAT_CPU_INSTRUCTION,
+ .bp = BNX2_TPAT_CPU_HW_BREAKPOINT,
+ .spad_base = BNX2_TPAT_SCRATCH,
+ .mips_view_base = 0x8000000,
+};
+
+/* Initialized Values for the TX Processor. */
+static const struct cpu_reg cpu_reg_txp = {
+ .mode = BNX2_TXP_CPU_MODE,
+ .mode_value_halt = BNX2_TXP_CPU_MODE_SOFT_HALT,
+ .mode_value_sstep = BNX2_TXP_CPU_MODE_STEP_ENA,
+ .state = BNX2_TXP_CPU_STATE,
+ .state_value_clear = 0xffffff,
+ .gpr0 = BNX2_TXP_CPU_REG_FILE,
+ .evmask = BNX2_TXP_CPU_EVENT_MASK,
+ .pc = BNX2_TXP_CPU_PROGRAM_COUNTER,
+ .inst = BNX2_TXP_CPU_INSTRUCTION,
+ .bp = BNX2_TXP_CPU_HW_BREAKPOINT,
+ .spad_base = BNX2_TXP_SCRATCH,
+ .mips_view_base = 0x8000000,
+};
diff --git a/drivers/net/bnx2_fw_file.h b/drivers/net/bnx2_fw_file.h
new file mode 100644
index 0000000..06c003c

View File

@ -1,13 +1,12 @@
+ debian/version.patch
#+ debian/kernelvariables.patch
+ debian/kernelvariables.patch
+ debian/doc-build-parallel.patch
#+ debian/scripts-kconfig-reportoldconfig.patch
#+ debian/powerpc-mkvmlinuz-support-ppc.patch
+ debian/scripts-kconfig-reportoldconfig.patch
+ debian/drivers-ata-ata_piix-postpone-pata.patch
#+ debian/dfsg/drivers-net-tg3-fix-simple.patch
#+ debian/dfsg/drivers-net-bnx2-request_firmware-1.patch
+ debian/dfsg/drivers-net-tg3-fix-simple.patch
+ debian/dfsg/drivers-net-bnx2-request_firmware-1.patch
#+ features/all/drivers-net-acenic-firmwar_request.patch
+ features/all/export-gfs2-locking-symbols.patch
+ features/all/export-unionfs-symbols.patch