Skip to contentSkip to conversation

rpi-wifi-firmware: new package

PATCH New Peter Korsgaard 2 participants 7 messages May 5, 2017 – May 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpi-wifi-firmware: new package

Add firmware (NVRAM data) for the Raspberry Pi 3 and Zero W wifi module.

Notice that linux-firmware provides the main firmware (brcmfmac43430-sdio.bin), but the module also needs board specific configuration (NVRAM) data.

For the rpi, this data is available in the RPI firmware-nonfree git repo. As this repo contains a lot of unrelated data (~70MB), simply download the single NVRAM file instead of cloning the entire repo.

A similar approach is used by openwrt and opensuse:

https://dev.openwrt.org/browser/trunk/package/firmware/brcmfmac43430-firmware/Makefile?rev=49139
https://build.opensuse.org/package/view_file/hardware/bcm43xx-firmware/bcm43xx-firmware.spec?rev=b1628448b36c85abc9215eab4785ef29

---
 package/Config.in                                |  1 +
 package/rpi-wifi-firmware/Config.in              | 10 ++++++++++
 package/rpi-wifi-firmware/rpi-wifi-firmware.hash |  2 ++
 package/rpi-wifi-firmware/rpi-wifi-firmware.mk   | 22 ++++++++++++++++++++++
 4 files changed, 35 insertions(+)
 create mode 100644 package/rpi-wifi-firmware/Config.in
 create mode 100644 package/rpi-wifi-firmware/rpi-wifi-firmware.hash
 create mode 100644 package/rpi-wifi-firmware/rpi-wifi-firmware.mk
package/Config.in +1 -0
index 1af815086..d57813c5c 100644
@@ -348,6 +348,7 @@ menu "Firmware"
 	source "package/linux-firmware/Config.in"
 	source "package/rpi-bt-firmware/Config.in"
 	source "package/rpi-firmware/Config.in"
+	source "package/rpi-wifi-firmware/Config.in"
 	source "package/sunxi-boards/Config.in"
 	source "package/ts4900-fpga/Config.in"
 	source "package/ux500-firmware/Config.in"
package/rpi-wifi-firmware/Config.in new file +10 -0
new file mode 100644
index 000000000..2c87c7584
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_RPI_WIFI_FIRMWARE
+	bool "rpi-wifi-firmware"
+	depends on BR2_arm || BR2_aarch64
+	select BR2_PACKAGE_LINUX_FIRMWARE
+	select BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX # runtime
+	help
+	  Raspberry Pi 3 and Zero W Broadcom BCM43430 wifi module
+	  NVRAM data.
+
+	  https://github.com/RPi-Distro/firmware-nonfree/
package/rpi-wifi-firmware/rpi-wifi-firmware.hash new file +2 -0
new file mode 100644
index 000000000..c20506536
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  872fde4f9942d9aba805880d6eaddfe050305626fd58ad955bfe77c04f6b75a5  brcmfmac43430-sdio.txt
package/rpi-wifi-firmware/rpi-wifi-firmware.mk new file +22 -0
new file mode 100644
index 000000000..e90864fae
@@ -0,0 +1,22 @@
+################################################################################
+#
+# rpi-wifi-firmware
+#
+################################################################################
+
+RPI_WIFI_FIRMWARE_VERSION = 54bab3d6a6d43239c71d26464e6e10e5067ffea7
+# brcmfmac43430-sdio.bin comes from linux-firmware
+RPI_WIFI_FIRMWARE_SOURCE = brcmfmac43430-sdio.txt
+# git repo contains a lot of unrelated files
+RPI_WIFI_FIRMWARE_SITE = https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/$(RPI_WIFI_FIRMWARE_VERSION)/brcm80211/brcm
+
+define RPI_WIFI_FIRMWARE_EXTRACT_CMDS
+	cp $(DL_DIR)/$($(PKG)_SOURCE) $(@D)/
+endef
+
+define RPI_WIFI_FIRMWARE_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/$(RPI_WIFI_FIRMWARE_SOURCE) \
+		$(TARGET_DIR)/lib/firmware/brcm/$(RPI_WIFI_FIRMWARE_SOURCE)
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 rpi-wifi-firmware: new package

Peter, All,

On 2017-05-05 20:37 +0200, Peter Korsgaard spake thusly:

Quoted 10 lines

Add firmware (NVRAM data) for the Raspberry Pi 3 and Zero W wifi module.

Notice that linux-firmware provides the main firmware (brcmfmac43430-sdio.bin), but the module also needs board specific configuration (NVRAM) data.

For the rpi, this data is available in the RPI firmware-nonfree git repo. As this repo contains a lot of unrelated data (~70MB), simply download the single NVRAM file instead of cloning the entire repo.

Quoted 6 lines

A similar approach is used by openwrt and opensuse:

https://dev.openwrt.org/browser/trunk/package/firmware/brcmfmac43430-firmware/Makefile?rev=49139
https://build.opensuse.org/package/view_file/hardware/bcm43xx-firmware/bcm43xx-firmware.spec?rev=b1628448b36c85abc9215eab4785ef29

[--SNIP--]

package/rpi-wifi-firmware/Config.in line 3

Quoted 9 lines
package/rpi-wifi-firmware/Config.in new file +3 -0
new file mode 100644
index 000000000..2c87c7584
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_RPI_WIFI_FIRMWARE
+	bool "rpi-wifi-firmware"
+	depends on BR2_arm || BR2_aarch64

I know it read "rpi-wifi-firmware" and thus it is arm or aarch64. But can we expect the same chip to be used on a non-arm board?

I would just drop the architecture dependency here, because there is nothing specific to the SoC here; the WiFi chip is a secondary chip, so could well be present on other boards that are non-arm.

Quoted 22 lines
package/rpi-wifi-firmware/Config.in new file +7 -0
+	select BR2_PACKAGE_LINUX_FIRMWARE
+	select BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX # runtime
+	help
+	  Raspberry Pi 3 and Zero W Broadcom BCM43430 wifi module
+	  NVRAM data.
+
+	  https://github.com/RPi-Distro/firmware-nonfree/
package/rpi-wifi-firmware/rpi-wifi-firmware.hash new file +2 -0
new file mode 100644
index 000000000..c20506536
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  872fde4f9942d9aba805880d6eaddfe050305626fd58ad955bfe77c04f6b75a5  brcmfmac43430-sdio.txt
package/rpi-wifi-firmware/rpi-wifi-firmware.mk new file +1 -0
new file mode 100644
index 000000000..e90864fae
@@ -0,0 +1,22 @@
+################################################################################

package/rpi-wifi-firmware/rpi-wifi-firmware.mk line 11

Quoted 10 lines
package/rpi-wifi-firmware/rpi-wifi-firmware.mk new file +10 -0
+#
+# rpi-wifi-firmware
+#
+################################################################################
+
+RPI_WIFI_FIRMWARE_VERSION = 54bab3d6a6d43239c71d26464e6e10e5067ffea7
+# brcmfmac43430-sdio.bin comes from linux-firmware
+RPI_WIFI_FIRMWARE_SOURCE = brcmfmac43430-sdio.txt
+# git repo contains a lot of unrelated files
+RPI_WIFI_FIRMWARE_SITE = https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/$(RPI_WIFI_FIRMWARE_VERSION)/brcm80211/brcm

License?

Regards,
Yann E. MORIN.

Quoted 17 lines
package/rpi-wifi-firmware/rpi-wifi-firmware.mk new file +10 -0
+define RPI_WIFI_FIRMWARE_EXTRACT_CMDS
+	cp $(DL_DIR)/$($(PKG)_SOURCE) $(@D)/
+endef
+
+define RPI_WIFI_FIRMWARE_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/$(RPI_WIFI_FIRMWARE_SOURCE) \
+		$(TARGET_DIR)/lib/firmware/brcm/$(RPI_WIFI_FIRMWARE_SOURCE)
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.11.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 rpi-wifi-firmware: new package

Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Peter, All,
On 2017-05-05 20:37 +0200, Peter Korsgaard spake thusly:

Quoted 10 lines

Add firmware (NVRAM data) for the Raspberry Pi 3 and Zero W wifi module.

Notice that linux-firmware provides the main firmware (brcmfmac43430-sdio.bin), but the module also needs board specific configuration (NVRAM) data.

For the rpi, this data is available in the RPI firmware-nonfree git repo. As this repo contains a lot of unrelated data (~70MB), simply download the single NVRAM file instead of cloning the entire repo.

Quoted 6 lines

A similar approach is used by openwrt and opensuse:

https://dev.openwrt.org/browser/trunk/package/firmware/brcmfmac43430-firmware/Makefile?rev=49139
https://build.opensuse.org/package/view_file/hardware/bcm43xx-firmware/bcm43xx-firmware.spec?rev=b1628448b36c85abc9215eab4785ef29

[--SNIP--]

Quoted 12 lines

package/rpi-wifi-firmware/Config.in line 3

Quoted 9 lines
package/rpi-wifi-firmware/Config.in new file +3 -0
new file mode 100644
index 000000000..2c87c7584
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_RPI_WIFI_FIRMWARE
+	bool "rpi-wifi-firmware"
+	depends on BR2_arm || BR2_aarch64

I know it read "rpi-wifi-firmware" and thus it is arm or aarch64. But can we expect the same chip to be used on a non-arm board?

Posssibly, yes - But then with different nvram settings. See the opensuse link above for how they handle rpi + a few sunxi boards.

Quoted 3 lines

I would just drop the architecture dependency here, because there is nothing specific to the SoC here; the WiFi chip is a secondary chip, so could well be present on other boards that are non-arm.

I disagree. I haven't found any detailed documentation, but my understanding is that this nvram data is board(-family) specific, E.G. it differs between the sunxi boards. From what I could find, the rpi0-w uses the same nvram file as rpi3 though.

Quoted 8 lines
Quoted 8 lines
package/rpi-wifi-firmware/Config.in new file +7 -0
+++ b/package/rpi-wifi-firmware/rpi-wifi-firmware.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# rpi-wifi-firmware
+#
+################################################################################
+
Quoted 8 lines
Quoted 6 lines
package/rpi-wifi-firmware/Config.in new file +5 -0
+RPI_WIFI_FIRMWARE_VERSION = 54bab3d6a6d43239c71d26464e6e10e5067ffea7
+# brcmfmac43430-sdio.bin comes from linux-firmware
+RPI_WIFI_FIRMWARE_SOURCE = brcmfmac43430-sdio.txt
+# git repo contains a lot of unrelated files
+RPI_WIFI_FIRMWARE_SITE =

https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/$(RPI_WIFI_FIRMWARE_VERSION)/brcm80211/brcm

License?

Yeah, that's where things get complicated. There is no explicit license given. The other brcm*bin files in linux-firmware are covered by LICENCE.broadcom_bcm43xx, but the question is if this also applies to this nvram file.

Maybe we should just do:

RPI_WIFI_FIRMWARE_LICENSE = PROPRIETARY

Like we do for the bluetooth part.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 rpi-wifi-firmware: new package

Peter, All,

On 2017-05-06 10:50 +0200, Peter Korsgaard spake thusly:

Quoted 38 lines
Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Peter, All,
On 2017-05-05 20:37 +0200, Peter Korsgaard spake thusly:

Quoted 10 lines

Add firmware (NVRAM data) for the Raspberry Pi 3 and Zero W wifi module.

Notice that linux-firmware provides the main firmware (brcmfmac43430-sdio.bin), but the module also needs board specific configuration (NVRAM) data.

For the rpi, this data is available in the RPI firmware-nonfree git repo. As this repo contains a lot of unrelated data (~70MB), simply download the single NVRAM file instead of cloning the entire repo.

Quoted 6 lines

A similar approach is used by openwrt and opensuse:

https://dev.openwrt.org/browser/trunk/package/firmware/brcmfmac43430-firmware/Makefile?rev=49139
https://build.opensuse.org/package/view_file/hardware/bcm43xx-firmware/bcm43xx-firmware.spec?rev=b1628448b36c85abc9215eab4785ef29

[--SNIP--]

Quoted 12 lines

package/rpi-wifi-firmware/Config.in line 3

Quoted 9 lines
package/rpi-wifi-firmware/Config.in new file +3 -0
new file mode 100644
index 000000000..2c87c7584
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_RPI_WIFI_FIRMWARE
+	bool "rpi-wifi-firmware"
+	depends on BR2_arm || BR2_aarch64

I know it read "rpi-wifi-firmware" and thus it is arm or aarch64. But can we expect the same chip to be used on a non-arm board?

Posssibly, yes - But then with different nvram settings. See the opensuse link above for how they handle rpi + a few sunxi boards.

Quoted 8 lines
Quoted 3 lines

I would just drop the architecture dependency here, because there is nothing specific to the SoC here; the WiFi chip is a secondary chip, so could well be present on other boards that are non-arm.

I disagree. I haven't found any detailed documentation, but my understanding is that this nvram data is board(-family) specific, E.G. it differs between the sunxi boards. From what I could find, the rpi0-w uses the same nvram file as rpi3 though.

If it is (familly-of-)board-specific then keep the dependency, then.

Quoted 22 lines
Quoted 8 lines
Quoted 8 lines
package/rpi-wifi-firmware/Config.in new file +7 -0
+++ b/package/rpi-wifi-firmware/rpi-wifi-firmware.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# rpi-wifi-firmware
+#
+################################################################################
+
Quoted 8 lines
Quoted 6 lines
package/rpi-wifi-firmware/Config.in new file +5 -0
+RPI_WIFI_FIRMWARE_VERSION = 54bab3d6a6d43239c71d26464e6e10e5067ffea7
+# brcmfmac43430-sdio.bin comes from linux-firmware
+RPI_WIFI_FIRMWARE_SOURCE = brcmfmac43430-sdio.txt
+# git repo contains a lot of unrelated files
+RPI_WIFI_FIRMWARE_SITE =

https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/$(RPI_WIFI_FIRMWARE_VERSION)/brcm80211/brcm

License?

Yeah, that's where things get complicated. There is no explicit license given. The other brcm*bin files in linux-firmware are covered by LICENCE.broadcom_bcm43xx, but the question is if this also applies to this nvram file.

Quoted 5 lines

Maybe we should just do:

RPI_WIFI_FIRMWARE_LICENSE = PROPRIETARY

Like we do for the bluetooth part.

The OpenSUSE link you pointed above states:

# From
# https://github.com/raspberrypi/linux/issues/1325#issuecomment-195560582
# Phil Elwell (Raspberry Pi Foundation) wrote: "Broadcom have said that # the firmware files for the BCM43438 are covered under this licence:" Source0:
https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain/LICENCE.broadcom_bcm43xx

BTW, I love the way they force local names to be board-specific.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 rpi-wifi-firmware: new package

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Hi,

Quoted 6 lines
Quoted 4 lines

I disagree. I haven't found any detailed documentation, but my understanding is that this nvram data is board(-family) specific, E.G. it differs between the sunxi boards. From what I could find, the rpi0-w uses the same nvram file as rpi3 though.

If it is (familly-of-)board-specific then keep the dependency, then.

Ok, good.

Quoted 28 lines
Quoted 22 lines
Quoted 8 lines
Quoted 8 lines

+++ b/package/rpi-wifi-firmware/rpi-wifi-firmware.mk

package/rpi-wifi-firmware/rpi-wifi-firmware.mk new file +6 -0
@@ -0,0 +1,22 @@
+################################################################################
+#
+# rpi-wifi-firmware
+#
+################################################################################
+
Quoted 8 lines
Quoted 6 lines
package/rpi-wifi-firmware/rpi-wifi-firmware.mk new file +5 -0
+RPI_WIFI_FIRMWARE_VERSION = 54bab3d6a6d43239c71d26464e6e10e5067ffea7
+# brcmfmac43430-sdio.bin comes from linux-firmware
+RPI_WIFI_FIRMWARE_SOURCE = brcmfmac43430-sdio.txt
+# git repo contains a lot of unrelated files
+RPI_WIFI_FIRMWARE_SITE =

https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/$(RPI_WIFI_FIRMWARE_VERSION)/brcm80211/brcm

License?

Yeah, that's where things get complicated. There is no explicit license given. The other brcm*bin files in linux-firmware are covered by LICENCE.broadcom_bcm43xx, but the question is if this also applies to this nvram file.

Quoted 5 lines

Maybe we should just do:

RPI_WIFI_FIRMWARE_LICENSE = PROPRIETARY

Like we do for the bluetooth part.

Quoted 8 lines

The OpenSUSE link you pointed above states:

# From
# https://github.com/raspberrypi/linux/issues/1325#issuecomment-195560582
# Phil Elwell (Raspberry Pi Foundation) wrote: "Broadcom have said that # the firmware files for the BCM43438 are covered under this licence:" Source0:
https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain/LICENCE.broadcom_bcm43xx

Yes, the question is just if that only covers the generic .bin file or also the board(-family) specific nvram file, but OK.

As rpi-wifi-firmware already pulls in the .bin file from linux-firmware (and hence LICENSE.broadcom_bcm43xx) I'll just set _FIRMWARE_LICENSE to PROPRIETARY and not specify any license file here.

Quoted 1 line

BTW, I love the way they force local names to be board-specific.

The # syntax?

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 1/1 rpi-wifi-firmware: new package

Peter, All,

On 2017-05-06 11:28 +0200, Peter Korsgaard spake thusly:

Quoted 10 lines
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

The OpenSUSE link you pointed above states:

# From
# https://github.com/raspberrypi/linux/issues/1325#issuecomment-195560582
# Phil Elwell (Raspberry Pi Foundation) wrote: "Broadcom have said that # the firmware files for the BCM43438 are covered under this licence:" Source0:
https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain/LICENCE.broadcom_bcm43xx

Quoted 6 lines

Yes, the question is just if that only covers the generic .bin file or also the board(-family) specific nvram file, but OK.

As rpi-wifi-firmware already pulls in the .bin file from linux-firmware (and hence LICENSE.broadcom_bcm43xx) I'll just set _FIRMWARE_LICENSE to PROPRIETARY and not specify any license file here.

ACK.

Quoted 3 lines
Quoted 1 line

BTW, I love the way they force local names to be board-specific.

The # syntax?

Yep.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 1/1 rpi-wifi-firmware: new package

In reply to Peter Korsgaard
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

Add firmware (NVRAM data) for the Raspberry Pi 3 and Zero W wifi module. Notice that linux-firmware provides the main firmware (brcmfmac43430-sdio.bin), but the module also needs board specific configuration (NVRAM) data.

For the rpi, this data is available in the RPI firmware-nonfree git repo. As this repo contains a lot of unrelated data (~70MB), simply download the single NVRAM file instead of cloning the entire repo.

Quoted 6 lines

A similar approach is used by openwrt and opensuse:

https://dev.openwrt.org/browser/trunk/package/firmware/brcmfmac43430-firmware/Makefile?rev=49139
https://build.opensuse.org/package/view_file/hardware/bcm43xx-firmware/bcm43xx-firmware.spec?rev=b1628448b36c85abc9215eab4785ef29

Committed after adding _LICENSE = PROPRIETARY, thanks.

Signature · 1 line
Bye, Peter Korsgaard