linux-firmware: offer two versions of firmware for CYW4339
authorKuan-Yi Li <kyli@abysm.org>
Thu, 20 Oct 2022 03:31:19 +0000 (11:31 +0800)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Tue, 15 Nov 2022 19:49:58 +0000 (20:49 +0100)
According to commit 6f6c2fb321, AP6335 module used in PICO-PI-IMX7D works
only with firmware from `linux-firmware`. However, firmware from
`cypress-firmware` suite is directly from the chip company (Infineon) and
is actually newer.

Instead of dropping the firmware from Infineon, create a package named
`brcmfmac-firmware-4339-sdio`, and keep the Infineon version of
`cypress-firmware-4339-sdio` around.

This gives us devs the option to choose. Also, it means that

 - packages `brcmfmac-firmware-*` uniformly come from `linux-firmware`
 - packages `cypress-firmware-*` uniformly come from `cypress-firmware`

so hopefully brings more clarity.

Tested-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
package/firmware/cypress-firmware/Makefile
package/firmware/linux-firmware/Makefile
package/firmware/linux-firmware/broadcom.mk
package/firmware/linux-firmware/cypress.mk [deleted file]
target/linux/imx/image/cortexa7.mk

index f0f25e53b5d4e3175597e855206c1edc8f5dd148..2cd3da9822c055b4479fde061cdbf93c4c003bae 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cypress-firmware
 PKG_VERSION:=5.4.18-2021_0812
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/Infineon/ifx-linux-firmware/
@@ -96,6 +96,27 @@ endef
 
 $(eval $(call BuildPackage,cypress-firmware-43362-sdio))
 
+# Cypress 4339 SDIO Firmware
+define Package/cypress-firmware-4339-sdio
+  $(Package/cypress-firmware-default)
+  TITLE:=CYW4339 FullMac SDIO firmware
+  PROVIDES:=brcmfmac-firmware-4339-sdio
+  CONFLICTS:=brcmfmac-firmware-4339-sdio
+endef
+
+define Package/cypress-firmware-4339-sdio/install
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/firmware/cyfmac4339-sdio.bin \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac4339-sdio.bin \
+               $(1)/lib/firmware/brcm/brcmfmac4339-sdio.bin
+endef
+
+$(eval $(call BuildPackage,cypress-firmware-4339-sdio))
+
 # Cypress 43430 SDIO Firmware
 define Package/cypress-firmware-43430-sdio
   $(Package/cypress-firmware-default)
index 2c4d361012d4b778fe937bd79c1c08cd8bcdd109..2656f9c01f5c2ed7a5a253ad4b7d86cf23819fa2 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=linux-firmware
 PKG_VERSION:=20221109
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
index b48677a378cf30d4cfd220e52383340d244f078e..c0d315c19c49b24154555d06f8502c69440cfb72 100644 (file)
@@ -1,3 +1,16 @@
+Package/brcmfmac-firmware-4339-sdio = $(call Package/firmware-default,Broadcom 4339 FullMAC SDIO firmware)
+define Package/brcmfmac-firmware-4339-sdio/install
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/cypress/cyfmac4339-sdio.bin \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac4339-sdio.bin \
+               $(1)/lib/firmware/brcm/brcmfmac4339-sdio.bin
+endef
+$(eval $(call BuildPackage,brcmfmac-firmware-4339-sdio))
+
 Package/brcmfmac-firmware-43602a1-pcie = $(call Package/firmware-default,Broadcom 43602a1 FullMAC PCIe firmware)
 define Package/brcmfmac-firmware-43602a1-pcie/install
        $(INSTALL_DIR) $(1)/lib/firmware/brcm
diff --git a/package/firmware/linux-firmware/cypress.mk b/package/firmware/linux-firmware/cypress.mk
deleted file mode 100644 (file)
index 2f5b66f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package/cypress-firmware-4339-sdio = $(call Package/firmware-default,Broadcom BCM4339 FullMac SDIO firmware)
-define Package/cypress-firmware-4339-sdio/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
-       $(INSTALL_DATA) \
-               $(PKG_BUILD_DIR)/cypress/cyfmac4339-sdio.bin \
-               $(1)/lib/firmware/brcm/brcmfmac4339-sdio.bin
-endef
-$(eval $(call BuildPackage,cypress-firmware-4339-sdio))
index b4ac1b6904d571d4c0703c32933939f17e8351d2..6306ed421dde57fd9820b5820dd533ee47be4e8c 100644 (file)
@@ -21,7 +21,7 @@ define Device/technexion_imx7d-pico-pi
   DEVICE_PACKAGES := kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \
        kmod-can kmod-can-flexcan kmod-can-raw kmod-leds-gpio \
        kmod-input-touchscreen-edt-ft5x06 kmod-usb-hid kmod-btsdio \
-       kmod-brcmfmac cypress-firmware-4339-sdio cypress-nvram-4339-pico-pi-imx7d
+       kmod-brcmfmac brcmfmac-firmware-4339-sdio cypress-nvram-4339-pico-pi-imx7d
   FILESYSTEMS := squashfs
   IMAGES := combined.bin sysupgrade.bin
   IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx-sdcard-raw-uboot