Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1534517pxb; Tue, 8 Feb 2022 21:24:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwc65+yTqLAF35i2EW5mAzynUf0qLgDp9n7erdRAd4F7kTEexfnnmdpEL8lRGeCVDPbflBO X-Received: by 2002:a17:902:db01:: with SMTP id m1mr539693plx.126.1644384292490; Tue, 08 Feb 2022 21:24:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644384292; cv=none; d=google.com; s=arc-20160816; b=K3SNbSOMwAMGhvBqS75uiYzcX3Gkxq1w1oi1jZIHV0R31yePY/AMljt/+RsThPfnrT B1gib81EpB/2eaOYpQmYcrT2kukGG0+eplNSLWIoXjA/B8FAhNMlj+Q+b5WHX05uPKFj vjqlVbZUnskOtN8K+Nj4tujqN03G8PLxUt79oh7/Fx0pIvWoh43VDpbA6WbC1CwgrfZR R5akXlZCEN7O5Ahj0zIKtruBbmY1lrmxV6K8AJMuohKsi3Yj1OycZGTTCXw1zour0rDF l7ZUiTt058ZjtgGjEIWkyN6VhiBRo5tg45KV7Z6tPKoajUBCsUd+slnEiQSbp8y/7hla 2p/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CVsIC3nRQpnetqgkbgk0WdGG0QucCEAw8y8k+WeSLHQ=; b=Urhz4+JjurJPv2ldnFo+VnOSwB+/bXACdzGOs+CenDjW/1AmTzvKrxEAwI40N+nRHZ vU1B9MUUSl84sKsEebIaiwU4540C/w0lvrrSdNsHk3P1nPNCypJM1oSf+txkK6pQdLqE ynKt22PLZXoO+BwfoqKDoABuUuzNFPfL/2+9a2pKVpSve0HDgX0uGxGsoLbMNKJMJiIa q05CZUUej1RzqGtXgU0cuX+U0+qnFNmSPVXJGq7qSSlB3StunZJZ1pQLb3bNPsRpgBoy lOpimwsUx6adQhp7tuv+4LIanJmvXjIlrD5d0/czeC2zOcK9/va1p16nJLswq7wkqHIO GiOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=Kblffo+a; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y71si4033393pgd.864.2022.02.08.21.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 21:24:52 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=Kblffo+a; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1C186C0302DC; Tue, 8 Feb 2022 21:24:11 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234764AbiBGJlB (ORCPT + 72 others); Mon, 7 Feb 2022 04:41:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235328AbiBGJc6 (ORCPT ); Mon, 7 Feb 2022 04:32:58 -0500 X-Greylist: delayed 122 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 07 Feb 2022 01:32:57 PST Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0EA2C043181 for ; Mon, 7 Feb 2022 01:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1644226377; x=1675762377; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=CVsIC3nRQpnetqgkbgk0WdGG0QucCEAw8y8k+WeSLHQ=; b=Kblffo+a3ZfU8PjQFZBl1mKSwGltj5DIytKFwKy8OGJZCWIVHjGms6e4 lHb7PGNlBZuQt3jdNv814+lO6CmU7o3XRdc9e6JyZfkaKEC9MorYlaDfa baE4a7t2UThBaXqylRq9pW0aPJ/pp1EAI3azMZx1MGPIh7dC0Gi5riCAz I=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 07 Feb 2022 01:30:55 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 01:30:54 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Mon, 7 Feb 2022 01:30:54 -0800 Received: from bqiang-Celadon-RN.qca.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Mon, 7 Feb 2022 01:30:53 -0800 From: Baochen Qiang To: CC: Subject: [PATCH] ath11k: Reset PCIE_GPIO_CFG_REG register when power on Date: Mon, 7 Feb 2022 17:30:23 +0800 Message-ID: <20220207093023.10605-1-quic_bqiang@quicinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On some modules, PCIE_GPIO_CFG_REG is not initialized to right value, this will cause WCN6855 hardware fails to be enumerated. Fix it by force writing the correct value to this register when power on. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang --- drivers/net/wireless/ath/ath11k/pci.c | 11 +++++++++++ drivers/net/wireless/ath/ath11k/pci.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c index d73b522a0081..06968ad488b0 100644 --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c @@ -445,6 +445,16 @@ static void ath11k_pci_force_wake(struct ath11k_base *ab) mdelay(5); } +static void ath11k_pci_gpio_reset(struct ath11k_base *ab) +{ + int val; + + ath11k_pci_write32(ab, PCIE_GPIO_CFG_REG, PCIE_GPIO_RESET_VAL); + mdelay(10); + val = ath11k_pci_read32(ab, PCIE_GPIO_CFG_REG); + ath11k_dbg(ab, ATH11K_DBG_PCI, "gpio cfg: 0x%x\n", val); +} + static void ath11k_pci_sw_reset(struct ath11k_base *ab, bool power_on) { mdelay(100); @@ -461,6 +471,7 @@ static void ath11k_pci_sw_reset(struct ath11k_base *ab, bool power_on) ath11k_pci_clear_dbg_registers(ab); ath11k_pci_soc_global_reset(ab); ath11k_mhi_set_mhictrl_reset(ab); + ath11k_pci_gpio_reset(ab); } int ath11k_pci_get_msi_irq(struct device *dev, unsigned int vector) diff --git a/drivers/net/wireless/ath/ath11k/pci.h b/drivers/net/wireless/ath/ath11k/pci.h index 61d67b20a0eb..2716fc7745d6 100644 --- a/drivers/net/wireless/ath/ath11k/pci.h +++ b/drivers/net/wireless/ath/ath11k/pci.h @@ -52,6 +52,9 @@ #define WLAON_QFPROM_PWR_CTRL_REG 0x01f8031c #define QFPROM_PWR_CTRL_VDD4BLOW_MASK 0x4 +#define PCIE_GPIO_CFG_REG 0x0180e000 +#define PCIE_GPIO_RESET_VAL 0xc5 + struct ath11k_msi_user { char *name; int num_vectors; -- 2.25.1