[openwrt/openwrt] linux-firmware: offer two versions of firmware for CYW4339

LEDE Commits lede-commits at lists.infradead.org
Tue Nov 15 11:55:39 PST 2022


noltari pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a110418027a4c6f97c33980b8e4d7f07d39726de

commit a110418027a4c6f97c33980b8e4d7f07d39726de
Author: Kuan-Yi Li <kyli at abysm.org>
AuthorDate: Thu Oct 20 11:31:19 2022 +0800

    linux-firmware: offer two versions of firmware for CYW4339
    
    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 at gmail.com>
    Signed-off-by: Kuan-Yi Li <kyli at abysm.org>
---
 package/firmware/cypress-firmware/Makefile  | 23 ++++++++++++++++++++++-
 package/firmware/linux-firmware/Makefile    |  2 +-
 package/firmware/linux-firmware/broadcom.mk | 13 +++++++++++++
 package/firmware/linux-firmware/cypress.mk  |  8 --------
 target/linux/imx/image/cortexa7.mk          |  2 +-
 5 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/package/firmware/cypress-firmware/Makefile b/package/firmware/cypress-firmware/Makefile
index f0f25e53b5..2cd3da9822 100644
--- a/package/firmware/cypress-firmware/Makefile
+++ b/package/firmware/cypress-firmware/Makefile
@@ -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)
diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile
index 2c4d361012..2656f9c01f 100644
--- a/package/firmware/linux-firmware/Makefile
+++ b/package/firmware/linux-firmware/Makefile
@@ -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
diff --git a/package/firmware/linux-firmware/broadcom.mk b/package/firmware/linux-firmware/broadcom.mk
index b48677a378..c0d315c19c 100644
--- a/package/firmware/linux-firmware/broadcom.mk
+++ b/package/firmware/linux-firmware/broadcom.mk
@@ -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
index 2f5b66fecf..0000000000
--- a/package/firmware/linux-firmware/cypress.mk
+++ /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))
diff --git a/target/linux/imx/image/cortexa7.mk b/target/linux/imx/image/cortexa7.mk
index b4ac1b6904..6306ed421d 100644
--- a/target/linux/imx/image/cortexa7.mk
+++ b/target/linux/imx/image/cortexa7.mk
@@ -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




More information about the lede-commits mailing list