From 1550f581816b2165de217bd46c2d66c258061742 Mon Sep 17 00:00:00 2001
From: Jerome Forissier <jerome.forissier@linaro.org>
Date: Thu, 6 Jul 2017 18:51:30 +0200
Subject: [PATCH] hikey_debian: update Wi-Fi firmware

The kernel branch we are using for OP-TEE needs a new Wi-Fi firmware,
so extend the system-img recipe to download it also.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Victor Chong <victor.chong@linaro.org>
---
 docs/hikey.md   | 2 +-
 hikey_debian.mk | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/docs/hikey.md b/docs/hikey.md
index f22700d..f32cdd4 100644
--- a/docs/hikey.md
+++ b/docs/hikey.md
@@ -105,7 +105,7 @@ When the files has been transfered, please follow the commands from the `make
 send` command which will install the debian packages on the device. Typically it
 tells you to run something like this on the device itself:
 ```bash
-$ dpkg --force-all -i /tmp/out/optee_2.0-1.deb
+$ dpkg --force-all -i /tmp/out/*.deb
 $ dpkg --force-all -i /tmp/linux-image-*.deb
 ```
 ## 5.2 Good to know
diff --git a/hikey_debian.mk b/hikey_debian.mk
index 6d77b72..c91d790 100644
--- a/hikey_debian.mk
+++ b/hikey_debian.mk
@@ -23,6 +23,7 @@ IP ?= 127.0.0.1
 # URL to images
 SYSTEM_IMG_URL=https://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/hikey-rootfs-debian-jessie-alip-20160629-120.emmc.img.gz
 NVME_IMG_URL=https://builds.96boards.org/releases/hikey/linaro/binaries/latest/nvme.img
+WIFI_FW_URL=http://http.us.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-ti-connectivity_20161130-3_all.deb
 
 ################################################################################
 # Disallow use of UART0 for Debian Linux console
@@ -72,6 +73,7 @@ MCUIMAGE_BIN			?= $(OPENPLATPKG_PATH)/Platforms/Hisilicon/HiKey/Binary/mcuimage.
 BOOT_IMG			?= $(OUT_PATH)/boot-fat.uefi.img
 NVME_IMG			?= $(OUT_PATH)/nvme.img
 SYSTEM_IMG			?= $(OUT_PATH)/debian_system.img
+WIFI_FW				?= $(OUT_PATH)/firmware-ti-connectivity_20161130-3_all.deb
 GRUB_PATH			?= $(ROOT)/grub
 GRUB_CONFIGFILE			?= $(OUT_PATH)/grub.configfile
 LLOADER_PATH			?= $(ROOT)/l-loader
@@ -306,10 +308,15 @@ ifeq ("$(wildcard $(SYSTEM_IMG))","")
 	wget $(SYSTEM_IMG_URL) -O $(SYSTEM_IMG).gz
 	gunzip $(SYSTEM_IMG).gz
 endif
+ifeq ("$(wildcard $(WIFI_FW))","")
+	@echo "Downloading Wi-Fi firmware package ..."
+	wget $(WIFI_FW_URL) -O $(WIFI_FW)
+endif
 
 .PHONY: system-cleaner
 system-img-cleaner:
 	rm -f $(SYSTEM_IMG)
+	rm -f $(WIFI_FW)
 
 ################################################################################
 # l-loader
@@ -382,7 +389,7 @@ send:
 	@tar czf - $(shell cd $(OUT_PATH) && echo $(OUT_PATH)/*.deb && echo $(ROOT)/linux-image-*.deb) | ssh linaro@$(IP) "cd /tmp; tar xvzf -"
 	@echo "Files has been sent to $$IP/tmp/ and $$IP/tmp/out"
 	@echo "On the device, run:"
-	@echo " dpkg --force-all -i /tmp/out/optee_$(OPTEE_PKG_VERSION).deb"
+	@echo " dpkg --force-all -i /tmp/out/*.deb"
 	@echo " dpkg --force-all -i /tmp/linux-image-*.deb"
 
 ################################################################################
-- 
GitLab