From patchwork Fri Apr 5 16:07:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Eichenberger X-Patchwork-Id: 13619254 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 2D232CD1284 for ; Fri, 5 Apr 2024 16:08:04 +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:References:In-Reply-To: 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: List-Owner; bh=nRLcMONQ/kRo6YQm2VPd/KdG4/BDS8cSlkkllmu3f14=; b=uSkDKdlob2E9Hv 0kOLLLyZGlYH0p9jRSsRla7n9jeCylmpagNgIGVorpKtfIUO0m4L5UgRrxQEfPnyjufEWja5v5ULu DIW/fTe0ZNL5lMreLPXPEq60smPHSRraRvTLftzey0aN8jLiYUdhPOcXTbNvD8rMIl89L4OxqS+wE eaElQNd6MdlPlxM32+4xWMLQMR/NZUtecriJ1eoUwxFQ/RdhVpqyonFhkZWFSWI2HwAC50kWNjDmD l6N4Ync6+1404IOL3ToTdPijIoorhrzwPJRBwfabTv2lvpIZ1GReTF1zsUSBr43MFQ+fYmTBgBdm+ OOh7On3MDCsoQ9VKegJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsm6a-00000007v3z-0wls; Fri, 05 Apr 2024 16:07:52 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsm6T-00000007uzV-0ho7 for linux-arm-kernel@bombadil.infradead.org; Fri, 05 Apr 2024 16:07:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=qOce/01hbDzl8+x1yOJ/1AVGMenhuK+vsq/FsL52bf0=; b=SSSO0ZOw4oa69/YSc2QUJoMPnW hQLByEfO0Pt1KgERDNFKKvS3/lrAE08J5DhbtOvRYwijpI3qq3FCykQSvGa3NySUaerjX5NdgDxM2 HrDogHkCYPkUVKfZFIr6ycyehSHE/VhiNyY88Ydi3vzOIJ6fVYP9K0gijt/en40wfJ3WtbHix7kaF ahQCTpfe3UQ50MlzRJ7IBtCwbK4LouuPcIXtfGb3hwyL4ynS1u91JlKMoD6raFTmaEvVwpSdj2AWK KrofcFO3VkQp1vkaSle4y7R+K8jNQL6K8ro3Z86KwBBOYRESIEFfiUdKcZjMsM/hLjhLyq+HYiGZD FmO8H0yw==; Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsm6O-00000005j0t-2wue for linux-arm-kernel@lists.infradead.org; Fri, 05 Apr 2024 16:07:43 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4162b5ba2bbso14060325e9.1 for ; Fri, 05 Apr 2024 09:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712333256; x=1712938056; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qOce/01hbDzl8+x1yOJ/1AVGMenhuK+vsq/FsL52bf0=; b=Y4tbf1yPybjQHaUM7CJ6b5neiQ+M/gx4prYphsK/q9IrSwqQDjfRHhT0aMGhjZy7V8 74nBcO4ICN71J8JqkWodKb80wmdSqbabfil+ew9PqHEpf0gF6sl02HoEqYwJzxcSgrw5 1IUHlZ3C5gTO9LemW9+ZfD7Tsnv0+DRhKRi3cGnOdb63QI21pLzZ+AK0w9TTOmLkI+gX GnGWvYz7bsZ3Qedyz5g2O+apCBuLIKpOSuXVuvDyYmpGgRsi6gMiqxOy5z3n4P6qa8KN GeDeVDBV05r3W627h44RiX9tyKTZQxXulTRemEry7oLdW4WzZBT1D7q0/UhKbxtkDnBX JX6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712333256; x=1712938056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qOce/01hbDzl8+x1yOJ/1AVGMenhuK+vsq/FsL52bf0=; b=h2EZA0iKtPdNysxl2vuVPL5zXKHBIFGUXf97cHEsa4ClrcjPLOVjHA4Q0QzVvXn9tm 7rGqPmAllZ8ObRdKiOqJ1hPah+k+csP6wuSA710OOg7LkcGYKcWJXLuBFAVE4m50+kKQ nhd1nDw7BeDKjgS+8dJpeEMddGjEni3i3KIkODRO7D5zZux32B6zNf1pdZcXqfAyNJ7H W4DE/4ir9USQqSJaiUCX8njmcvyErLuNJgn2nETIwsF/2SqgwrZ5oX5OE7uEHuRiyrZw iGt96R3LMY1R2aonHiu83SCJ+JdNjZLVkvzm0WHqyoAZVwVtChGFG2olUJYnL6ZL0s1H gppA== X-Forwarded-Encrypted: i=1; AJvYcCVGlVOlDbW9yGvO1QZBWoHhN9JTnhdtZrEgu+M44dbfsWl7F0s/thziJ/CPI4B2PmIOwW8gyKX8Nmx2QRzcDuh+18/jaGbmmJ3ZH7/x6hQ70OKPGbQ= X-Gm-Message-State: AOJu0YwEsqygMePKsMjI6M+MmI0eksq/kOupQCb8f0y7MmBKLhbNwLqZ br4O+t8LaQUdA8CNWU0sLMVsY/Whapi2hrLPSvjbe3XIdkoUwBuXZPuY5PBG/S8= X-Google-Smtp-Source: AGHT+IHX223U4DsZ/xQPDPFZTq5ivcV0JxX0dpOp4Q0Djfm9YV+NtF1fazKA8gfSCWvEVdck2JLcjA== X-Received: by 2002:a05:600c:3d88:b0:415:52f8:ca74 with SMTP id bi8-20020a05600c3d8800b0041552f8ca74mr1533482wmb.36.1712333256089; Fri, 05 Apr 2024 09:07:36 -0700 (PDT) Received: from eichest-laptop.toradex.int ([2a02:168:af72:0:f624:ad13:2091:c808]) by smtp.gmail.com with ESMTPSA id k41-20020a05600c1ca900b004156c501e24sm6902651wms.12.2024.04.05.09.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 09:07:34 -0700 (PDT) From: Stefan Eichenberger To: robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, francesco.dolcini@toradex.com Cc: devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Eichenberger Subject: [PATCH v1 1/4] arm64: dts: freescale: imx8mp-verdin: replace sleep-moci hog with regulator Date: Fri, 5 Apr 2024 18:07:17 +0200 Message-Id: <20240405160720.5977-2-eichest@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240405160720.5977-1-eichest@gmail.com> References: <20240405160720.5977-1-eichest@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240405_170740_949486_DC350FE9 X-CRM114-Status: GOOD ( 14.94 ) 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: Stefan Eichenberger The Verdin family has a signal called sleep-moci which can be used to turn off peripherals on the carrier board when the SoM goes into suspend. So far we have hogged this signal, which means the peripherals are always on and it is not possible to add peripherals that depend on the sleep-moci to be on. With this change, we replace the hog with a regulator so that peripherals can add their own regulators that use the same gpio. Carrier boards that allow peripherals to be powered off in suspend can disable this regulator and implement their own regulator to control the sleep-moci. Signed-off-by: Stefan Eichenberger Reviewed-by: Francesco Dolcini --- .../dts/freescale/imx8mp-verdin-dahlia.dtsi | 5 ++++ .../boot/dts/freescale/imx8mp-verdin-dev.dtsi | 5 ++++ .../dts/freescale/imx8mp-verdin-yavia.dtsi | 5 ++++ .../boot/dts/freescale/imx8mp-verdin.dtsi | 26 ++++++++++++------- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi index 7e9e4b13b5c5..e68e0e6f21e9 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi @@ -70,6 +70,11 @@ &flexspi { status = "okay"; }; +&gpio4 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ctrl_sleep_moci>; +}; + /* Current measurement into module VCC */ &hwmon { status = "okay"; diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dev.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dev.dtsi index a509b2b7fa85..1a2520d4d6cf 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dev.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dev.dtsi @@ -93,6 +93,11 @@ &flexspi { status = "okay"; }; +&gpio4 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ctrl_sleep_moci>; +}; + &gpio_expander_21 { status = "okay"; vcc-supply = <®_1p8v>; diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi index db1722f0d80e..27160024d5b5 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi @@ -100,6 +100,11 @@ &flexcan1 { status = "okay"; }; +&gpio4 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ctrl_sleep_moci>; +}; + &hwmon_temp { status = "okay"; }; diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi index faa17cbbe2fd..e523762947aa 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi @@ -116,6 +116,22 @@ reg_module_eth1phy: regulator-module-eth1phy { vin-supply = <®_vdd_3v3>; }; + /* + * By default we enable CTRL_SLEEP_MOCI#, this is required to have + * peripherals on the carrier board powered. + * If more granularity or power saving is required this can be disabled + * in the carrier board device tree files. + */ + reg_force_sleep_moci: regulator-force-sleep-moci { + compatible = "regulator-fixed"; + enable-active-high; + /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */ + gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>; + regulator-always-on; + regulator-boot-on; + regulator-name = "CTRL_SLEEP_MOCI#"; + }; + reg_usb1_vbus: regulator-usb1-vbus { compatible = "regulator-fixed"; enable-active-high; @@ -439,16 +455,6 @@ &gpio4 { "SODIMM_256", "SODIMM_48", "SODIMM_44"; - - ctrl-sleep-moci-hog { - gpio-hog; - /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */ - gpios = <29 GPIO_ACTIVE_HIGH>; - line-name = "CTRL_SLEEP_MOCI#"; - output-high; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_ctrl_sleep_moci>; - }; }; /* On-module I2C */