[openwrt/openwrt] mwlwifi: add and use individual firmware packages

LEDE Commits lede-commits at lists.infradead.org
Mon Feb 26 03:03:38 PST 2018


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/c8e62f830df71d2de9e620643bcd2c098fd92153

commit c8e62f830df71d2de9e620643bcd2c098fd92153
Author: Johnny S. Lee <_ at jsl.io>
AuthorDate: Wed Jan 31 01:19:51 2018 +0800

    mwlwifi: add and use individual firmware packages
    
    As each mvebu device only uses one of the firmwares provided by mwlwifi
    package, it makes sense to put them in separate packages and only install
    the one that is needed.
    
    Current mwlwifi version's firmware sizes and usages by devices:
    88W8864.bin  118776  caiman, mamba, cobra, shelby
    88W8897.bin  489932  (none)
    88W8964.bin  449420  rango
    
    Changes by this commit:
     * indicate in title that mwlwifi also is driver for 88W8897 and 88W8964
     * remove mwlwifi package's firmware installation rules
     * add 3 new individual firmware packages (all depends on kmod-mwlwifi):
        - mwlwifi-firmware-88w8864
        - mwlwifi-firmware-88w8897
        - mwlwifi-firmware-88w8964
     * add firmware package to mvebu devices' DEVICE_PACKAGES accordingly
    
    Signed-off-by: Johnny S. Lee <_ at jsl.io>
    [Add the used FW files to the PACKAGES of default image]
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/mwlwifi/Makefile            | 44 ++++++++++++++++++++++++++----
 target/linux/mvebu/image/Makefile          |  6 +++-
 target/linux/mvebu/profiles/000-Default.mk |  3 +-
 3 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile
index 5c3e86f..9e32f3e 100644
--- a/package/kernel/mwlwifi/Makefile
+++ b/package/kernel/mwlwifi/Makefile
@@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/package.mk
 
 define KernelPackage/mwlwifi
   SUBMENU:=Wireless Drivers
-  TITLE:=Marvell 88W8864 wireless driver
+  TITLE:=Marvell 88W8864/88W8897/88W8964 wireless driver
   DEPENDS:=+kmod-mac80211 + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT + at DRIVER_11W_SUPPORT @PCI_SUPPORT @TARGET_mvebu
   FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko
   AUTOLOAD:=$(call AutoLoad,50,mwlwifi)
@@ -49,13 +49,45 @@ define Build/Compile
 		modules
 endef
 
-define KernelPackage/mwlwifi/install
+define Package/mwlwifi-firmware-default
+  SECTION:=firmware
+  CATEGORY:=Firmware
+  TITLE:=Marvell $(1) firmware
+  DEPENDS:=+kmod-mwlwifi @TARGET_mvebu
+endef
+
+define Package/mwlwifi-firmware/install
 	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DIR) $(1)/lib/firmware/mwlwifi
-	$(CP) $(PKG_BUILD_DIR)/bin/firmware/88W8864.bin $(1)/lib/firmware/mwlwifi/
-	$(CP) $(PKG_BUILD_DIR)/bin/firmware/88W8897.bin $(1)/lib/firmware/mwlwifi/
-	$(CP) $(PKG_BUILD_DIR)/bin/firmware/88W8964.bin $(1)/lib/firmware/mwlwifi/
-	$(CP) $(PKG_BUILD_DIR)/bin/firmware/Marvell_license.txt $(1)/lib/firmware/mwlwifi/
+	$(CP) $(PKG_BUILD_DIR)/bin/firmware/$(2) $(1)/lib/firmware/mwlwifi/
+	$(CP) $(PKG_BUILD_DIR)/bin/firmware/Marvell_license.txt $(1)/lib/firmware/mwlwifi/$(2).Marvell_license.txt
+endef
+
+define Package/mwlwifi-firmware-88w8864
+$(call Package/mwlwifi-firmware-default,88W8864)
+endef
+
+define Package/mwlwifi-firmware-88w8864/install
+	$(call Package/mwlwifi-firmware/install,$(1),88W8864.bin)
+endef
+
+define Package/mwlwifi-firmware-88w8897
+$(call Package/mwlwifi-firmware-default,88W8897)
+endef
+
+define Package/mwlwifi-firmware-88w8897/install
+	$(call Package/mwlwifi-firmware/install,$(1),88W8897.bin)
+endef
+
+define Package/mwlwifi-firmware-88w8964
+$(call Package/mwlwifi-firmware-default,88W8964)
+endef
+
+define Package/mwlwifi-firmware-88w8964/install
+	$(call Package/mwlwifi-firmware/install,$(1),88W8964.bin)
 endef
 
 $(eval $(call KernelPackage,mwlwifi))
+$(eval $(call BuildPackage,mwlwifi-firmware-88w8864))
+$(eval $(call BuildPackage,mwlwifi-firmware-88w8897))
+$(eval $(call BuildPackage,mwlwifi-firmware-88w8964))
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 812d946..53ce028 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -105,6 +105,7 @@ define Device/linksys-wrt1200ac
   $(call Device/linksys,WRT1200AC (Caiman))
   $(Device/armada-385-linksys)
   DEVICE_DTS := armada-385-linksys-caiman
+  DEVICE_PACKAGES += mwlwifi-firmware-88w8864
 endef
 TARGET_DEVICES += linksys-wrt1200ac
 
@@ -112,6 +113,7 @@ define Device/linksys-wrt1900acv2
   $(call Device/linksys,WRT1900ACv2 (Cobra))
   $(Device/armada-385-linksys)
   DEVICE_DTS := armada-385-linksys-cobra
+  DEVICE_PACKAGES += mwlwifi-firmware-88w8864
 endef
 TARGET_DEVICES += linksys-wrt1900acv2
 
@@ -119,7 +121,7 @@ define Device/linksys-wrt3200acm
   $(call Device/linksys,WRT3200ACM (Rango))
   $(Device/armada-385-linksys)
   DEVICE_DTS := armada-385-linksys-rango
-  DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio
+  DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964
 endef
 TARGET_DEVICES += linksys-wrt3200acm
 
@@ -127,12 +129,14 @@ define Device/linksys-wrt1900acs
   $(call Device/linksys,WRT1900ACS (Shelby))
   $(Device/armada-385-linksys)
   DEVICE_DTS := armada-385-linksys-shelby
+  DEVICE_PACKAGES += mwlwifi-firmware-88w8864
 endef
 TARGET_DEVICES += linksys-wrt1900acs
 
 define Device/linksys-wrt1900ac
   $(call Device/linksys,WRT1900AC (Mamba))
   DEVICE_DTS := armada-xp-linksys-mamba
+  DEVICE_PACKAGES += mwlwifi-firmware-88w8864
   $(Device/NAND-128K)
   $(Device/UBI-factory)
   KERNEL_SIZE := 3072k
diff --git a/target/linux/mvebu/profiles/000-Default.mk b/target/linux/mvebu/profiles/000-Default.mk
index 114f758..4b5dbe1 100644
--- a/target/linux/mvebu/profiles/000-Default.mk
+++ b/target/linux/mvebu/profiles/000-Default.mk
@@ -7,7 +7,8 @@
 
 define Profile/Default
 	NAME:=Default Profile (all drivers)
-	PACKAGES:= kmod-mwlwifi wpad-mini swconfig mkf2fs e2fsprogs
+	PACKAGES:= kmod-mwlwifi wpad-mini swconfig mkf2fs e2fsprogs \
+		   mwlwifi-firmware-88w8864 mwlwifi-firmware-88w8964
 endef
 
 define Profile/Default/Description



More information about the lede-commits mailing list