cypress-firmware: use symlink to provide firmware in brcm
authorKuan-Yi Li <kyli@abysm.org>
Thu, 20 Oct 2022 02:26:13 +0000 (10:26 +0800)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Tue, 15 Nov 2022 19:48:08 +0000 (20:48 +0100)
This is to align the implementation with upstream `linux-firmware`.

Instead of moving these firmware files to `brcm` subdirectory and changing
their names, leave them in `cypress` subdirectory, keep their names intact
and use symbolic links to provide compatibility with Broadcom FullMAC
driver.

This gives more context to where the firmware comes from.

Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
package/firmware/cypress-firmware/Makefile

index 769e69a97318080b786ed6e806f57e56b54f1dbd..f0f25e53b5d4e3175597e855206c1edc8f5dd148 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cypress-firmware
 PKG_VERSION:=5.4.18-2021_0812
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/Infineon/ifx-linux-firmware/
@@ -38,12 +38,19 @@ define Package/cypress-firmware-43012-sdio
 endef
 
 define Package/cypress-firmware-43012-sdio/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac43012-sdio.bin \
-               $(1)/lib/firmware/brcm/brcmfmac43012-sdio.bin
+               $(1)/lib/firmware/cypress/
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac43012-sdio.clm_blob \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac43012-sdio.bin \
+               $(1)/lib/firmware/brcm/brcmfmac43012-sdio.bin
+       $(LN) \
+               ../cypress/cyfmac43012-sdio.clm_blob \
                $(1)/lib/firmware/brcm/brcmfmac43012-sdio.clm_blob
 endef
 
@@ -56,9 +63,13 @@ define Package/cypress-firmware-43340-sdio
 endef
 
 define Package/cypress-firmware-43340-sdio/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac43340-sdio.bin \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac43340-sdio.bin \
                $(1)/lib/firmware/brcm/brcmfmac43340-sdio.bin
 endef
 
@@ -73,9 +84,13 @@ define Package/cypress-firmware-43362-sdio
 endef
 
 define Package/cypress-firmware-43362-sdio/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac43362-sdio.bin \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac43362-sdio.bin \
                $(1)/lib/firmware/brcm/brcmfmac43362-sdio.bin
 endef
 
@@ -90,12 +105,19 @@ define Package/cypress-firmware-43430-sdio
 endef
 
 define Package/cypress-firmware-43430-sdio/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac43430-sdio.bin \
-               $(1)/lib/firmware/brcm/brcmfmac43430-sdio.bin
+               $(1)/lib/firmware/cypress/
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac43430-sdio.clm_blob \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac43430-sdio.bin \
+               $(1)/lib/firmware/brcm/brcmfmac43430-sdio.bin
+       $(LN) \
+               ../cypress/cyfmac43430-sdio.clm_blob \
                $(1)/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob
 endef
 
@@ -110,12 +132,19 @@ define Package/cypress-firmware-43455-sdio
 endef
 
 define Package/cypress-firmware-43455-sdio/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac43455-sdio.bin \
-               $(1)/lib/firmware/brcm/brcmfmac43455-sdio.bin
+               $(1)/lib/firmware/cypress/
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac43455-sdio.clm_blob \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac43455-sdio.bin \
+               $(1)/lib/firmware/brcm/brcmfmac43455-sdio.bin
+       $(LN) \
+               ../cypress/cyfmac43455-sdio.clm_blob \
                $(1)/lib/firmware/brcm/brcmfmac43455-sdio.clm_blob
 endef
 
@@ -128,12 +157,19 @@ define Package/cypress-firmware-4354-sdio
 endef
 
 define Package/cypress-firmware-4354-sdio/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac4354-sdio.bin \
-               $(1)/lib/firmware/brcm/brcmfmac4354-sdio.bin
+               $(1)/lib/firmware/cypress/
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac4354-sdio.clm_blob \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac4354-sdio.bin \
+               $(1)/lib/firmware/brcm/brcmfmac4354-sdio.bin
+       $(LN) \
+               ../cypress/cyfmac4354-sdio.clm_blob \
                $(1)/lib/firmware/brcm/brcmfmac4354-sdio.clm_blob
 endef
 
@@ -146,12 +182,19 @@ define Package/cypress-firmware-4356-pcie
 endef
 
 define Package/cypress-firmware-4356-pcie/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac4356-pcie.bin \
-               $(1)/lib/firmware/brcm/brcmfmac4356-pcie.bin
+               $(1)/lib/firmware/cypress/
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac4356-pcie.clm_blob \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../firmware/cyfmac4356-pcie.bin \
+               $(1)/lib/firmware/brcm/brcmfmac4356-pcie.bin
+       $(LN) \
+               ../firmware/cyfmac4356-pcie.clm_blob \
                $(1)/lib/firmware/brcm/brcmfmac4356-pcie.clm_blob
 endef
 
@@ -164,12 +207,19 @@ define Package/cypress-firmware-4356-sdio
 endef
 
 define Package/cypress-firmware-4356-sdio/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac4356-sdio.bin \
-               $(1)/lib/firmware/brcm/brcmfmac4356-sdio.bin
+               $(1)/lib/firmware/cypress/
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac4356-sdio.clm_blob \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac4356-sdio.bin \
+               $(1)/lib/firmware/brcm/brcmfmac4356-sdio.bin
+       $(LN) \
+               ../cypress/cyfmac4356-sdio.clm_blob \
                $(1)/lib/firmware/brcm/brcmfmac4356-sdio.clm_blob
 endef
 
@@ -182,12 +232,19 @@ define Package/cypress-firmware-43570-pcie
 endef
 
 define Package/cypress-firmware-43570-pcie/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac43570-pcie.bin \
-               $(1)/lib/firmware/brcm/brcmfmac43570-pcie.bin
+               $(1)/lib/firmware/cypress/
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac43570-pcie.clm_blob \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac43570-pcie.bin \
+               $(1)/lib/firmware/brcm/brcmfmac43570-pcie.bin
+       $(LN) \
+               ../cypress/cyfmac43570-pcie.clm_blob \
                $(1)/lib/firmware/brcm/brcmfmac43570-pcie.clm_blob
 endef
 
@@ -200,12 +257,19 @@ define Package/cypress-firmware-4373-sdio
 endef
 
 define Package/cypress-firmware-4373-sdio/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac4373-sdio.bin \
-               $(1)/lib/firmware/brcm/brcmfmac4373-sdio.bin
+               $(1)/lib/firmware/cypress/
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac4373-sdio.clm_blob \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac4373-sdio.bin \
+               $(1)/lib/firmware/brcm/brcmfmac4373-sdio.bin
+       $(LN) \
+               ../cypress/cyfmac4373-sdio.clm_blob \
                $(1)/lib/firmware/brcm/brcmfmac4373-sdio.clm_blob
 endef
 
@@ -218,12 +282,19 @@ define Package/cypress-firmware-4373-usb
 endef
 
 define Package/cypress-firmware-4373-usb/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac4373-usb.bin \
-               $(1)/lib/firmware/brcm/brcmfmac4373-usb.bin
+               $(1)/lib/firmware/cypress/
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac4373.clm_blob \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac4373-usb.bin \
+               $(1)/lib/firmware/brcm/brcmfmac4373-usb.bin
+       $(LN) \
+               ../cypress/cyfmac4373.clm_blob \
                $(1)/lib/firmware/brcm/brcmfmac4373.clm_blob
 endef
 
@@ -236,12 +307,19 @@ define Package/cypress-firmware-54591-pcie
 endef
 
 define Package/cypress-firmware-54591-pcie/install
-       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(INSTALL_DIR) $(1)/lib/firmware/cypress
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac54591-pcie.bin \
-               $(1)/lib/firmware/brcm/brcmfmac54591-pcie.bin
+               $(1)/lib/firmware/cypress/
        $(INSTALL_DATA) \
                $(PKG_BUILD_DIR)/firmware/cyfmac54591-pcie.clm_blob \
+               $(1)/lib/firmware/cypress/
+       $(INSTALL_DIR) $(1)/lib/firmware/brcm
+       $(LN) \
+               ../cypress/cyfmac54591-pcie.bin \
+               $(1)/lib/firmware/brcm/brcmfmac54591-pcie.bin
+       $(LN) \
+               ../cypress/cyfmac54591-pcie.clm_blob \
                $(1)/lib/firmware/brcm/brcmfmac54591-pcie.clm_blob
 endef