From patchwork Tue Aug 24 17:12:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 501806 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp3329492jab; Tue, 24 Aug 2021 10:11:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR8OYKzMDrtKv9izRMJFKz1xRGnMHS8WxCdJyurAh+lHq6d2RzRFKiTA7e5MI/XrJ0VFsx X-Received: by 2002:a17:90a:b303:: with SMTP id d3mr5537479pjr.199.1629825083203; Tue, 24 Aug 2021 10:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629825083; cv=none; d=google.com; s=arc-20160816; b=c0B+JowmXiE+LYUyc8kQVTItPAdnA5yQ2YgZcbTlPnfIM8+scmwlcl4M2T15IHCtUn ZwHYeyzF8r9KVTo+h3R0j3bJjU2jHPzIQ3NRKYQgYjxyqAz8Wd1fDiZ0dEbi40QleD5f BkM7726Ez0NlRPNWw3VYSGr46ZpVgOMdJeqJJLOEWJ2K+jz0hedP70BLQTz7/4t/BW5s iydEVMvMjNY4SVkqJywmN/a0KTM3zY33q4RnZ9Fi2HF7wDpGJ2tCXX6AAFoy0Ao7Mc0E sPzM6LaZJ3PHU5IHol+ya8mXnX6utRYMrxj72DyVVB32XlTlaAVdA5Dfg/cNcAgpG5nG 56pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-signature; bh=+YOh5y1kH3VYB8xn/5jR5hibwRpt8W4IrSyTo4lYvRs=; b=boSdVPoyTdCPsjFrQznB9xJ7dHAo9yC0iFBvwu+l1gB//I+YJTmX0Q+6LkuEd2+L4f 3omTgBSgTMMGZMrhC2dkWxtVqjfVPwhHDqoKB+y5Q1wOflKQfsak7L7JFRNP1NqHK2AF QKfTTtfp3YtYjaud527WIM+DRv5mUBiGnK+iIcp7UvtBEwaU9NZAb9MOdjt3fcTid6eK ClXgkUlF5Zg0B2JJdnwkbYOORRoH73M+6EsT6M++28Mqn76GYtullRQjgk7CIAwlucY4 7RLg+ABPkEmPRYyYsPC3LIIMIg7OgJi6PGzfwp4HWMOkTGwdNReDguwtB8ThZc/w8pne B8lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=WoXI9EEL; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=AOzGiPFS; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id t200si12024838pgb.115.2021.08.24.10.11.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Aug 2021 10:11:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=WoXI9EEL; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=AOzGiPFS; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+YOh5y1kH3VYB8xn/5jR5hibwRpt8W4IrSyTo4lYvRs=; b=WoXI9EELZiibn9 4nnY9gWk7rpCJ33MfRsoWb+V25rEUkmLykX2gUPe4LWIXacZnwXrxyY4VkC2SWmdyIE21A+W9V0Km 9fQq0lU84yZ7wgo3mGy+Kl5lUn3LGwWy37Alr83xQR66Fuza12VukSPaV2EMgrQUxi71BF7TMqpC7 fab5CXMRVAyfdl/stmKg8K3V5TxdcNO24mYKSa+7l7dyzbKHJc0/86nD5HhEDAZdX5HK+JDRLAHa/ I1zcb3FLvTIGOjXjl2bQug5p1dHWLB8fEg6GFM1nHGOalGl3vEtwGYb54KVHrA3vrsmFVozUGydck PihpwCHOjvsfD6OBGzOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIZxI-0046gT-9e; Tue, 24 Aug 2021 17:11:20 +0000 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIZxC-0046eP-OV for wcn36xx@lists.infradead.org; Tue, 24 Aug 2021 17:11:18 +0000 Received: by mail-ot1-x32d.google.com with SMTP id v33-20020a0568300921b0290517cd06302dso47941044ott.13 for ; Tue, 24 Aug 2021 10:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WvhpETrEpcbNS5tm6bQ3pCjBYg+a71Wh95ngB5PZYBE=; b=AOzGiPFS13S44pAap29oALDR+4evL+IZW+yZrvzYI0T1p/5RbsaugSmkNhL2jrtoJU +Hj1lt5hKsOlTgEkuncuJXnTeBTHtcB7yoF3J755EAtQjIEJf3Sj92lU1wat5orlB2J+ sDUdqli6kx+wu2MU3pk63OMZdoeNIkkbGK1nqSEGXsMMz/NgH1EaWAldDktdLJqRLqZw nZWoW5pejn175qs4teV8oZlfzEgZRfdAFtGBpI0yUqvKoMoi771sHIKahEzrMf12uFGc kmFoPO7cJy3QA1zK+BtDzRd9yb4rZ1UNUd3pKiU0cUkzOak9k/kbOz+qekbAqIrxKSjs NAkQ== 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:mime-version :content-transfer-encoding; bh=WvhpETrEpcbNS5tm6bQ3pCjBYg+a71Wh95ngB5PZYBE=; b=se9oXhuNzruqZgZkZXQuLUAU8mWl/MC+xOc80ZCdBbi0TFvxzxFV/4GZRZaEzs2Aqc Nnwl2BK5eNW5XoNf81kvF6/3BZjEC8LltH3PgsW+kWGzpmwAITEEHg9P6yA4EmKkBOCv ii6IHaunpKmhmVQh6PPHvVtSIuWdHLDMJmVi8EhjAnl383YD7wx95WH5oxXwLyzJ19uN Ug+2BjA5PpTmPe2hLej8Y0biO269CnvMDwqSDU3/4w2mt7Svr3/zSdK0SXOCi1emFIBF mz9falKsSMan8JAvldF90yzpvp4edQJQ+8QaV/YjKsxIzD3Npzs4ZFFE0sPW1+V/kwvX KJ/Q== X-Gm-Message-State: AOAM531tzqOrczYXLYP3nuWH3sChyLObEQZmF5DiKChMdShUy/AHikwo vlw8+gprDO2UJx46rQoieMswnwpb9u6uXg== X-Received: by 2002:a9d:1d25:: with SMTP id m34mr32755207otm.313.1629825070322; Tue, 24 Aug 2021 10:11:10 -0700 (PDT) Received: from localhost.localdomain (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id v29sm4213475ooe.31.2021.08.24.10.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Aug 2021 10:11:09 -0700 (PDT) From: Bjorn Andersson To: Kalle Valo , "David S. Miller" , Jakub Kicinski Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stephan Gerhold , Bryan O'Donoghue , =?utf-8?b?QW7DrWJhbCBM?= =?utf-8?b?aW3Ds24=?= Subject: [RESEND PATCH] wcn36xx: Allow firmware name to be overridden by DT Date: Tue, 24 Aug 2021 10:12:25 -0700 Message-Id: <20210824171225.686683-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210824_101114_902552_010303B9 X-CRM114-Status: GOOD ( 16.91 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The WLAN NV firmware blob differs between platforms, and possibly devices, so add support in the wcn36xx driver for reading the path of this file from DT in order to allow these files to live in a gen [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:32d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org The WLAN NV firmware blob differs between platforms, and possibly devices, so add support in the wcn36xx driver for reading the path of this file from DT in order to allow these files to live in a generic file system (or linux-firmware). For some reason the parent (wcnss_ctrl) also needs to upload this blob, so rather than specifying the same information in both nodes wcn36xx reads the string from the parent's of_node. Signed-off-by: Bjorn Andersson Tested-by: Bryan O'Donoghue Tested-by: Aníbal Limón --- This was previously part of a series spanning multiple subsystems, picked up tested-bys and resending alone in hope that it can be merged. https://lore.kernel.org/linux-arm-msm/20210312003318.3273536-3-bjorn.andersson@linaro.org/ drivers/net/wireless/ath/wcn36xx/main.c | 7 +++++++ drivers/net/wireless/ath/wcn36xx/smd.c | 4 ++-- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index d202f2128df2..2ccf7a8924a0 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1500,6 +1500,13 @@ static int wcn36xx_probe(struct platform_device *pdev) goto out_wq; } + wcn->nv_file = WLAN_NV_FILE; + ret = of_property_read_string(wcn->dev->parent->of_node, "firmware-name", &wcn->nv_file); + if (ret < 0 && ret != -EINVAL) { + wcn36xx_err("failed to read \"firmware-name\" property\n"); + goto out_wq; + } + wcn->smd_channel = qcom_wcnss_open_channel(wcnss, "WLAN_CTRL", wcn36xx_smd_rsp_process, hw); if (IS_ERR(wcn->smd_channel)) { wcn36xx_err("failed to open WLAN_CTRL channel\n"); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 0e3be17d8cea..57fa857b290b 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -504,10 +504,10 @@ int wcn36xx_smd_load_nv(struct wcn36xx *wcn) u16 fm_offset = 0; if (!wcn->nv) { - ret = request_firmware(&wcn->nv, WLAN_NV_FILE, wcn->dev); + ret = request_firmware(&wcn->nv, wcn->nv_file, wcn->dev); if (ret) { wcn36xx_err("Failed to load nv file %s: %d\n", - WLAN_NV_FILE, ret); + wcn->nv_file, ret); goto out; } } diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 6121d8a5641a..a69cce883563 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -199,6 +199,7 @@ struct wcn36xx { struct device *dev; struct list_head vif_list; + const char *nv_file; const struct firmware *nv; u8 fw_revision;