Skip to contentSkip to conversation

linux-firmware: Allow selection of bnx2x fw version

PATCH New Joel Stanley 4 participants 7 messages Feb 26, 2016 – Mar 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-firmware: Allow selection of bnx2x fw version

Linux kernel 4.2 moved the driver to a newer firmware version.

Instead of hard coding for 4.2+'s behaviour, introduce a selection mechanism where the user specifies which version to use based on the kernel they have.

---
 package/linux-firmware/Config.in         | 22 ++++++++++++++++++++++
 package/linux-firmware/linux-firmware.mk | 11 ++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)
package/linux-firmware/Config.in +22 -0
index d8389864adaa..b28064b9e45c 100644
@@ -243,6 +243,28 @@ config BR2_PACKAGE_LINUX_FIRMWARE_BNX2X
 	help
 	  Firmware files for Broadcom NetXtreme 10Gb ethernet cards (bnx2x)
 
+if BR2_PACKAGE_LINUX_FIRMWARE_BNX2X
+
+choice
+	bool "Broadcom bnx2x revision to use"
+	help
+	  Use revision 7.12.30.0 for kernel 4.2 onward.
+	  Use revision 7.10.51.0 for kernel 3.16 to 4.1.
+
+config BR2_PACKAGE_LINUX_FIRMWARE_BNX2X_REV_7_12_30_0
+	prompt "revision 7.12.30.0"
+	help
+	  Use revision 7.12.30.0 for kernel 4.2 onwards.
+
+config BR2_PACKAGE_LINUX_FIRMWARE_BNX2X_REV_7_10_51_0
+	prompt "revision 7.10.51.0"
+	help
+	  Use revision 7.10.51.0 for kernel 3.16 to 4.1.
+
+endchoice
+
+endif
+
 config BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T4
 	bool "Chelsio T4"
 	help
package/linux-firmware/linux-firmware.mk +10 -1
index 083a381ea00a..a73cbf9d6209 100644
@@ -251,7 +251,7 @@ LINUX_FIRMWARE_FILES += iwlwifi-7265-$(BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_REV).u
 LINUX_FIRMWARE_ALL_LICENSE_FILES += LICENCE.iwlwifi_firmware
 endif
 
-ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_BNX2X),y)
+ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_BNX2X_REV_7_10_51_0),y)
 LINUX_FIRMWARE_FILES += \
 	bnx2x/bnx2x-e1-7.10.51.0.fw \
 	bnx2x/bnx2x-e1h-7.10.51.0.fw \
@@ -260,6 +260,15 @@ LINUX_FIRMWARE_FILES += \
 # which is installed unconditionally
 endif
 
+ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_BNX2X_REV_7_12_30_0),y)
+LINUX_FIRMWARE_FILES += \
+	bnx2x/bnx2x-e1-7.12.30.0.fw \
+	bnx2x/bnx2x-e1h-7.12.30.0.fw \
+	bnx2x/bnx2x-e2-7.12.30.0.fw
+# No license file; the license is in the file WHENCE
+# which is installed unconditionally
+endif
+
 ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_CXGB4_T4),y)
 # cxgb4/t4fw.bin is a symlink to cxgb4/t4fw-1.14.4.0.bin
 LINUX_FIRMWARE_FILES += cxgb4/t4fw-1.14.4.0.bin cxgb4/t4fw.bin
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 linux-firmware: Allow selection of bnx2x fw version

Dear Joel Stanley,

Quoted 29 lines · Joel Stanley

Linux kernel 4.2 moved the driver to a newer firmware version.

Instead of hard coding for 4.2+'s behaviour, introduce a selection mechanism where the user specifies which version to use based on the kernel they have.

---
 package/linux-firmware/Config.in         | 22 ++++++++++++++++++++++
 package/linux-firmware/linux-firmware.mk | 11 ++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)
package/linux-firmware/Config.in +9 -0
index d8389864adaa..b28064b9e45c 100644
@@ -243,6 +243,28 @@ config BR2_PACKAGE_LINUX_FIRMWARE_BNX2X
 	help
 	  Firmware files for Broadcom NetXtreme 10Gb ethernet cards (bnx2x)
 
+if BR2_PACKAGE_LINUX_FIRMWARE_BNX2X
+
+choice
+	bool "Broadcom bnx2x revision to use"
+	help
+	  Use revision 7.12.30.0 for kernel 4.2 onward.
+	  Use revision 7.10.51.0 for kernel 3.16 to 4.1.
+
+config BR2_PACKAGE_LINUX_FIRMWARE_BNX2X_REV_7_12_30_0

package/linux-firmware/Config.in config BR2_PACKAGE_LINUX_FIRMWARE_BNX2X · line 264

Quoted 10 lines
package/linux-firmware/Config.in +10 -0
+	prompt "revision 7.12.30.0"
+	help
+	  Use revision 7.12.30.0 for kernel 4.2 onwards.
+
+config BR2_PACKAGE_LINUX_FIRMWARE_BNX2X_REV_7_10_51_0
+	prompt "revision 7.10.51.0"
+	help
+	  Use revision 7.10.51.0 for kernel 3.16 to 4.1.
+
+endchoice

I think adding new config to chose between different versions of a given firmware is going a bit too far. If we were to do that for all firmwares in linux-firmware, it would really increase the number of Config.in options too much.

Shall I suggest to install both versions of the firmware? The firmware files are not that large, and if filesystem size is really a strong issue, it is always possible to clean up the non-required firmware files in a post-build script.

What do you think?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 linux-firmware: Allow selection of bnx2x fw version

Quoted 4 lines · Thomas Petazzoni

I think adding new config to chose between different versions of a given firmware is going a bit too far. If we were to do that for all firmwares in linux-firmware, it would really increase the number of Config.in options too much.

Yeah, I do agree with this concern. It's unfortunate we don't have a variable we can test to see what the kernel version is.

Quoted 4 lines

Shall I suggest to install both versions of the firmware? The firmware files are not that large, and if filesystem size is really a strong issue, it is always possible to clean up the non-required firmware files in a post-build script.

In our case the extra ~640kB would be worth cleaning up. I like buildroot for the clean tiny images it produces; I think that's worth preserving.

The driver was broken for the 2015.11 release, so given no one has noticed since then, perhaps we should track the correct firmware versions for BR2_LINUX_KERNEL_LATEST_VERSION?

Cheers,

Joel

#3 lore raw

PATCH 1/1 linux-firmware: Allow selection of bnx2x fw version

Quoted 10 lines · Joel Stanley
Quoted 4 lines · Thomas Petazzoni

I think adding new config to chose between different versions of a given firmware is going a bit too far. If we were to do that for all firmwares in linux-firmware, it would really increase the number of Config.in options too much.

Yeah, I do agree with this concern. It's unfortunate we don't have a variable we can test to see what the kernel version is.

Quoted 8 lines
Quoted 4 lines

Shall I suggest to install both versions of the firmware? The firmware files are not that large, and if filesystem size is really a strong issue, it is always possible to clean up the non-required firmware files in a post-build script.

In our case the extra ~640kB would be worth cleaning up. I like buildroot for the clean tiny images it produces; I think that's worth preserving.

Also, at some point we run out of room on flash.

Signature · 2 lines
Stewart Smith
OPAL Architect, IBM.
#4 lore raw

PATCH v2 1/1 linux-firmware: Update bnx2x firwmare version

Linux kernel 4.2 moved the driver to a newer firmware version. As that is our default kernel, move the firmeware to a compatable version.

---
v2: Just use the new firmware to avoid adding extra cruft to our config system

 package/linux-firmware/linux-firmware.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/linux-firmware/linux-firmware.mk +3 -3
index 083a381ea00a..9363099b68fd 100644
@@ -253,9 +253,9 @@ endif
 
 ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_BNX2X),y)
 LINUX_FIRMWARE_FILES += \
-	bnx2x/bnx2x-e1-7.10.51.0.fw \
-	bnx2x/bnx2x-e1h-7.10.51.0.fw \
-	bnx2x/bnx2x-e2-7.10.51.0.fw
+	bnx2x/bnx2x-e1-7.12.30.0.fw \
+	bnx2x/bnx2x-e1h-7.12.30.0.fw \
+	bnx2x/bnx2x-e2-7.12.30.0.fw
 # No license file; the license is in the file WHENCE
 # which is installed unconditionally
 endif
Signature · 1 line
2.7.0
#5 lore raw

PATCH v2 1/1 linux-firmware: Update bnx2x firwmare version

Quoted 6 lines · Joel Stanley

Linux kernel 4.2 moved the driver to a newer firmware version. As that is our default kernel, move the firmeware to a compatable version.

---
v2: Just use the new firmware to avoid adding extra cruft to our config system

No, this is certainly not good, it fixes 4.2+ and simultaneously breaks 4.1-.

What is wrong with Thomas's proposal to remove the unneeded versions in a
post-build script? If your size is so important that 640K matters, you would probably anyway want to keep only one of the six binaries instead of three different chip revisions.

Regards,
Arnout

Quoted 22 lines
 package/linux-firmware/linux-firmware.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/linux-firmware/linux-firmware.mk +3 -3
index 083a381ea00a..9363099b68fd 100644
@@ -253,9 +253,9 @@ endif
 
 ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_BNX2X),y)
 LINUX_FIRMWARE_FILES += \
-	bnx2x/bnx2x-e1-7.10.51.0.fw \
-	bnx2x/bnx2x-e1h-7.10.51.0.fw \
-	bnx2x/bnx2x-e2-7.10.51.0.fw
+	bnx2x/bnx2x-e1-7.12.30.0.fw \
+	bnx2x/bnx2x-e1h-7.12.30.0.fw \
+	bnx2x/bnx2x-e2-7.12.30.0.fw
 # No license file; the license is in the file WHENCE
 # which is installed unconditionally
 endif
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#6 lore raw

PATCH v2 1/1 linux-firmware: Update bnx2x firwmare version

Quoted 9 lines · Arnout Vandecappelle
Quoted 6 lines · Joel Stanley

Linux kernel 4.2 moved the driver to a newer firmware version. As that is our default kernel, move the firmeware to a compatable version.

---
v2: Just use the new firmware to avoid adding extra cruft to our config system

No, this is certainly not good, it fixes 4.2+ and simultaneously breaks 4.1-.

We currently exist in a situation where 4.2+ has always been broken, as is anything below 3.18.

The current default version of the kernel is 4.4, so this change ensures that the kernel will work for this device with buildroot.

Quoted 2 lines

What is wrong with Thomas's proposal to remove the unneeded versions in a
post-build script?

This requires users of buildroot to be aware of the situation and carry local configuration. I think this is less desirable than to work out of the box.

From our project's perspective, it's easier to patch the linux-firmware package to only copy the version we want.

Quoted 3 lines

If your size is so important that 640K matters, you would probably anyway want to keep only one of the six binaries instead of three different chip revisions.

Good point. Thanks