From patchwork Tue Oct 27 11:02:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Fertser X-Patchwork-Id: 1388438 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=QQVEL7pq; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=JbUaVz5B; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CL83y6z93z9sTf for ; Tue, 27 Oct 2020 22:04:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=T5VxdakYFH3Xe/jGlDoNdSsUOkYbyJf8Xl/4jPDmgKg=; b=QQVEL7pq8Jx/zi2RwbG+TO591 81BvfKoSYuAJqh3IUhrnAS7ID3dmB+Mneen5YZRC274AhzbFZA5WXteTkT7GHP1LRd16/hHEYiL6G O3Io3vhLTRnua5h4w6ZYCLCkqJWUlEAwpLSZCqfQeV9n0cjd8cTmxkLWPYYYp/DxvYgnPn/S82H2w 23rn1BHmLDfnjnl68gs0qc/GntYZs5gdID/l1s4ZuZsSPAwHntJv8bBRr4Bx1s8CxczVF2bkmhaSQ U6TpMrf9GR5j5GsFgcYQZJlqK/O1JmC7jOeNuJvPr3+rmag0k6emTXoCRy1JBitMudVUkXM+Ys6Vl 2FY8y4x2A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXMl1-0006L0-Fd; Tue, 27 Oct 2020 11:03:15 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXMky-0006KN-EU for openwrt-devel@lists.openwrt.org; Tue, 27 Oct 2020 11:03:13 +0000 Received: by mail-lj1-x231.google.com with SMTP id m20so1249337ljj.5 for ; Tue, 27 Oct 2020 04:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tQy7VAgoDHs2ZLlxJp5TdMghIFHtf8WF5ZdzalMGlqU=; b=JbUaVz5BVBiz2HLXb6KO+EUbD1Zn+vufBbAeM8iyhUeNl2Bla1K49hjTN8MlsvAafs YXpqA/LBnePcEAmqCiIdrACJy69bkcj6Ma+JwXyMMemR47kz+QCT6I2dI9Eqs6ICxsD0 oDi0RCdzaaxtFGqceSghr8RUpg+DfT0JerP21IKffgY0Bl05gsC5bb9mdfujuusMpkIh thNKSke5F3qZRNFZ1M2tZofz8KKkf7kwyhFWOdjUsxhChWbvw4G9yDM30mMCH0rIVE/+ hBZCwkjlZe4+nWSiPJ7N0KM3joQ6CGsX1FYgG335wwOJsaFhk7zTg5vezoC4l/q7Drcd 8x1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tQy7VAgoDHs2ZLlxJp5TdMghIFHtf8WF5ZdzalMGlqU=; b=C/4PoG5VR+O0/G8IonUP9YIvt+MrpE5Xztxr2rRVLOzELj7UI9//J4qjBTS/3LfOVO ACTSt2aYxKMufdZgkUxeN41+TpJlb6sMf+FheTugRe54wYl0fuZAIMvwH1zRSfbUe+Oh WOdFc0x0RDtedvb4Zz4bQQW/HEA1iUx7mRzxEcfaQbrYYuksPNMaCMo6ZP2uy52G9k0d e9Jarzt806LRuDr3XcgXr1uOcFedqkqnTttGZL3R02LS8EUkZz2Ub6mMfcchoxgvI8vP YfEdlnswd6bRGgWOZDdq8NYs/sNZj/beyKzpm9CB9+jGNCj+4DknIez8xZPze3USQ97R +5DQ== X-Gm-Message-State: AOAM533f0xPTKyq1zjjuM3dWcTNRK3Rqvr6GEGKC5RxglLNemGvY03cm 6KhUfTo/jRDElln0WbPKSl68s/dxH0Q= X-Google-Smtp-Source: ABdhPJyISxystz1SRD3JPYhfKcjdN4GFx6Fu6nu0qUN4JdBNLp9RFc8mfWXaEBkzg0yZQWK5fT5Rog== X-Received: by 2002:a05:651c:1304:: with SMTP id u4mr771749lja.197.1603796590710; Tue, 27 Oct 2020 04:03:10 -0700 (PDT) Received: from home.paul.comp (paulfertser.info. [2001:470:26:54b:226:9eff:fe70:80c2]) by smtp.gmail.com with ESMTPSA id i185sm141576lfi.230.2020.10.27.04.03.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 04:03:10 -0700 (PDT) Received: from home.paul.comp (home.paul.comp [IPv6:0:0:0:0:0:0:0:1]) by home.paul.comp (8.15.2/8.15.2/Debian-14~deb10u1) with ESMTP id 09RB35Fd007921; Tue, 27 Oct 2020 14:03:06 +0300 Received: (from paul@localhost) by home.paul.comp (8.15.2/8.15.2/Submit) id 09RB35AX007920; Tue, 27 Oct 2020 14:03:05 +0300 From: Paul Fertser To: openwrt-devel@lists.openwrt.org, Adrian Schmutzler Subject: [PATCH v2] ath79: fix ath10k caldata extraction on some D-Link DIR-842 C3 devices Date: Tue, 27 Oct 2020 14:02:53 +0300 Message-Id: <20201027110253.7880-1-fercerpav@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <006f01d6ac4e$9d1c9150$d755b3f0$@adrianschmutzler.de> References: <006f01d6ac4e$9d1c9150$d755b3f0$@adrianschmutzler.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_070312_523654_AB62A89C X-CRM114-Status: GOOD ( 14.22 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:231 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [fercerpav[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Fertser Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org According to forum threads [0][1] and a report on IRC by Doc-Saintly some of those boards have calibration data in a different place. Only one alternative location is known. Without proper board calibration data (board.bin having all 0xff bytes) ath10k firmware still tries to load but crashes on startup with a confusing error message. If you're applying this patch manually on your device do not forget to remove /lib/firmware/ath10k/pre-cal-pci-0000:00:00.0.bin and reboot to force caldata re-extraction. [0] https://forum.openwrt.org/t/support-for-d-link-dir842-rev-c3/41654 [1] https://forum.openwrt.org/t/d-link-dir-842-cant-access-firmware-upload-form/65454 Signed-off-by: Paul Fertser --- Changes in v2: - Separate out nec,wg1200cr section as those boards do not even have a "reserved" partition (Adrian Schmutzler) .../base-files/etc/hotplug.d/firmware/11-ath10k-caldata | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 25e864ba72..ca994a4e52 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -167,13 +167,18 @@ case "$FIRMWARE" in ;; dlink,dir-842-c1|\ dlink,dir-842-c2|\ - dlink,dir-842-c3|\ - nec,wg1200cr) + dlink,dir-842-c3) caldata_extract "art" 0x5000 0x2f20 + caldata_valid "202f" || caldata_extract "reserved" 0x15000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac) ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ /lib/firmware/ath10k/QCA9888/hw2.0/board.bin ;; + nec,wg1200cr) + caldata_extract "art" 0x5000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac) + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin netgear,ex6400|\ netgear,ex7300) caldata_extract "caldata" 0x5000 0x2f20