Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp762603ybt; Fri, 26 Jun 2020 10:56:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydv1Jx1jwQGREP2beDQhGJEmT0W58Tsru+0iKf3To3a5HNoKQhhQdi3uZYfA9DudeeI0gn X-Received: by 2002:a17:906:12cd:: with SMTP id l13mr3757427ejb.96.1593194216272; Fri, 26 Jun 2020 10:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593194216; cv=none; d=google.com; s=arc-20160816; b=oV+KgP1xEmaEm7GJxrSSkioz1iM+u9CnXwUM7+YzNOvXYkASdDsMcvWPLSJqJfZfIV miv4EdxHY/UJUl8c1W9fDJ0lqaP1byOLyU8NLY/Zqz1q+waDISNZgWxpl1du2H/kaUiL 58P5lMh1mD6dcHC8jXSbYvIuAyFZYyC6hYq2FROvVlBdil4EPvkWgSrXr0/xSKgiNRMw UD5cC8mWXnLc5Qp1nYYq0gjGi/trCaLNRUmsXts6KuLabDmEttAEfO/fJ9+p+j3mWI/V x5rDvVivoC9Zq2b6tdpfopkvBRgIeK1P8O8torU0s1FM8gzrg5lLZFUThJpra4wl+Ekq guQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=jiBAsP4+mjNaT5K06nOD0lhdILQ4RvbRf1YSAwcjLw4=; b=Fzd4BOVgLiUr/UQSvxFEDChLWy/EXD/P9PayarUuU2kqEZAniF0ymmIDZNGCj+Awrc YP9BnxbSToHcFjiczID3QKECc/JEATS2udXSiBPu0u4JLDMPE1J9MdNWf3LcsZEtBDJq zVe1lYYFCA1g9LytitOl+xFxK3MUy6yezqx/Hr3JQcGYZ67pOUxiRKJhLFuE68qmbXDP ehyh06tq1pY8MnhaD34hnYtRxq12L5IUlKoBaQivvcE7LK5Y9K9PGx04TMtyFJjGo5Ht GGWChjS2RcKurFL4Yr0dea+hfAAgL/NSi21StPuRjhWTEp8fyHfHEhV3Giv9BS0DOehd O3Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=ngIJ68Co; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du6si21541732ejc.189.2020.06.26.10.56.32; Fri, 26 Jun 2020 10:56:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=ngIJ68Co; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726824AbgFZRxV (ORCPT + 99 others); Fri, 26 Jun 2020 13:53:21 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:51043 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbgFZRxV (ORCPT ); Fri, 26 Jun 2020 13:53:21 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1593194000; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=jiBAsP4+mjNaT5K06nOD0lhdILQ4RvbRf1YSAwcjLw4=; b=ngIJ68CoRJ0Ni+uBDBwkYrsbCxZGY7Sd3FMvllnvvho3VTzLB+qP9ohkynlLb34sEQwVLXnY zmRJMZoFgJbNhu/epom3yR0h/x6eLMIrINz1RBpqHSV1MQWeM1Jm1IzwkEYfSl3G/fT4/P6O CFCT/ZvB6g0Af+LWtIauTMXT3oA= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-east-1.postgun.com with SMTP id 5ef6360d86de6ccd44c0cb13 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 26 Jun 2020 17:53:17 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 410ACC43395; Fri, 26 Jun 2020 17:53:16 +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 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from pillair-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: pillair) by smtp.codeaurora.org (Postfix) with ESMTPSA id 15602C433CB; Fri, 26 Jun 2020 17:53:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 15602C433CB 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=pillair@codeaurora.org From: Rakesh Pillai To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Rakesh Pillai Subject: [PATCH] ath10k: Use bdf calibration variant for snoc targets Date: Fri, 26 Jun 2020 23:23:10 +0530 Message-Id: <1593193990-30366-1-git-send-email-pillair@codeaurora.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Board Data File (BDF) is loaded upon driver boot-up procedure. The right board data file is identified using bus and qmi-board-id. The problem, however, can occur when the (default) board data file cannot fulfill with the vendor requirements and it is necessary to use a different board data file. Add the support to get the variant field from DTSI and use tht information to load the vendor specific BDF. The device tree requires addition strings to define the variant name wifi@a000000 { status = "okay"; qcom,ath10k-calibration-variant = "xyz-v2"; }; wifi@a800000 { status = "okay"; qcom,ath10k-calibration-variant = "xyz-v1"; }; This would create the boarddata identifiers for the board-2.bin search * bus=snoc,qmi-board-id=16,qmi-chip-id=0,variant=xyz-v1 * bus=snoc,qmi-board-id=17,qmi-chip-id=0,variant=xyz-v2 Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1 Signed-off-by: Rakesh Pillai --- drivers/net/wireless/ath/ath10k/core.c | 18 +++++++++++++----- drivers/net/wireless/ath/ath10k/core.h | 2 ++ drivers/net/wireless/ath/ath10k/qmi.c | 8 ++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 22b6937..bd60913 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -1024,7 +1024,7 @@ static int ath10k_core_check_smbios(struct ath10k *ar) return 0; } -static int ath10k_core_check_dt(struct ath10k *ar) +int ath10k_core_check_dt(struct ath10k *ar) { struct device_node *node; const char *variant = NULL; @@ -1045,6 +1045,7 @@ static int ath10k_core_check_dt(struct ath10k *ar) return 0; } +EXPORT_SYMBOL(ath10k_core_check_dt); static int ath10k_download_fw(struct ath10k *ar) { @@ -1439,10 +1440,17 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name, } if (ar->id.qmi_ids_valid) { - scnprintf(name, name_len, - "bus=%s,qmi-board-id=%x", - ath10k_bus_str(ar->hif.bus), - ar->id.qmi_board_id); + if (with_variant && ar->id.bdf_ext[0] != '\0') + scnprintf(name, name_len, + "bus=%s,qmi-board-id=%x,qmi-chip-id=%x%s", + ath10k_bus_str(ar->hif.bus), + ar->id.qmi_board_id, ar->id.qmi_chip_id, + variant); + else + scnprintf(name, name_len, + "bus=%s,qmi-board-id=%x", + ath10k_bus_str(ar->hif.bus), + ar->id.qmi_board_id); goto out; } diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 5c18f6c..62b1502 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -1056,6 +1056,7 @@ struct ath10k { bool bmi_ids_valid; bool qmi_ids_valid; u32 qmi_board_id; + u32 qmi_chip_id; u8 bmi_board_id; u8 bmi_eboard_id; u8 bmi_chip_id; @@ -1295,6 +1296,7 @@ int ath10k_core_register(struct ath10k *ar, const struct ath10k_bus_params *bus_params); void ath10k_core_unregister(struct ath10k *ar); int ath10k_core_fetch_board_file(struct ath10k *ar, int bd_ie_type); +int ath10k_core_check_dt(struct ath10k *ar); void ath10k_core_free_board_files(struct ath10k *ar); #endif /* _CORE_H_ */ diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c index 5468a41..ae6b1f4 100644 --- a/drivers/net/wireless/ath/ath10k/qmi.c +++ b/drivers/net/wireless/ath/ath10k/qmi.c @@ -576,6 +576,8 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) if (resp->chip_info_valid) { qmi->chip_info.chip_id = resp->chip_info.chip_id; qmi->chip_info.chip_family = resp->chip_info.chip_family; + } else { + qmi->chip_info.chip_id = 0xFF; } if (resp->board_info_valid) @@ -817,12 +819,18 @@ static void ath10k_qmi_event_server_arrive(struct ath10k_qmi *qmi) static int ath10k_qmi_fetch_board_file(struct ath10k_qmi *qmi) { struct ath10k *ar = qmi->ar; + int ret; ar->hif.bus = ATH10K_BUS_SNOC; ar->id.qmi_ids_valid = true; ar->id.qmi_board_id = qmi->board_info.board_id; + ar->id.qmi_chip_id = qmi->chip_info.chip_id; ar->hw_params.fw.dir = WCN3990_HW_1_0_FW_DIR; + ret = ath10k_core_check_dt(ar); + if (ret) + ath10k_dbg(ar, ATH10K_DBG_QMI, "DT bdf variant name not set.\n"); + return ath10k_core_fetch_board_file(qmi->ar, ATH10K_BD_IE_BOARD); } -- 2.7.4