From patchwork Tue Jun 9 13:32:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anilkumar Kolli X-Patchwork-Id: 11595665 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3102C1667 for ; Tue, 9 Jun 2020 13:33:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0CE1A2074B for ; Tue, 9 Jun 2020 13:33:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="F1lagKgV"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="YwFyVPhH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CE1A2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=txyETg4TSrSw+LADSw5JADRTSl/JYrJRW0HRGHDfSGw=; b=F1lagKgVcQ+DfskARUTEOqL47U U/m3YA5E4QrN0OdMcpjeLHRVB9UIMj0ESwp7R0U7to9OLbHlvYP2nMQcQMPlJpAIkDteF1G96m0Al 4dznfgJPYdlW1vZPvoD40PTgyPkM9NZmZxm3LneoJORVH0a5blavVN/GdPMCvr8QoEl4RbC0XrlOK wVhthntPSX9q9BA4wq7ySpwL3RanzKySJmDOHfguwzaf0a2JoTeNE35SdI7OGey2Qr2VAIN5/MTwk yFSnrpqp7OE6jlb/3rXIuKNc7MBD+ID+q5Pe74ARuVqI7UJxauVG3+M+S11oY75+EIp3iZ+Imz6Ex H7jTV5bA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jieNy-0000cq-Jo; Tue, 09 Jun 2020 13:33:50 +0000 Received: from mail27.static.mailgun.info ([104.130.122.27]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jieNn-0000Ue-Oz for ath11k@lists.infradead.org; Tue, 09 Jun 2020 13:33:48 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1591709627; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=bi0kcoFCDpSOwpX8akilhJLHWYc+3OJnwXkPt4qNrrM=; b=YwFyVPhHHuUrBm/qvCcHE+FSwZa51H5za8HXQ/TDGUoKhLfUSiZVcRjHA98p2hpG++NcaF37 xWZidLF5BDtf3zbXc+9VwdCFlrAjdcQk8zQI2aBfrCWlimtcNDIFDDMe7X5qnUCY9S7+5Byg a4Sjwamw/Rp0SGxQ8U4YcpvH0p0= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyJmOGQ2ZiIsICJhdGgxMWtAbGlzdHMuaW5mcmFkZWFkLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 5edf8fa9ad153efa34c70919 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 09 Jun 2020 13:33:29 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C2CACC433CB; Tue, 9 Jun 2020 13:33:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from vnaralas-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akolli) by smtp.codeaurora.org (Postfix) with ESMTPSA id A887EC43395; Tue, 9 Jun 2020 13:33:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A887EC43395 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=akolli@codeaurora.org From: Anilkumar Kolli To: ath11k@lists.infradead.org Subject: [PATCH v2 4/8] ath11k: add IPQ6018 support Date: Tue, 9 Jun 2020 19:02:57 +0530 Message-Id: <1591709581-18039-5-git-send-email-akolli@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591709581-18039-1-git-send-email-akolli@codeaurora.org> References: <1591709581-18039-1-git-send-email-akolli@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200609_063347_401847_ACE4D4AA X-CRM114-Status: GOOD ( 14.80 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [104.130.122.27 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [104.130.122.27 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 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 X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org IPQ6018 has one 5G and one 2G radio with 2x2, shares ipq8074 configurations. Signed-off-by: Anilkumar Kolli --- drivers/net/wireless/ath/ath11k/ahb.c | 3 ++ drivers/net/wireless/ath/ath11k/core.c | 55 +++++++++++++++++++++++++++++----- drivers/net/wireless/ath/ath11k/core.h | 1 + drivers/net/wireless/ath/ath11k/hw.h | 6 ++++ 4 files changed, 58 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c index 30092841ac46..dca014ea7ddf 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -20,6 +20,9 @@ static const struct of_device_id ath11k_ahb_of_match[] = { { .compatible = "qcom,ipq8074-wifi", .data = (void *)ATH11K_HW_IPQ8074, }, + { .compatible = "qcom,ipq6018-wifi", + .data = (void *)ATH11K_HW_IPQ6018, + }, { } }; diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c index 02501cc154fe..abe9edb56309 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -17,12 +17,24 @@ unsigned int ath11k_debug_mask; module_param_named(debug_mask, ath11k_debug_mask, uint, 0644); MODULE_PARM_DESC(debug_mask, "Debugging mask"); -static const struct ath11k_hw_params ath11k_hw_params = { - .name = "ipq8074", - .fw = { - .dir = IPQ8074_FW_DIR, - .board_size = IPQ8074_MAX_BOARD_DATA_SZ, - .cal_size = IPQ8074_MAX_CAL_DATA_SZ, +static const struct ath11k_hw_params ath11k_hw_params_list[] = { + { + .dev_id = ATH11K_HW_IPQ8074, + .name = "ipq8074", + .fw = { + .dir = IPQ8074_FW_DIR, + .board_size = IPQ8074_MAX_BOARD_DATA_SZ, + .cal_size = IPQ8074_MAX_CAL_DATA_SZ, + }, + }, + { + .dev_id = ATH11K_HW_IPQ6018, + .name = "ipq6018", + .fw = { + .dir = IPQ6018_FW_DIR, + .board_size = IPQ6018_MAX_BOARD_DATA_SZ, + .cal_size = IPQ6018_MAX_CAL_DATA_SZ, + }, }, }; @@ -707,6 +719,30 @@ static void ath11k_core_restart(struct work_struct *work) complete(&ab->driver_recovery); } +static int ath11k_init_hw_params(struct ath11k_base *ab) +{ + const struct ath11k_hw_params *hw_params = NULL; + int i; + + for (i = 0; i < ARRAY_SIZE(ath11k_hw_params_list); i++) { + hw_params = &ath11k_hw_params_list[i]; + + if (hw_params->dev_id == ab->hw_rev) + break; + } + + if (i == ARRAY_SIZE(ath11k_hw_params_list)) { + ath11k_err(ab, "Unsupported hardware version: 0x%x\n", ab->hw_rev); + return -EINVAL; + } + + ab->hw_params = *hw_params; + + ath11k_dbg(ab, ATH11K_DBG_BOOT, "Hardware name %s\n", ab->hw_params.name); + + return 0; +} + int ath11k_core_init(struct ath11k_base *ab) { struct device *dev = ab->dev; @@ -725,7 +761,12 @@ int ath11k_core_init(struct ath11k_base *ab) return -EINVAL; } ab->tgt_rproc = prproc; - ab->hw_params = ath11k_hw_params; + + ret = ath11k_init_hw_params(ab); + if (ret) { + ath11k_err(ab, "failed to get hw params %d\n", ret); + return ret; + } ret = ath11k_core_soc_create(ab); if (ret) { diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index e04f0e711779..ecf327537ad3 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -88,6 +88,7 @@ struct ath11k_skb_rxcb { enum ath11k_hw_rev { ATH11K_HW_IPQ8074, + ATH11K_HW_IPQ6018, }; enum ath11k_firmware_mode { diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h index f7f070af233c..e66f0e0138c4 100644 --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h @@ -73,6 +73,11 @@ #define IPQ8074_MAX_BOARD_DATA_SZ (256 * 1024) #define IPQ8074_MAX_CAL_DATA_SZ IPQ8074_MAX_BOARD_DATA_SZ +/* IPQ6018 definitions */ +#define IPQ6018_FW_DIR ATH11K_FW_DIR "/IPQ6018/hw1.0" +#define IPQ6018_MAX_BOARD_DATA_SZ (256 * 1024) +#define IPQ6018_MAX_CAL_DATA_SZ IPQ6018_MAX_BOARD_DATA_SZ + #define ATH11K_BOARD_MAGIC "QCA-ATH11K-BOARD" #define ATH11K_BOARD_API2_FILE "board-2.bin" #define ATH11K_DEFAULT_BOARD_FILE "board.bin" @@ -106,6 +111,7 @@ enum ath11k_bus { struct ath11k_hw_params { const char *name; + u16 dev_id; struct { const char *dir; size_t board_size;