From patchwork Mon Mar 25 14:35:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 13602342 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 00409C54E64 for ; Mon, 25 Mar 2024 14:35:56 +0000 (UTC) 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=Jj2pPXGiebDHmJ0ZDHlq4AUgvkG1jLrp50ROQ7k76WM=; b=orWOGYS5CVuwtt TETrXv/IuHGRH75jHsiEo5mvuIQiVwIu7iPumdOzrCUFguh2wHsOXlWDRCzvVkxolB+rncU+AXviw jYOBc8szzPtRjyUIlMKom2YyoG6JfAh8zOoaxcJOWIMgygr8WFEfq50pPN6FGkzkiABiHjRKV88QX KuXNEL0sMYTxhO8ZUoziHKdZouj/gcXcyUgescZHBAsZsu3LVl1o02eP+u6NWR9XUsUiqOxLZfaJD BJmsm/c9GqyiwKeyEjxexctqBrJbaXffKZD0l6p2OdK+Jt/XaQe6k4WBmndjceGcxNu2hWjc9dVVQ VsP84ou8ABsh063z6AsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rolQQ-00000000GFb-2z0l; Mon, 25 Mar 2024 14:35:46 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rolQI-00000000GAE-2Ume for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2024 14:35:43 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 42PEZHj4096694; Mon, 25 Mar 2024 09:35:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1711377318; bh=7VEN6CcVqpXAQcxkPxLacRLhJ2Mwhs7ycVWHGNp2PWc=; h=From:To:CC:Subject:Date; b=r6Hadb3Mzd9RT7DjjHyHu87dy1VsmLa829oiL2IZjr4Z6GD37k4Idfho3+wcSYnIT Mkz4nce/E1S4QFxxOxT0hdVG7hTLrWqdSD/umeoeHPfhwIeyXu+CbFvg85w+AE25di aTWH12SA2j/I3tfIKBaRjvfdvCfN/mEehrYQhuWA= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 42PEZHtG011013 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 25 Mar 2024 09:35:17 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 25 Mar 2024 09:35:17 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 25 Mar 2024 09:35:17 -0500 Received: from localhost (uda0133052.dhcp.ti.com [128.247.81.232]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 42PEZHLf123147; Mon, 25 Mar 2024 09:35:17 -0500 From: Nishanth Menon To: Tero Kristo , Vignesh Raghavendra , Nishanth Menon CC: Robert Nelson , Conor Dooley , Krzysztof Kozlowski , Rob Herring , , , , Shengyu Qu , Sukrut Bellary , Javier Martinez Canillas , Bill Mills Subject: [PATCH V2] arm64: dts: ti: k3-am625-beagleplay: Use mmc-pwrseq for wl18xx enable Date: Mon, 25 Mar 2024 09:35:10 -0500 Message-ID: <20240325143511.2144768-1-nm@ti.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Organization: Texas Instruments, Inc. X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240325_073538_908932_935F69DF X-CRM114-Status: GOOD ( 17.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Sukrut Bellary BeaglePlay SBC[1] has Texas Instrument's WL18xx WiFi chipset[2]. Currently, WLAN_EN is configured as regulator and regulator-always-on. However, the timing and wlan_en sequencing is not correctly modelled. This causes the sdio access to fail during runtime-pm power operations saving or during system suspend/resume/hibernation/freeze operations. This is because the WLAN_EN line is not deasserted to low '0' to power down the WiFi. So during restore, the WiFi driver tries to load the FW without following correct power sequence. WLAN_EN => '1'/assert (high) to power-up the chipset. Use mmc-pwrseq-simple to drive TI's WiFi (WL18xx) chipset enable 'WLAN_EN'. mmc-pwrseq-simple provides power sequence flexibility with support for post power-on and power-off delays. Typical log signature that indicates this bug is: wl1271_sdio mmc2:0001:2: sdio write failed (-110) Followed by possibly a kernel warning (depending on firmware present): WARNING: CPU: 1 PID: 45 at drivers/net/wireless/ti/wlcore/sdio.c:123 wl12xx_sdio_raw_write+0xe4/0x168 [wlcore_sdio] [1] https://www.beagleboard.org/boards/beagleplay [2] https://www.ti.com/lit/ds/symlink/wl1807mod.pdf Fixes: f5a731f0787f ("arm64: dts: ti: Add k3-am625-beagleplay") Suggested-by: Shengyu Qu Signed-off-by: Sukrut Bellary Signed-off-by: Nishanth Menon Tested-by: Robert Nelson --- Picking this patch up since Sukrut was not able to refresh the patch in the list and it does'nt make much sense to hold off this critical fixup. Boot log: https://gist.github.com/nmenon/a34abd03a6aaf84a39ffa569df248285 (includes defconfig change to make iwd work) Changes Since v1: * Update the power-on-time to 10ms (same as used in: arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts ) * Add in-code documentation pointing at timing diagram for the values used. * Fixup fail log and commit message and make it generic to indicate various other usecases of failure. * Re-test on v6.9-rc1 V1: https://lore.kernel.org/all/20231213213219.566369-1-sukrut.bellary@linux.com/ .../arm64/boot/dts/ti/k3-am625-beagleplay.dts | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) base-commit: 4cece764965020c22cff7665b18a012006359095 diff --git a/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts b/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts index a34e0df2ab86..ffc613543968 100644 --- a/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts +++ b/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts @@ -82,6 +82,17 @@ wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9db00000 { }; }; + sdio_pwrseq: sdio-pwrseq { + compatible = "mmc-pwrseq-simple"; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_en_pins_default>; + /* Interal power on time(Figure 8-3) * 2 */ + post-power-on-delay-ms = <10>; + /* Re-enable time(Figure 8-2) + 20uS */ + power-off-delay-us = <80>; + reset-gpios = <&main_gpio0 38 GPIO_ACTIVE_LOW>; + }; + vsys_5v0: regulator-1 { bootph-all; compatible = "regulator-fixed"; @@ -104,20 +115,6 @@ vdd_3v3: regulator-2 { regulator-boot-on; }; - wlan_en: regulator-3 { - /* OUTPUT of SN74AVC2T244DQMR */ - compatible = "regulator-fixed"; - regulator-name = "wlan_en"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - enable-active-high; - regulator-always-on; - vin-supply = <&vdd_3v3>; - gpio = <&main_gpio0 38 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&wifi_en_pins_default>; - }; - vdd_3v3_sd: regulator-4 { /* output of TPS22918DBVR-U21 */ bootph-all; @@ -839,13 +836,13 @@ &sdhci1 { }; &sdhci2 { - vmmc-supply = <&wlan_en>; pinctrl-names = "default"; pinctrl-0 = <&wifi_pins_default>, <&wifi_32k_clk>; non-removable; ti,fails-without-test-cd; cap-power-off-card; keep-power-in-suspend; + mmc-pwrseq = <&sdio_pwrseq>; assigned-clocks = <&k3_clks 157 158>; assigned-clock-parents = <&k3_clks 157 160>; #address-cells = <1>;