Skip to contentSkip to conversation

package/murata-cyw-fw: new package

PATCH New Marcin Niestroj 3 participants 6 messages May 10, 2019 – May 20, 2019

lore
Share & tools
lore
#0 lore raw

v3 cover package/murata-cyw-fw: new package

Hi,

This is a next version of package with firmware for murata wireless modules (WiFi + BLE). This version is based on feedback from v2 [1].

I have splitted it into two patches, because I am not sure that second patch (reducing required files to download) is worth worse (in my opinion) user experience when rebuilding with new options selected.

[1] http://lists.busybox.net/pipermail/buildroot/2019-May/249595.html

Marcin Niestroj (2):
package/murata-cyw-fw: new package package/murata-cyw-fw: download NVRAM and BT_PATCH only when needed

 DEVELOPERS                               |   1 +
 package/Config.in                        |   1 +
 package/murata-cyw-fw/Config.in          |  97 ++++++++++++++++++++
 package/murata-cyw-fw/murata-cyw-fw.hash |   5 ++
 package/murata-cyw-fw/murata-cyw-fw.mk   | 107 +++++++++++++++++++++++
 5 files changed, 211 insertions(+)
 create mode 100644 package/murata-cyw-fw/Config.in
 create mode 100644 package/murata-cyw-fw/murata-cyw-fw.hash
 create mode 100644 package/murata-cyw-fw/murata-cyw-fw.mk
Signature · 1 line
2.21.0
#1 lore raw

PATCH v3 1/2 package/murata-cyw-fw: new package

---
Changes v2 -> v3:
* merge 3 packages into single murata-cyw-fw (suggested by Yann)
* use MURATA_CYW_FW_FILES_$(BR2_PACKAGE_MURATA_CYW_FW_CYW4354) trick to collect files to install (suggested by Arnout)

 DEVELOPERS                               |   1 +
 package/Config.in                        |   1 +
 package/murata-cyw-fw/Config.in          |  97 ++++++++++++++++++++++
 package/murata-cyw-fw/murata-cyw-fw.hash |   5 ++
 package/murata-cyw-fw/murata-cyw-fw.mk   | 100 +++++++++++++++++++++++
 5 files changed, 204 insertions(+)
 create mode 100644 package/murata-cyw-fw/Config.in
 create mode 100644 package/murata-cyw-fw/murata-cyw-fw.hash
 create mode 100644 package/murata-cyw-fw/murata-cyw-fw.mk
DEVELOPERS +1 -0
index 5bfc4561c0..849bf9c308 100644
@@ -1386,6 +1386,7 @@ F:	package/easydbus/
 F:	package/lua-flu/
 F:	package/lua-stdlib/
 F:	package/luaossl/
+F:	package/murata-cyw-fw/
 F:	package/rs485conf/
 F:	package/turbolua/
 
package/Config.in +1 -0
index f592e74a99..d9ebfc677e 100644
@@ -382,6 +382,7 @@ menu "Firmware"
 	source "package/armbian-firmware/Config.in"
 	source "package/b43-firmware/Config.in"
 	source "package/linux-firmware/Config.in"
+	source "package/murata-cyw-fw/Config.in"
 	source "package/rpi-bt-firmware/Config.in"
 	source "package/rpi-firmware/Config.in"
 	source "package/rpi-wifi-firmware/Config.in"
package/murata-cyw-fw/Config.in new file +97 -0

97 lines not on this page · raw message

package/murata-cyw-fw/murata-cyw-fw.hash new file +5 -0
new file mode 100644
index 0000000000..c1afb229eb
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256 c3ecf357786d6db6f3283c0ea36ec067b1728f801fd8871694aed1502a82e9bc murata-cyw-fw-8d87950bfad28c65926695b7357bd8995b60016a.tar.gz
+sha256 03c140ae04f9c2036678262d6457b9c4b4a9ebb523c5e681af6d57b97c11da37 cyw-fmac-nvram-d27f1bf105fa1e5b828e355793b88d4b66188411.tar.gz
+sha256 8f23ebb9a262112b62ace1e1bedcdeb00523d9a45e8d48a829d4ca35db4f0280 cyw-bt-patch-748462f0b02ec4aeb500bedd60780ac51c37be31.tar.gz
+sha256 3a892759b73e8b459f1a750954b316118b0061fd9d1868d11fa258c104ee7e0c LICENCE.cypress
package/murata-cyw-fw/murata-cyw-fw.mk new file +100 -0

100 lines not on this page · raw message

Signature · 1 line
2.21.0
#2 lore raw

PATCH v3 1/2 package/murata-cyw-fw: new package

Hello Marcin,

Quoted 1 line · On Fri, 10 May 2019 10:35:04 +0200 Marcin Niestroj…

I have applied your patch to next, with a few changes, see below.

package/murata-cyw-fw/murata-cyw-fw.mk line 21

Quoted 4 lines
package/murata-cyw-fw/murata-cyw-fw.mk new file +4 -0
+define MURATA_CYW_FW_EXTRACT_NVRAM_PATCH
+	$(foreach tar, $(notdir $(MURATA_CYW_FW_EXTRA_DOWNLOADS)), \
+		$(call suitable-extractor,$(tar)) $(MURATA_CYW_FW_DL_DIR)/$(tar) | \
+		$(TAR) --strip-components=1 -C $(@D) $(TAR_OPTIONS) -$(sep) \

I dropped the $(sep) and final backslash, as this is how we typically write foreach loops.

Review

Quoted 2 lines
(quoted diff) +2 -0
+	)
+ifneq ($(MURATA_CYW_FW_FILES_y),)

This condition was not really needed: if this variable is empty, the foreach loop will iterate on an empty list, and do nothing.

package/murata-cyw-fw/murata-cyw-fw.mk line 93

Quoted 2 lines
package/murata-cyw-fw/murata-cyw-fw.mk new file +2 -0
+define MURATA_CYW_FW_INSTALL_TARGET_CMDS
+	mkdir -p $(TARGET_DIR)/lib/firmware/brcm

I dropped this, and instead added the -D flag to $(INSTALL), which takes care of creating all intermediate directories.

package/murata-cyw-fw/murata-cyw-fw.mk line 96

Quoted 3 lines
package/murata-cyw-fw/murata-cyw-fw.mk new file +3 -0
+	$(foreach f,$(MURATA_CYW_FW_FILES_y), \
+		$(INSTALL) -m 0644 $(@D)/$(f) \
+			$(TARGET_DIR)/lib/firmware/brcm/$(call murata-cyw-fw-file-rename,$(f))$(sep))

I have dropped the $(sep) and moved the final closing parenthesis to the next line, which does the same thing, but is a bit more common in Buildroot.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v3 2/2 package/murata-cyw-fw: download NVRAM and BT_PATCH only when needed

In reply to Marcin Niestroj

Do not download NVRAM and BT_PATCH repositories when selected modules do not require files from them. One of the example module is CYW4359, which has neither NVRAM nor BT_PATCH files.

There is also drawback of this approach: NVRAM and BT_PATCH are not downloaded when package is being rebuilt with changed set selected modules, so the whole build fails because of missing files.

---
Changes v2 -> v3: add this patch

 package/murata-cyw-fw/murata-cyw-fw.mk | 29 ++++++++++++++++----------
 1 file changed, 18 insertions(+), 11 deletions(-)
package/murata-cyw-fw/murata-cyw-fw.mk +18 -11
index 0196b47821..c0ada217af 100644
@@ -8,21 +8,10 @@ MURATA_CYW_FW_VERSION = 8d87950bfad28c65926695b7357bd8995b60016a
 MURATA_CYW_FW_VERSION_NVRAM = d27f1bf105fa1e5b828e355793b88d4b66188411
 MURATA_CYW_FW_VERSION_BT_PATCH = 748462f0b02ec4aeb500bedd60780ac51c37be31
 MURATA_CYW_FW_SITE = $(call github,murata-wireless,cyw-fmac-fw,$(MURATA_CYW_FW_VERSION))
-MURATA_CYW_FW_EXTRA_DOWNLOADS = \
-	$(call github,murata-wireless,cyw-fmac-nvram,$(MURATA_CYW_FW_VERSION_NVRAM))/cyw-fmac-nvram-$(MURATA_CYW_FW_VERSION_NVRAM).tar.gz \
-	$(call github,murata-wireless,cyw-bt-patch,$(MURATA_CYW_FW_VERSION_BT_PATCH))/cyw-bt-patch-$(MURATA_CYW_FW_VERSION_BT_PATCH).tar.gz
 MURATA_CYW_FW_LICENSE = PROPRIETARY
 MURATA_CYW_FW_LICENSE_FILES = LICENCE.cypress
 MURATA_CYW_FW_REDISTRIBUTE = NO
 
-define MURATA_CYW_FW_EXTRACT_NVRAM_PATCH
-	$(foreach tar, $(notdir $(MURATA_CYW_FW_EXTRA_DOWNLOADS)), \
-		$(call suitable-extractor,$(tar)) $(MURATA_CYW_FW_DL_DIR)/$(tar) | \
-		$(TAR) --strip-components=1 -C $(@D) $(TAR_OPTIONS) -$(sep) \
-	)
-endef
-MURATA_CYW_FW_POST_EXTRACT_HOOKS += MURATA_CYW_FW_EXTRACT_NVRAM_PATCH
-
 MURATA_CYW_FW_FILES_$(BR2_PACKAGE_MURATA_CYW_FW_CYW43012) += \
 	brcmfmac43012-sdio.bin \
 	brcmfmac43012-sdio.1LV.clm_blob \
@@ -80,6 +69,24 @@ MURATA_CYW_FW_FILES_$(BR2_PACKAGE_MURATA_CYW_FW_CYW4359) += \
 	brcmfmac4359-pcie.bin \
 	brcmfmac4359-pcie.1FD.clm_blob
 
+ifneq ($(findstring .txt,$(MURATA_CYW_FW_FILES_y)),)
+MURATA_CYW_FW_EXTRA_DOWNLOADS += \
+	$(call github,murata-wireless,cyw-fmac-nvram,$(MURATA_CYW_FW_VERSION_NVRAM))/cyw-fmac-nvram-$(MURATA_CYW_FW_VERSION_NVRAM).tar.gz
+endif
+
+ifneq ($(findstring .hcd,$(MURATA_CYW_FW_FILES_y)),)
+MURATA_CYW_FW_EXTRA_DOWNLOADS += \
+	$(call github,murata-wireless,cyw-bt-patch,$(MURATA_CYW_FW_VERSION_BT_PATCH))/cyw-bt-patch-$(MURATA_CYW_FW_VERSION_BT_PATCH).tar.gz
+endif
+
+define MURATA_CYW_FW_EXTRACT_NVRAM_PATCH
+	$(foreach tar, $(notdir $(MURATA_CYW_FW_EXTRA_DOWNLOADS)), \
+		$(call suitable-extractor,$(tar)) $(MURATA_CYW_FW_DL_DIR)/$(tar) | \
+		$(TAR) --strip-components=1 -C $(@D) $(TAR_OPTIONS) -$(sep) \
+	)
+endef
+MURATA_CYW_FW_POST_EXTRACT_HOOKS += MURATA_CYW_FW_EXTRACT_NVRAM_PATCH
+
 # Helper that assumes filename with model has two dots (CHIP.MODEL.EXT),
 # but filename without model has only single dot (CHIP.EXT).
 murata-cyw-fw-strip-model = $(shell echo -n $(1) | sed 's/\..*\./\./')
Signature · 1 line
2.21.0
#4 lore raw

PATCH v3 2/2 package/murata-cyw-fw: download NVRAM and BT_PATCH only when needed

Hello Marcin,

Quoted 11 lines · On Fri, 10 May 2019 10:35:05 +0200 Marcin Niestroj…

Do not download NVRAM and BT_PATCH repositories when selected modules do not require files from them. One of the example module is CYW4359, which has neither NVRAM nor BT_PATCH files.

There is also drawback of this approach: NVRAM and BT_PATCH are not downloaded when package is being rebuilt with changed set selected modules, so the whole build fails because of missing files.

---
Changes v2 -> v3: add this patch

I looked at the size of the different tarballs:

-rw-r--r-- 1 thomas thomas 193K 20 mai   21:53 cyw-bt-patch-748462f0b02ec4aeb500bedd60780ac51c37be31.tar.gz
-rw-r--r-- 1 thomas thomas  12K 20 mai   21:53 cyw-fmac-nvram-d27f1bf105fa1e5b828e355793b88d4b66188411.tar.gz
-rw-r--r-- 1 thomas thomas 2,7M 20 mai   21:53 murata-cyw-fw-8d87950bfad28c65926695b7357bd8995b60016a.tar.gz

So the main tarball is 2.7 MB, and it gets always downloaded. The other ones are 193 KB and 12 KB. I don't think this really warrants some additional complexity: we can simply always download all tarballs, as you did in PATCH 1/2.

So I marked PATCH 2/2 as Rejected.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v3 2/2 package/murata-cyw-fw: download NVRAM and BT_PATCH only when needed

Thomas, All,

On 2019-05-20 22:21 +0200, Thomas Petazzoni spake thusly:

Quoted 20 lines
Quoted 11 lines · On Fri, 10 May 2019 10:35:05 +0200 Marcin Niestroj…

Do not download NVRAM and BT_PATCH repositories when selected modules do not require files from them. One of the example module is CYW4359, which has neither NVRAM nor BT_PATCH files.

There is also drawback of this approach: NVRAM and BT_PATCH are not downloaded when package is being rebuilt with changed set selected modules, so the whole build fails because of missing files.

---
Changes v2 -> v3: add this patch

I looked at the size of the different tarballs:

(quoted diff) +0 -3
-rw-r--r-- 1 thomas thomas 193K 20 mai   21:53 cyw-bt-patch-748462f0b02ec4aeb500bedd60780ac51c37be31.tar.gz
-rw-r--r-- 1 thomas thomas  12K 20 mai   21:53 cyw-fmac-nvram-d27f1bf105fa1e5b828e355793b88d4b66188411.tar.gz
-rw-r--r-- 1 thomas thomas 2,7M 20 mai   21:53 murata-cyw-fw-8d87950bfad28c65926695b7357bd8995b60016a.tar.gz
Quoted 4 lines

So the main tarball is 2.7 MB, and it gets always downloaded. The other ones are 193 KB and 12 KB. I don't think this really warrants some additional complexity: we can simply always download all tarballs, as you did in PATCH 1/2.

It was I who suggested Marcin could do this conditional download, after they explained the extra downloads where not always required.

However, I did not know the relative sizes. Now that I do, I do agree that this does not warrant the extra complexity.

Quoted 1 line

So I marked PATCH 2/2 as Rejected.

Agreed.

Regards,
Yann E. MORIN.

Quoted 11 lines

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
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 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'