From patchwork Fri Jan 20 01:26:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 13109039 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 5BB44C38142 for ; Fri, 20 Jan 2023 01:29:22 +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=3tkIA0CwamJb4o7Y63lKnriTf8kxRBqu/+O3t8veRgI=; b=nT4N8ket2YlbQP XnviRkpA/9wH1waEZuQ0M/+GtadDeMvSNmDblOAfx1SLU2qZXWupKIMJnhtZjGabLSNPQlztJE+5y ppRGczA70jgEFu3bOa4boGv1h6b5R7nEAU3nuyp8N12bcgxci86j2dgfBIa/I6CSPkJH0IUhOPyBu KMrlkHPgDarHsmPXYnR9JPHBxfBZv/5lQkkxXOddjUQ0YbSIadXvTab9aHOCR2JEOTzA5Fz99iYJ2 e/94jO9FJrcS6kEjCKk9tLo3XardTeLQhrfEwm595r1w9vS/Rws3h+N7npcUVycPd1nE9DUJWidsY dIfXzYQj7c8vJmQcluqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIgCe-007uIg-5b; Fri, 20 Jan 2023 01:28:24 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIgCZ-007uG3-Sy for linux-arm-kernel@lists.infradead.org; Fri, 20 Jan 2023 01:28:21 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8940413D5; Thu, 19 Jan 2023 17:28:51 -0800 (PST) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8AAB23F71A; Thu, 19 Jan 2023 17:28:08 -0800 (PST) From: Andre Przywara To: Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Samuel Holland , Jernej Skrabec Cc: linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH] ARM: dts: sun8i: a83t: bananapi-m3: describe SATA disk regulator Date: Fri, 20 Jan 2023 01:26:16 +0000 Message-Id: <20230120012616.30960-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.35.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_172820_025660_6630F2E0 X-CRM114-Status: GOOD ( 13.51 ) 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 The Bananapi-M3 has a SATA connector, driven by a USB-to-SATA bridge soldered on the board. The power for the SATA device is provided by a GPIO controlled regulator. Since the SATA device is behind USB, it has no DT node, so we never described this regulator. Instead U-Boot was turning this on in a rather hackish way, which we now want to get rid of. On top of that it seems fragile to leave this GPIO undescribed, as userland could claim it and turn the disk off. Add a fixed regulator, controlled by the PD25 GPIO, and mark it as always-on. This would mimic the current situation, but in a safer way, and would allow U-Boot to drop the CONFIG_SATAPWR enable hack. Signed-off-by: Andre Przywara Acked-by: Samuel Holland --- arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts b/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts index 5a7e1bd5f8258..8d56b103f0630 100644 --- a/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts +++ b/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts @@ -105,6 +105,21 @@ wifi_pwrseq: wifi_pwrseq { /* enables internal regulator and de-asserts reset */ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */ }; + + /* + * Power supply for the SATA disk, behind a USB-SATA bridge. + * Since it is a USB device, there is no consumer in the DT, so we + * have to keep this always on. + */ + regulator-sata-disk-pwr { + compatible = "regulator-fixed"; + regulator-name = "sata-disk-pwr"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + enable-active-high; + gpio = <&pio 3 25 GPIO_ACTIVE_HIGH>; /* PD25 */ + }; }; &cpu0 {