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: 13619248 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2B9017107A for ; Fri, 5 Apr 2024 16:07:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712333260; cv=none; b=I/L6goHyh3c5FAADt4hPLdbGDqRKLvg2uH6+92VZs1MTpdCr8rs749kKHG+MQo7FY37rOG2Nymd1krB6KYHQWec9nOWH7rTsNKW4Vp9YcwQeevtagIIKFIZVRrIss4R0lvRKNzzHkprjV+k8mWdQlZEsOEl7vct0yvolchZbUxU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712333260; c=relaxed/simple; bh=qBYmF0xGWXhV6hUCfu3HKLzpWqtGV+Hfy6dq9NOruFU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pUqdQIlldCWNfbfqDDrXbc9f/P+e4Faspl+ymYmTmRf2ZZihap+LxnAE0WMKaokBvNFCXa4npnKHq0kuH30Pk9HsyDpgg1cy+S8JylvR6m27xQLA2rHLFZPZY0oS3ir8zCa90DGcWn0Me8K9IHVrvRY56p5uRwxcAbrLYvWJzIA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XddoinEc; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XddoinEc" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4156a29ff70so17799405e9.3 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.linux.dev; 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=XddoinEc1iFohBLoquhpefB17+mQQb4h2Uoutu50mFW12Gb3xztRJ17RXlLm4yFOfH UUpxWaZ3wkRdFqAVwf4ubk3Ei8wBQAapbbigETA0KJ4u06MYLir1HaJGdhSAsokV4n1R 7+k8ouyHOwplDrqfz3iqnPvXXFkiLJv3Xi1uMLBXI6Tz5WFFs+WCZrh/IstYidMEiPZv /MaEv1O3tNeZROIr7S7expUYcHt5WZRm6Yl/a6IXx97WHBc5qplM3un67GM6dOrjF6og HQCn06f8KccJpd6ARwZ5v4M8Lu5z5pXOJ4qhrVZQ8m9rWERvBgvbTHhgc8wMi/CLhBDR JXlg== 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=gwNgSBNzH2TU7IDB5h82JzzNIvC2AZ2wMbhv8wfPwVVM0YnFnYRTD6JE3TFg50NK4l kOe6+R9LqcZjOLrJefTLHcUXoAawe+eRfK5WjS7rjFyjSXeW4lbCQ1DJxZLO2PjDbVMl TGR8hBkb5rUuUXBI9t3dtm+FSyEVaWf0rcP4VW8iRwgriP2nP9aNudvsrnMJTUOFcOBw i4NIODrB7F0rCVoYRRCA1guAw+4on3wAwY6JNFD1w2tvBBiyF0oP1yVMJuasUP4bSasw ybHcMIUQZm0RrDAe0Sz8QaDjJOkCoKMxvdl0Odj4zwkHxrabn5aFPba91+CMVnRlgFdI SQBA== X-Forwarded-Encrypted: i=1; AJvYcCWjMJbPBIZTiR6a5svQP3K2SDr1zsvrfetwyTnYKNSQvEsug3E37YLyVITiHw4oxELa9O8Wvj3i+HHfKbTXLUGyinmK X-Gm-Message-State: AOJu0YwMpoDNOuUVrTMYKEYmz/adioBDeb3Q2bYyHev9WMKXM1eOhMPp NBlGownaHDmTCOfP9RXlobOWYR7BkYPjKBcJxZo6uZhXjcFySrI2 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> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 */ From patchwork Fri Apr 5 16:07:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Eichenberger X-Patchwork-Id: 13619249 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5DA7171080 for ; Fri, 5 Apr 2024 16:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712333261; cv=none; b=fAMCKhw/ejB5irIwlFk40saXCcrXB/Y5btLRHrHqUYuMsF2CEh4eYD3wBvZo6aa9UhmpGMHjsf4dYxoS+E1Y5d86hY46M9NKe/GdRm4mVlt3CE7EEskCK4tHZlxgHwGtOTswcrhYOLNNBwJOlxf+Ux9bB19/8xkKcQLgUQ9lOqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712333261; c=relaxed/simple; bh=dBH1j/h1dRu0ygt9hNbmwa87jEdhv9yAzGW6ZwQoLsM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=M1qQPZ86GtgRGlmFt3Fycw7ETdGiaTXkpikPN0c645679HuAp3AmsYhJQ6YuNFAr7JAuEjJBe13nRUwXFBa7/vVCnLMvHPL+JS3uvBTI1tKzA26TvP+BlDFVN9mW68k9ybO1Pl0ytRCZABQxjVS6VFk2wSvoQrUCaqm4gCA2ge0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mOyit0hT; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mOyit0hT" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2d700beb6beso26390581fa.2 for ; Fri, 05 Apr 2024 09:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712333258; x=1712938058; darn=lists.linux.dev; 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=lgmM3Xbata7VzEXtxd2ThwevKFI1uBmzRn4wOr+9OFw=; b=mOyit0hTgtcz0H9HdHDNN1ghE0j9KnCtjZs6wWdqxzq5WFheQlsCllZxRJMWNmirnl Y8epFksUOLEt77u7rMsimbNaIQGvkW+kws5ZVO4tKYQN6AkuhwDQYDuI4NB5wkO18XxX GND2wT3E0YwrVHpz2Gw8IhMmdX2mthl0vmZE2uIRbMvZd/XD4cPvSJX7Vgd7Eog4mPJL tGBdLreFvGQaRlLjH6COeVsA0Cc9Q/i4vzlPYcbe/O2hrAgNMEgu3zWLpNKUiQQ1ix5a VU+a6uGuhfkrzETo6QnXT+N/v/sNLjJgw3oK+FAnEF/b+OVX0PE8SAP0K/5m2fJO2C2o EKqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712333258; x=1712938058; 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=lgmM3Xbata7VzEXtxd2ThwevKFI1uBmzRn4wOr+9OFw=; b=LA67QQ5e7mqcwNihTj01pNvBMsAUzbMXxWCCYmFJ/GmsL0FWOLArL1SSDpRRpHQBCD wfXaThp/4XK1vzHOMUvkib6V4qONGbHuPowNrlYInboeejFb3/sbB6UuVNpaf32Eb+4Y cTdgIaCSGAwb18ikV11xOY2Xg3/gXyqKouw23/NIqBEPGRL+6Oy0Aa6cXVm9rnce9kJH oB7vEfw85gtpnrHA6uq9r46ss5DCvbXtiMeduwS/enqyr7O9JWV+uUpzIjL4ZkElwUer 7L0b9jUqgRNwG4x/KzGnmYkJjE1S8x598p95go7yURNmnJSJzgiDS+LZXYw5vy9/xK9o 8Jjw== X-Forwarded-Encrypted: i=1; AJvYcCVKYCVhE08/CwHiZq27UbP3vt1xikZvG/9iWh1qcs/0p4yeRrCNKIaXSWta6b2K0n3aWvx/duxycdU+zz9Uc09bvqKv X-Gm-Message-State: AOJu0YznWtepLuYEtvzBu+6E6eP1NkpcHQEBeZpi82V9++oIWUOBMg0B IKsSrZlaq3DKNFnXOkghil795RF2OuOJh8rmTXqHZ7qyqYRXenKT X-Google-Smtp-Source: AGHT+IGcCu7kSbpvYBdqwmxAjtE9WbGU1f3WKzshRVZ88A/8Ug7BCKSWBua5SkDNKu2NdPeTUB5Puw== X-Received: by 2002:a2e:9045:0:b0:2d8:681:dc9e with SMTP id n5-20020a2e9045000000b002d80681dc9emr1448379ljg.41.1712333258017; Fri, 05 Apr 2024 09:07:38 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 09:07:36 -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 2/4] arm64: dts: freescale: imx8mp-verdin-dahlia: support sleep-moci Date: Fri, 5 Apr 2024 18:07:18 +0200 Message-Id: <20240405160720.5977-3-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> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Stefan Eichenberger Previously, we had the sleep-moci pin set to always on. However, the Dahlia carrier board supports disabling the sleep-moci when the system is suspended to power down peripherals that support it. This reduces overall power consumption. This commit adds support for this feature by disabling the reg_force_sleep_moci regulator and adding two new regulators for the USB hub and PCIe that can be turned off when the system is suspended. Signed-off-by: Stefan Eichenberger Reviewed-by: Francesco Dolcini --- .../dts/freescale/imx8mp-verdin-dahlia.dtsi | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi index e68e0e6f21e9..abad1887040a 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi @@ -32,6 +32,25 @@ simple-audio-card,cpu { sound-dai = <&sai1>; }; }; + + reg_usb_hub: regulator-usb-hub { + compatible = "regulator-fixed"; + enable-active-high; + /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */ + gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>; + regulator-boot-on; + regulator-name = "HUB_PWR_EN"; + }; + + reg_pcie: regulator-pcie { + compatible = "regulator-fixed"; + enable-active-high; + /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */ + gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>; + regulator-boot-on; + regulator-name = "PCIE_1_PWR_EN"; + startup-delay-us = <100000>; + }; }; &backlight { @@ -117,6 +136,7 @@ wm8904_1a: audio-codec@1a { /* Verdin PCIE_1 */ &pcie { + vpcie-supply = <®_pcie>; status = "okay"; }; @@ -143,6 +163,11 @@ ®_usdhc2_vmmc { vin-supply = <®_3p3v>; }; +/* We support turning off sleep moci on Dahlia */ +®_force_sleep_moci { + status = "disabled"; +}; + /* Verdin I2S_1 */ &sai1 { assigned-clocks = <&clk IMX8MP_CLK_SAI1>; @@ -186,6 +211,25 @@ &usb3_phy1 { status = "okay"; }; +&usb_dwc3_1 { + #address-cells = <1>; + #size-cells = <0>; + + usb_hub_3_0: usb-hub@1 { + compatible = "usb424,5744"; + reg = <1>; + peer-hub = <&usb_hub_2_0>; + vdd-supply = <®_usb_hub>; + }; + + usb_hub_2_0: usb-hub@2 { + compatible = "usb424,2744"; + reg = <2>; + peer-hub = <&usb_hub_3_0>; + vdd-supply = <®_usb_hub>; + }; +}; + /* Verdin SD_1 */ &usdhc2 { status = "okay"; From patchwork Fri Apr 5 16:07:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Eichenberger X-Patchwork-Id: 13619250 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7243017167B for ; Fri, 5 Apr 2024 16:07:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712333263; cv=none; b=XOc3p844re9tmFrUG7YNW75Ecl03ot4lZHUYDD8HFsr1UYIse5cJAN+Y8UtVuHvHCcKaqAstdDs4v5eR87brzsuQOHsJHrv7EacwnDNoN6Pa3QJNuleO2XErl1ZjVyyU6YzjYBzx64BQLFjEhYLza53ZxgjepJKNLrD8dmkF/9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712333263; c=relaxed/simple; bh=7z5A63z34JZY3N+TJSxKM7g09BIVDVW2CNscb4AcyH4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KROuPs6/A/fE5RWh6LIdrhyBTK5W8G/TV31n+4CuKK9d6kIrPDBg5y3P+ZvqENHKGHqg7wS9tJumywXAau2URcB/WpTvi+DotvHIpwa2Gjet3kMG0qElo+BW+x/PyHrQKTEy2u1w4H/+WQ93jQeep/+Jm8y2LNARc2CsaiRo9SI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Dt0LG6YE; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Dt0LG6YE" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4162ef30461so6311055e9.1 for ; Fri, 05 Apr 2024 09:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712333260; x=1712938060; darn=lists.linux.dev; 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=I6pW63QzcVFb8Z1JhQZTU0zt0MbJJ3KtnHGcQ53YARs=; b=Dt0LG6YEAnIb3NXd5T5RkmFWsgAWUk47nCYnozyzzB7gUJjLhKzlGGjluFJOejEPRd 2SYAjpJ48toqWG9D9X2cb4V+rIBue4xH7cVGjtOqZERyfQypBfGpuBEx3mkpd2S+Z2qr 168gOqlsVjbo3Mtk8xorhmKkowYDnMlgjFb7wSF58j6un/hifT5zKYj0CuCbDckKPagS nKjk33fTQsM/tBix/fKY2KEy6wdfwcohnOjCxtz67FpMvhyQq1SxPNlArf/tQyCuO5/h s2gu+JVD2pxlW8lsxgaRDNyB5OdCtx4EspRIRs2iLIZAMXZtm8A7J7rVILOvGFddhUC8 upZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712333260; x=1712938060; 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=I6pW63QzcVFb8Z1JhQZTU0zt0MbJJ3KtnHGcQ53YARs=; b=FxIMrfkRSwr81k3GXEplzNVVefocYOfpgoNXZ3VkzTONFWo7MZR68aNUAM690QD+p1 OhNx4HjZCi/HN0018vVHb4AgtC7Q5+s/KR4F8A8hV3GDaXObDSBGDUSx0kuzZP+svgl6 auigDoCmoF+YQ4r4tdaHTjCKpqEghzmK/mt/hUI34f/3JLkpsiCln8dFOpdcG8lsL1JJ uqQ33f/44gN02ttTnWxIxOmbeZZtrjPagzrPdW9EXG8MWudTLx9GMXaddY8HSpa2LQVz fNjZFuPfWb/+wU56CxEOqGPgSebf9HU2a4oRnVvMgKXy5xT/2Auv8mSqgkxl4ZYLHm1L /Acw== X-Forwarded-Encrypted: i=1; AJvYcCWPnYvye2EWvSWLvcwH9RHBY9XQT1rwbaIIIeOckG6Jd/aXefGzflZ2CSC3vwEKrs1hAaKgp7EQfktMdN4hehDogwo1 X-Gm-Message-State: AOJu0Yz2KyDq36uVwEXw00eJR4n6LgBCm73qt3EjTM9EMjm9jdRiwr4V OxctWyj+GMJkc4S7j4kJ5wRMkZ67douFbN/wchN0qP6MUTuuVaig X-Google-Smtp-Source: AGHT+IH+zUWXxsL8Og9UKbQxJ0DlCkaJldoLKLu4x8k64dMC7ySwdn8bowpGE2+mWbtxVMQsEct02Q== X-Received: by 2002:a05:600c:3acc:b0:413:fc09:7b19 with SMTP id d12-20020a05600c3acc00b00413fc097b19mr1449758wms.40.1712333259840; Fri, 05 Apr 2024 09:07:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 09:07:38 -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 3/4] arm64: dts: freescale: imx8mm-verdin: replace sleep-moci hog with regulator Date: Fri, 5 Apr 2024 18:07:19 +0200 Message-Id: <20240405160720.5977-4-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> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/imx8mm-verdin-dahlia.dtsi | 5 ++++ .../boot/dts/freescale/imx8mm-verdin-dev.dtsi | 5 ++++ .../dts/freescale/imx8mm-verdin-yavia.dtsi | 5 ++++ .../boot/dts/freescale/imx8mm-verdin.dtsi | 26 ++++++++++++------- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi index 1cff0b829357..b64dac4f29c2 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi @@ -58,6 +58,11 @@ &flexspi { status = "okay"; }; +&gpio5 { + 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/imx8mm-verdin-dev.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi index 3c4b8ca125e3..95b7c9a03a23 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi @@ -78,6 +78,11 @@ &i2c3 { status = "okay"; }; +&gpio5 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ctrl_sleep_moci>; +}; + &gpio_expander_21 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-yavia.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-yavia.dtsi index 1e28c78e381f..763f069e8405 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-verdin-yavia.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-yavia.dtsi @@ -81,6 +81,11 @@ &gpio3 { pinctrl-0 = <&pinctrl_gpios_ext_yavia>; }; +&gpio5 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ctrl_sleep_moci>; +}; + &hwmon_temp { status = "okay"; }; diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi index 6f0811587142..4768b05fd765 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi @@ -110,6 +110,22 @@ reg_ethphy: regulator-ethphy { startup-delay-us = <200000>; }; + /* + * 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 = <&gpio5 1 GPIO_ACTIVE_HIGH>; + regulator-always-on; + regulator-boot-on; + regulator-name = "CTRL_SLEEP_MOCI#"; + }; + reg_usb_otg1_vbus: regulator-usb-otg1 { compatible = "regulator-fixed"; enable-active-high; @@ -333,16 +349,6 @@ &gpio5 { "SODIMM_212", "SODIMM_151", "SODIMM_153"; - - ctrl-sleep-moci-hog { - gpio-hog; - /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */ - gpios = <1 GPIO_ACTIVE_HIGH>; - line-name = "CTRL_SLEEP_MOCI#"; - output-high; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_ctrl_sleep_moci>; - }; }; /* On-module I2C */ From patchwork Fri Apr 5 16:07:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Eichenberger X-Patchwork-Id: 13619251 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC540171E61 for ; Fri, 5 Apr 2024 16:07:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712333265; cv=none; b=Xmk3nfQjsrAXjvielYN+ItwEljOOWZ1ikUSH9ovQLZF5EExf52VpB+qrl135eM+E+WRqrMipK6riHxmD7rab7OXQj7D1A2P+lKKlxQ+TAowa2jBA06gsQBmDb6GrfnAhvpU1TN45CJeCKrRMl2elUQyEtW4Y0scNwDFFpRqELZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712333265; c=relaxed/simple; bh=s2oelWPLHDUwNqi9cCjSGSaQzE7ldrgKjOrCLiSRNug=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=D471JDL/2MMe/y7GzGsKBHDonnkf8U9hy2f8rY/zOu9vbyktmLM1M+9GETXkQ/qPSOj7ZgCfXCLuzXLsgO9QXnYReeMrUq7erMfceu4UH989rrvgKJHqkMqdII/3jgonxLcGcqXYPXPbtgOO6+JMzimV33Mt1d1lLmCs7NIlZrk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lyqjGHz7; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lyqjGHz7" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4162b0e21b0so12295205e9.0 for ; Fri, 05 Apr 2024 09:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712333262; x=1712938062; darn=lists.linux.dev; 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=rWZ/UFU9OUajltHDRCM2CeH0LshCjJsNLCkamYUQgwY=; b=lyqjGHz76wEM/oIt72hdwQY+teLLOcPQXkPTv2KD+e3p5uoQxB7QFayZjeFLDyU83N pEh/Jd/7WKsYQWTO492W0ulWeYCAU7WBjclJNLEMoUPQAAANyDTs7Zh4P1ms8B5CzeUu A2CO/RpGn+lr3PlNqHUoEg0lszYceNd5F1IMkTMXZjC7zZJJ3WhCS5vRZihYNvcujS1R If+Kon2SflpLUehEOf5zGbowNZjaH5K5lynB0MewufZOIYYwikW3ImX/zfOmaMIRAN/u u7lI0E83vlNONeuq2Eu9uuOVerxulXQ5zLW8ZJY1+/n9D3XQFQ4Gkrpt3sqIIO63/wWr XWOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712333262; x=1712938062; 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=rWZ/UFU9OUajltHDRCM2CeH0LshCjJsNLCkamYUQgwY=; b=GMwLOF0t0zYi0j5l0w5xY0m8UOvFPH4IkT4AOJ+/EyNbkFBqYgxA7RVnvtQBEc8ILx m6u4dc/JgCgyoo7/X5/gxGEfbYUTyB0x9mlS/2UxtIScYPG/i7Cx538tuQ1Pz+x9S3yr iCuip2RL4YZJGp5fKqeT+HkTmvtAth/Nm6XyRlmsdV105XVy1RXXyZnGkTKJHDS38/4e CAZIHFuY3V7gDPBWV8seR3Hali59p95p1Bt/NxkOOcz8DNlR2t08Wybwkm8xZeTKHF3l fmS3ripN4Fxz1L6VTpAfcdCp7jYHJiuzFIavoLkcmf0jLv5ZvY7KdPn3+MbyxiByU4FN 6caw== X-Forwarded-Encrypted: i=1; AJvYcCU7J6PEEEj2vqEAFpzaTXRRVaCzPcSSkLqb2sB9/WLBBaMTfGZ7ornJUQ3x3IiCYrYuTRyIUQslzbkCbRk6FlHOBm0O X-Gm-Message-State: AOJu0YxZTFeiYYMa5auEpwSd7Qjw0azVYZXAL8/JVQa9tzvvYVKk9whi HhBGXsKWYrr1lDHTA9UUZB20MG+2o+5Gqqk6wJjpeWKI14Qmjpih X-Google-Smtp-Source: AGHT+IEIEeAONGwQhGeJMxNS3GD/dJh0uPbqMERZziPL6q1ylU9BP4frM9EsEdBFmc2rYLQVFaQ9+g== X-Received: by 2002:a05:600c:1e13:b0:416:3326:c150 with SMTP id ay19-20020a05600c1e1300b004163326c150mr440524wmb.29.1712333261663; Fri, 05 Apr 2024 09:07:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 09:07:40 -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 4/4] arm64: dts: freescale: imx8mm-verdin-dahlia: support sleep-moci Date: Fri, 5 Apr 2024 18:07:20 +0200 Message-Id: <20240405160720.5977-5-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> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Stefan Eichenberger Previously, we had the sleep-moci pin set to always on. However, the Dahlia carrier board supports disabling the sleep-moci when the system is suspended to power down peripherals that support it. This reduces overall power consumption. This commit adds support for this feature by disabling the reg_force_sleep_moci regulator and adding two new regulators for the USB hub and PCIe that can be turned off when the system is suspended. Signed-off-by: Stefan Eichenberger Reviewed-by: Francesco Dolcini --- .../dts/freescale/imx8mm-verdin-dahlia.dtsi | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi index b64dac4f29c2..393fc9e20423 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi @@ -32,6 +32,25 @@ simple-audio-card,cpu { sound-dai = <&sai2>; }; }; + + reg_usb_hub: regulator-usb-hub { + compatible = "regulator-fixed"; + enable-active-high; + /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */ + gpio = <&gpio5 1 GPIO_ACTIVE_HIGH>; + regulator-boot-on; + regulator-name = "HUB_PWR_EN"; + }; + + reg_pcie: regulator-pcie { + compatible = "regulator-fixed"; + enable-active-high; + /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */ + gpio = <&gpio5 1 GPIO_ACTIVE_HIGH>; + regulator-boot-on; + regulator-name = "PCIE_1_PWR_EN"; + startup-delay-us = <100000>; + }; }; /* Verdin SPI_1 */ @@ -98,6 +117,7 @@ wm8904_1a: audio-codec@1a { /* Verdin PCIE_1 */ &pcie0 { + vpcie-supply = <®_pcie>; status = "okay"; }; @@ -120,6 +140,11 @@ &pwm3 { status = "okay"; }; +/* We support turning off sleep moci on Dahlia */ +®_force_sleep_moci { + status = "disabled"; +}; + /* Verdin I2S_1 */ &sai2 { status = "okay"; @@ -148,8 +173,16 @@ &usbotg1 { /* Verdin USB_2 */ &usbotg2 { + #address-cells = <1>; + #size-cells = <0>; disable-over-current; status = "okay"; + + usb-hub@1 { + compatible = "usb424,2744"; + reg = <1>; + vdd-supply = <®_usb_hub>; + }; }; /* Verdin SD_1 */