[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#509646: marked as done (firmware-nonfree: Please include bnx2x firmware)



Your message dated Sat, 20 Jun 2009 19:02:34 +0000
with message-id <E1MI5pi-0005dD-6L@ries.debian.org>
and subject line Bug#509646: fixed in firmware-nonfree 0.17
has caused the Debian Bug report #509646,
regarding firmware-nonfree: Please include bnx2x firmware
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
509646: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509646
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: firmware-nonfree
Version: 0.14
Severity: wishlist
Tags: patch

I have written a firmware cutter for the bnx2x driver, as well as a
patch to the driver itself (which will be filed as a separate bug
report) to use the resulting firmware file.

The firmware cutter works with the versions of the driver in Linux
2.6.26 and 2.6.28-rc9.  As I will explain in my other report, I don't
have hardware that works with the 2.6.26 version, so my kernel patch is
actually a backport of the new driver plus a patch to use the firmware
file.

Use of this firmware cutter is virtually identical to that of the bnx2
cutter, as I initially followed that design.  Basically,

  $ cd ~/src/linux-2.6
  $ git checkout v2.6.28-rc9
  $ export KERNEL_VERSION=2.6.28 KERNEL_SOURCE=$(pwd)
  $ cd ~/src/firmware-nonfree/bnx2x/fwcutter
  $ make
  $ ./bnx2x_fwcutter_2.6.28

That will spit out bnx2x-e1-1.45.23.fw and bnx2x-e1h-1.45.23.fw, which
contain big-endian representations of init_ops and the data blobs in
bnx2x_init_values.h.  Also generated in this process is
bnx2x_init_ops_offsets_2.6.28.h, which I also include in the linux-2.6
patch.  (The offsets to functions in the init_ops array are defined as
constants in bnx2x_init_values.h, so I just extract those constants to
their own header.)

-- 
John Wright <jsw@debian.org>
diff --git a/bnx2x/fwcutter/Makefile b/bnx2x/fwcutter/Makefile
new file mode 100644
index 0000000..7f6b93b
--- /dev/null
+++ b/bnx2x/fwcutter/Makefile
@@ -0,0 +1,34 @@
+test :=
+ifdef KERNEL_SOURCE
+test += source
+endif
+ifdef KERNEL_VERSION
+test += version
+endif
+
+ifeq "$(test)" " source version"
+CFLAGS += -I$(KERNEL_SOURCE)/include -I$(KERNEL_SOURCE)/drivers/net
+#LDFLAGS += -lz
+
+all: bnx2x_fwcutter_$(KERNEL_VERSION)
+
+bnx2x_fwcutter_$(KERNEL_VERSION): bnx2x_fwcutter_$(KERNEL_VERSION).c bnx2x_fwcutter_$(KERNEL_VERSION).h bnx2x_fwcutter_$(KERNEL_VERSION)_init.h bnx2x_fwcutter.c bnx2x_init_ops_offsets_$(KERNEL_VERSION).h
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+bnx2x_fwcutter_$(KERNEL_VERSION).h: $(KERNEL_SOURCE)/drivers/net/bnx2x.h
+	grep "^#define BNX2" $^ | grep -v '\\' > $@
+
+bnx2x_fwcutter_$(KERNEL_VERSION)_init.h: $(KERNEL_SOURCE)/drivers/net/bnx2x_init.h
+	grep "^#define OP_" $^ > $@
+
+bnx2x_init_ops_offsets_$(KERNEL_VERSION).h: $(KERNEL_SOURCE)/drivers/net/bnx2x_init_values.h
+	grep -E '^#define .*_(START|END)' $< > $@
+
+else
+all:
+	$(error Please define KERNEL_SOURCE and KERNEL_VERSION)
+endif
+
+clean: ALL = $(basename $(wildcard bnx2x_fwcutter_*.c))
+clean:
+	rm -f $(ALL) $(ALL:=.h) $(ALL:=_init.h)
diff --git a/bnx2x/fwcutter/bnx2x_fw_file.h b/bnx2x/fwcutter/bnx2x_fw_file.h
new file mode 100644
index 0000000..9b86518
--- /dev/null
+++ b/bnx2x/fwcutter/bnx2x_fw_file.h
@@ -0,0 +1,17 @@
+struct bnx2x_fw_file_section {
+	uint32_t len;
+	uint32_t offset;
+};
+
+struct bnx2x_fw_file {
+	struct bnx2x_fw_file_section init_ops;
+	struct bnx2x_fw_file_section init_data;
+	struct bnx2x_fw_file_section tsem_int_table_data;
+	struct bnx2x_fw_file_section tsem_pram_data;
+	struct bnx2x_fw_file_section usem_int_table_data;
+	struct bnx2x_fw_file_section usem_pram_data;
+	struct bnx2x_fw_file_section csem_int_table_data;
+	struct bnx2x_fw_file_section csem_pram_data;
+	struct bnx2x_fw_file_section xsem_int_table_data;
+	struct bnx2x_fw_file_section xsem_pram_data;
+};
diff --git a/bnx2x/fwcutter/bnx2x_fwcutter.c b/bnx2x/fwcutter/bnx2x_fwcutter.c
new file mode 100644
index 0000000..c0df7a4
--- /dev/null
+++ b/bnx2x/fwcutter/bnx2x_fwcutter.c
@@ -0,0 +1,101 @@
+#include <byteswap.h>
+#include <endian.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+typedef uint32_t u32;
+
+struct raw_op {
+    u32 op:8;
+    u32 offset:24;
+    u32 raw_data;
+};
+
+#include "bnx2x_fw_file.h"
+
+#include "bnx2x_reg.h"
+#include "bnx2x_init_values.h"
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define cpu_to_be32(x) bswap_32(x)
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define cpu_to_be32(x) (x)
+#endif
+#define le32_to_be32(x) bswap_32(x)
+
+void uint32_t_buf_to_be32(const uint32_t *input, uint32_t *output, size_t len)
+{
+    int j;
+    for (j = 0; j < (len / 4); j++) {
+        output[j] = cpu_to_be32(input[j]);
+    }
+}
+
+void write_firmware_data(int fd, struct bnx2x_fw_file_section *section,
+                         const uint32_t *data, size_t len)
+{
+    off_t offset = lseek(fd, 0, SEEK_CUR);
+    uint32_t *buf;
+    unsigned int j;
+
+    section->len = cpu_to_be32(len);
+    section->offset = cpu_to_be32(offset);
+
+    buf = malloc(len);
+    uint32_t_buf_to_be32(data, buf, len);
+    write(fd, buf, len);
+    free(buf);
+}
+
+void write_firmware(const char *filename,
+                    const uint32_t *init_data, size_t init_data_len,
+                    const uint32_t *tsem_int_table_data,
+                    size_t tsem_int_table_data_len,
+                    const uint32_t *tsem_pram_data, size_t tsem_pram_data_len,
+                    const uint32_t *usem_int_table_data,
+                    size_t usem_int_table_data_len,
+                    const uint32_t *usem_pram_data, size_t usem_pram_data_len,
+                    const uint32_t *csem_int_table_data,
+                    size_t csem_int_table_data_len,
+                    const uint32_t *csem_pram_data, size_t csem_pram_data_len,
+                    const uint32_t *xsem_int_table_data,
+                    size_t xsem_int_table_data_len,
+                    const uint32_t *xsem_pram_data, size_t xsem_pram_data_len)
+{
+    struct bnx2x_fw_file out;
+    int fd;
+
+    memset(&out, 0, sizeof(out));
+
+    printf("Write firmware file: %s\n", filename);
+    fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+    lseek(fd, sizeof(out), SEEK_SET);
+
+    write_firmware_data(fd, &out.init_ops,
+                        (uint32_t *)init_ops, sizeof(init_ops));
+    write_firmware_data(fd, &out.init_data,
+                        init_data, init_data_len);
+    write_firmware_data(fd, &out.tsem_int_table_data,
+                        tsem_int_table_data, tsem_int_table_data_len);
+    write_firmware_data(fd, &out.tsem_pram_data,
+                        tsem_pram_data, tsem_pram_data_len);
+    write_firmware_data(fd, &out.usem_int_table_data,
+                        usem_int_table_data, usem_int_table_data_len);
+    write_firmware_data(fd, &out.usem_pram_data,
+                        usem_pram_data, usem_pram_data_len);
+    write_firmware_data(fd, &out.csem_int_table_data,
+                        csem_int_table_data, csem_int_table_data_len);
+    write_firmware_data(fd, &out.csem_pram_data,
+                        csem_pram_data, csem_pram_data_len);
+    write_firmware_data(fd, &out.xsem_int_table_data,
+                        xsem_int_table_data, xsem_int_table_data_len);
+    write_firmware_data(fd, &out.xsem_pram_data,
+                        xsem_pram_data, xsem_pram_data_len);
+
+    lseek(fd, 0, SEEK_SET);
+    write(fd, &out, sizeof(out));
+    close(fd);
+}
diff --git a/bnx2x/fwcutter/bnx2x_fwcutter_2.6.26.c b/bnx2x/fwcutter/bnx2x_fwcutter_2.6.26.c
new file mode 100644
index 0000000..44e3eda
--- /dev/null
+++ b/bnx2x/fwcutter/bnx2x_fwcutter_2.6.26.c
@@ -0,0 +1,18 @@
+#include "bnx2x_fwcutter_2.6.26.h"
+#include "bnx2x_fwcutter_2.6.26_init.h"
+#include "bnx2x_fwcutter.c"
+
+int main()
+{
+    write_firmware("bnx2x-1.42.4.fw",
+                   init_data, sizeof(init_data),
+                   0, 0,
+                   0, 0,
+                   0, 0,
+                   0, 0,
+                   0, 0,
+                   0, 0,
+                   0, 0,
+                   0, 0);
+    return 0;
+}
diff --git a/bnx2x/fwcutter/bnx2x_fwcutter_2.6.28.c b/bnx2x/fwcutter/bnx2x_fwcutter_2.6.28.c
new file mode 100644
index 0000000..f45f22a
--- /dev/null
+++ b/bnx2x/fwcutter/bnx2x_fwcutter_2.6.28.c
@@ -0,0 +1,28 @@
+#include "bnx2x_fwcutter_2.6.28.h"
+#include "bnx2x_fwcutter_2.6.28_init.h"
+#include "bnx2x_fwcutter.c"
+
+int main()
+{
+    write_firmware("bnx2x-e1-1.45.23.fw",
+                   init_data_e1, sizeof(init_data_e1),
+                   tsem_int_table_data_e1, sizeof(tsem_int_table_data_e1),
+                   tsem_pram_data_e1, sizeof(tsem_pram_data_e1),
+                   usem_int_table_data_e1, sizeof(usem_int_table_data_e1),
+                   usem_pram_data_e1, sizeof(usem_pram_data_e1),
+                   csem_int_table_data_e1, sizeof(csem_int_table_data_e1),
+                   csem_pram_data_e1, sizeof(csem_pram_data_e1),
+                   xsem_int_table_data_e1, sizeof(xsem_int_table_data_e1),
+                   xsem_pram_data_e1, sizeof(xsem_pram_data_e1));
+    write_firmware("bnx2x-e1h-1.45.23.fw",
+                   init_data_e1h, sizeof(init_data_e1h),
+                   tsem_int_table_data_e1h, sizeof(tsem_int_table_data_e1h),
+                   tsem_pram_data_e1h, sizeof(tsem_pram_data_e1h),
+                   usem_int_table_data_e1h, sizeof(usem_int_table_data_e1h),
+                   usem_pram_data_e1h, sizeof(usem_pram_data_e1h),
+                   csem_int_table_data_e1h, sizeof(csem_int_table_data_e1h),
+                   csem_pram_data_e1h, sizeof(csem_pram_data_e1h),
+                   xsem_int_table_data_e1h, sizeof(xsem_int_table_data_e1h),
+                   xsem_pram_data_e1h, sizeof(xsem_pram_data_e1h));
+    return 0;
+}

--- End Message ---
--- Begin Message ---
Source: firmware-nonfree
Source-Version: 0.17

We believe that the bug you reported is fixed in the latest version of
firmware-nonfree, which is due to be installed in the Debian FTP archive:

firmware-bnx2_0.17_all.deb
  to pool/non-free/f/firmware-nonfree/firmware-bnx2_0.17_all.deb
firmware-bnx2x_0.17_all.deb
  to pool/non-free/f/firmware-nonfree/firmware-bnx2x_0.17_all.deb
firmware-ipw2x00_0.17_all.deb
  to pool/non-free/f/firmware-nonfree/firmware-ipw2x00_0.17_all.deb
firmware-ivtv_0.17_all.deb
  to pool/non-free/f/firmware-nonfree/firmware-ivtv_0.17_all.deb
firmware-iwlwifi_0.17_all.deb
  to pool/non-free/f/firmware-nonfree/firmware-iwlwifi_0.17_all.deb
firmware-linux_0.17_all.deb
  to pool/non-free/f/firmware-nonfree/firmware-linux_0.17_all.deb
firmware-nonfree_0.17.dsc
  to pool/non-free/f/firmware-nonfree/firmware-nonfree_0.17.dsc
firmware-nonfree_0.17.tar.gz
  to pool/non-free/f/firmware-nonfree/firmware-nonfree_0.17.tar.gz
firmware-qlogic_0.17_all.deb
  to pool/non-free/f/firmware-nonfree/firmware-qlogic_0.17_all.deb
firmware-ralink_0.17_all.deb
  to pool/non-free/f/firmware-nonfree/firmware-ralink_0.17_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 509646@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Ben Hutchings <ben@decadent.org.uk> (supplier of updated firmware-nonfree package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Format: 1.8
Date: Tue, 16 Jun 2009 04:03:38 +0100
Source: firmware-nonfree
Binary: firmware-bnx2 firmware-bnx2x firmware-ipw2x00 firmware-ivtv firmware-iwlwifi firmware-linux firmware-qlogic firmware-ralink
Architecture: source all
Version: 0.17
Distribution: unstable
Urgency: low
Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
Changed-By: Ben Hutchings <ben@decadent.org.uk>
Description: 
 firmware-bnx2 - Binary firmware for Broadcom NetXtremeII
 firmware-bnx2x - Binary firmware for Broadcom NetXtremeII 10Gb
 firmware-ipw2x00 - Binary firmware for Intel Pro Wireless 2100, 2200 and 2915
 firmware-ivtv - Binary firmware for iTVC15-family MPEG codecs (ivtv and pvrusb2 d
 firmware-iwlwifi - Binary firmware for Intel Wireless 3945, 4965 and 5000-series car
 firmware-linux - Binary firmware for various drivers in the Linux kernel
 firmware-qlogic - Binary firmware for QLogic QLA1XXX and QLA2XXX
 firmware-ralink - Binary firmware for Ralink RT2561, RT2571, RT2661 and RT2671 wire
Closes: 509646 524230 524382 526114 532040
Changes: 
 firmware-nonfree (0.17) unstable; urgency=low
 .
   [ maximilian attems ]
   * templates/control.source.in: section non-free/kernel.
   * Update iwlwifi-3945 to 15.32.2.9. (closes: #526114)
   * linux/defines: Fix upstream url.
 .
   [ Ben Hutchings ]
   * Add Radeon RS600, R600-family and R700-family firmware (closes: #532040)
   * Add Ralink RT2860/RT2890 and RT2870 firmware.
   * Add firmware for use with ivtv and pvrusb2 drivers (closes: #524230),
     thanks to Ian Campbell <ijc@hellion.org.uk>.
   * Fix grammatical errors in the templates for package descriptions,
     copyright files and EULA prompts
   * Add myself to Uploaders
   * Update linux-support build-dep to 2.6.30-1
 .
   [ dann frazier ]
   * Fix subject-verb agreement problem in firmware-linux description.
     (Closes: #524382)
   * Update firmware-linux description to clarify the reasoning for the
     bundled nature
   * Add new firmware-bnx2x package (closes: #509646)
   * Add bnx2 firmware from Linux 2.6.30-rc7
Checksums-Sha1: 
 df448e503c083c51d317c224a3080e4b81173d61 1258 firmware-nonfree_0.17.dsc
 84bf85d8fa041b9bc047f43d25e3a7729eaba936 2354533 firmware-nonfree_0.17.tar.gz
 b2cc44e56f56332645cd46a3da1a3786d0e48b3d 302298 firmware-bnx2_0.17_all.deb
 5ea8a8bc0c492a4274f8952b64ad3fe27f7ebd05 337774 firmware-bnx2x_0.17_all.deb
 a5027dcb92fa70c7dc69c4cd8623f39445feff68 520072 firmware-ipw2x00_0.17_all.deb
 6168291291c0d9f6933f573dd6ab62c583f68d09 133624 firmware-ivtv_0.17_all.deb
 30ee40b3da46d4255014ff295d724be530344b83 465462 firmware-iwlwifi_0.17_all.deb
 7e1c68818f37b14ecb77322bd13739596f9c86f4 110582 firmware-linux_0.17_all.deb
 fb8c9a9ea340caffd99ab8002199569b63022559 470674 firmware-qlogic_0.17_all.deb
 72bed9c8d721127e70f7802644b064270a872334 15676 firmware-ralink_0.17_all.deb
Checksums-Sha256: 
 198f0e7175b5735a4072e6dd6b970b58b76ef8400cbb1ec18e411a0a9b4915f0 1258 firmware-nonfree_0.17.dsc
 8453c20f709c51d9047ea90bf0c260b177c781dfda803ad5ff63cc40c11a89d8 2354533 firmware-nonfree_0.17.tar.gz
 624646cd8b7917ed94e7c00403ee11a9df91008ed958b9e16bb0db16ad554d5f 302298 firmware-bnx2_0.17_all.deb
 5a2c4be83f10b31ba92e156f9565106c34ca5fd92c93a8f20967b0d5774311a1 337774 firmware-bnx2x_0.17_all.deb
 843a2ab23e6bc1e52705df24d299aa0d17301849ddf866092ee6894370594c19 520072 firmware-ipw2x00_0.17_all.deb
 f4dd8497925b20c563702c4498d257217e02f4ac78153b597cab6dd036f6bed1 133624 firmware-ivtv_0.17_all.deb
 873ae31e83c2997f91ca44141f3f19709923ccc2c263733cf5667be62ca4a14a 465462 firmware-iwlwifi_0.17_all.deb
 47ed973d3283ffc5a6caef1ed44a9c21236096ccc4bb706ed481e5369e1c2cfb 110582 firmware-linux_0.17_all.deb
 4f06c5df397389d2a9fbf3148580c8b0266e94a3b7d42ff343419c330205f695 470674 firmware-qlogic_0.17_all.deb
 b27cfc6aba528208816e5e3760dc6ceaf153fdd32111a1f4772a4d14e989fafc 15676 firmware-ralink_0.17_all.deb
Files: 
 40ee717c9ee90ad3d271dc9f8f478237 1258 non-free/kernel optional firmware-nonfree_0.17.dsc
 1c0648221555e0a9b54155cb417c60d4 2354533 non-free/kernel optional firmware-nonfree_0.17.tar.gz
 b1c05bd5327d6dbcd4d4c900a4cb8fa3 302298 non-free/kernel optional firmware-bnx2_0.17_all.deb
 2abb3e4d1053fc6e9eb7954f0569fdcb 337774 non-free/kernel optional firmware-bnx2x_0.17_all.deb
 8de9dc3f093fcf68eca40f7fa61f788f 520072 non-free/kernel optional firmware-ipw2x00_0.17_all.deb
 ce93796e9ee26df0f789b4522fcfc882 133624 non-free/kernel optional firmware-ivtv_0.17_all.deb
 f7f96ae107b612b308fd6eaa5f3b8d7c 465462 non-free/kernel optional firmware-iwlwifi_0.17_all.deb
 ef3ff9ecd3f810b411c99c1d6e942989 110582 non-free/kernel optional firmware-linux_0.17_all.deb
 e4be4925cf406ffb84acb22ce7ad5c04 470674 non-free/kernel optional firmware-qlogic_0.17_all.deb
 c06f8b9256b646b62e6360ff7d0efcef 15676 non-free/kernel optional firmware-ralink_0.17_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFKNwxI79ZNCRIGYgcRA7DIAJ9oUgQvamT6mwMMg4uW/dt2RmOCTwCeOLNf
RR7kHzk6NWxF2p0uWU1lf1Q=
=f1Ka
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: