From patchwork Sat Dec 13 07:19:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander 'lynxis' Couzens X-Patchwork-Id: 420749 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F279614009B for ; Sat, 13 Dec 2014 18:19:48 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 762F6284E0B; Sat, 13 Dec 2014 08:17:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id BE601280424 for ; Sat, 13 Dec 2014 08:17:30 +0100 (CET) X-policyd-weight: using cached result; rate: -7.6 Received: from mail.base45.de (mail.base45.de [80.241.61.77]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 13 Dec 2014 08:17:30 +0100 (CET) Received: from ip5b422265.dynamic.kabel-deutschland.de ([91.66.34.101] helo=lazus.lan) by mail.base45.de with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.82) (envelope-from ) id 1Xzgyx-0000De-DQ; Sat, 13 Dec 2014 08:19:15 +0100 From: Alexander Couzens To: openwrt-devel@lists.openwrt.org Date: Sat, 13 Dec 2014 08:19:11 +0100 Message-Id: <1418455151-18576-1-git-send-email-lynxis@fe80.eu> X-Mailer: git-send-email 2.1.3 Subject: [OpenWrt-Devel] [PATCH] ar71xx: add an extra check on board_name for ath10k firmware patchs X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" It moves firmware patch code behind an extra check on board_name. Otherwise it will calculate firmware checksum for unaffected boards. It also reduce boottime by a md5 calculation and removes error message on boot if firmware not found. --- .../ar71xx/base-files/lib/preinit/82_patch_ath10k | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k index c5c60ef..0455ecb 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k +++ b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k @@ -3,13 +3,13 @@ . /lib/functions/system.sh . /lib/ar71xx.sh -firmware_file="/lib/firmware/ath10k/QCA988X/hw2.0/firmware-3.bin" -firmware_md5_orig="5163aa8de591f80b06c77f22e9777473" -firmware_md5_current="$(md5sum $firmware_file)" -firmware_md5_current="${firmware_md5_current%% *}" - do_patch_ath10k_firmware() { + local firmware_file="/lib/firmware/ath10k/QCA988X/hw2.0/firmware-3.bin" + local firmware_md5_orig="5163aa8de591f80b06c77f22e9777473" + local firmware_md5_current="$(md5sum $firmware_file)" + local firmware_md5_current="${firmware_md5_current%% *}" + # verify md5sum before patching [ "firmware_md5_orig" != "firmware_md5_current" ] || { return @@ -34,4 +34,12 @@ do_patch_ath10k_firmware() { rm /tmp/ath10k-firmware.bin } -boot_hook_add preinit_main do_patch_ath10k_firmware +check_patch_ath10k_firmware() { + case $(ar71xx_board_name) in + dgl-5500-a1) + do_patch_ath10k_firmware + ;; + esac +} + +boot_hook_add preinit_main check_patch_ath10k_firmware