From nobody Sat Feb 7 09:35:01 2026 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 5EA9027BF79 for ; Wed, 28 Jan 2026 16:10:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616657; cv=none; b=pmo6byuDvi6cTahh7p5t8+wq5lIpRCjoujz5/avXaccwgHPaw5mDpXzeKruaH2iCx+98MWno6mlAf01GOtmxeaBs4KUZeOxVL76bL4GmXU3UrkcXdbC6XsJnNdQ3XycjaZIH6PzSOeNWUfnVocIUTQyAUn0EleXktdYn3rOY5EY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616657; c=relaxed/simple; bh=MsoVcEJe0MhQwSs/kIxrngmiJYPnulx6/TKC80irjeo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hq9SD0KsNMHzhTGFaboxp3vitdV59sOXbRpLOrmvZqL0jKq3Ybbj25S6UTJLk57yvJRGv7rt32YHWj9CH1ilgikzu6iKt1sTT8NhMWCr3mGG5XsoXhny6fbu4+vPiBTPe9CHmEpm9NbpgXVvdvpQhI0iLXtRMuZnMmUifHt2px8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Tq8UqCiS; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Tq8UqCiS" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-b8837152db5so3685366b.0 for ; Wed, 28 Jan 2026 08:10:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616654; x=1770221454; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=c1M488vXqKcrQj+Jd5yyT2ZpNnjcHsZKW7NNZqOuyYk=; b=Tq8UqCiSTkL6ZHa17gsf4E1qldJ32PNfHq/rgklwJ57hWzw0h4dnkpU0ysfBYjPKCJ xTg6C8GAemty4yI5SVfQ64UTVU/a/33xwtdOrUvforkezEkgC/53WjNkJkdfuMEjbKxe MEqc0k4I0+7ypvkqQiL4KW08LgeBEfgK+F15IB7z8wNqbq/Dm3/TvMZChsaov7IEMkNl lYFOrgIVlyaLDzaxF3KaH9lT7O9IDZFakRLPNXkW3vhnxAUeV42sblFeZQq78LcB+o0x RUdaFitBsp827GANNJqn+CAjuFhrNeK6mRJc9eyFVYBPbx94sdsigs/ZBLPbL+oEfiyO n+7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616654; x=1770221454; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=c1M488vXqKcrQj+Jd5yyT2ZpNnjcHsZKW7NNZqOuyYk=; b=r+SDtmAdzU6R186OXQC2GE1BqHubaYt04uC9xbPJkyYdj3W8QlqBZ3dc3B+8EMx8S6 5IcOxSy4A7NHc+yhqR0mVdPySH2UmiQAvdS+7ILUSw0/5LQ7g9Co4IAv5GLt5EwYAjJj OYY9X5wuMorzHlO8DTM3hMCArwnPzNWuKvB55E6ovb7CgbRw8rfRUm95xGkF8hTYAi/M lrc+JrLpwKTzTM0rePeBEar0w3kfEPZYkZuQrodD0Z7sU9YJ50JTQlL0xo2tuqNHmvLe U7bi3523dXTJ45o779CrGD0VQ8zlGbAwvqUTwqTztn26sNbw7KsyBFoZBEBbVB2bekZs h/9Q== X-Forwarded-Encrypted: i=1; AJvYcCV+DqF9L108cL+d20TXvv5Xb3hN0zt5I0vMyk3zBAYrsEbXMqb4tgIogfBPdcwq0G1DPFPWK1nOr5YzHJ4=@vger.kernel.org X-Gm-Message-State: AOJu0YxPob3oOklHu/0xkbVFO3PrDPNDj8L6k6SzqGT6fPysdUx+IZdQ tDeQsHBmxhgODRTPX60pYulYiP4VoWEJbBVjj6+4rdO7s25ahJ2clb901ZCp6d3pPnM= X-Gm-Gg: AZuq6aKKWkxrU78kMRZyc90/Ocwxny16hQ0lFaAI9hBHxr/dytOynNPjRleeZm8bOAx DUJCCqIne+m9p8c1hyD/vOE4rnrjZlRptu9LtueIKejO45ItO7P9sb9KTjbvT+zhz41TcrcUvXZ A8ouwITpES3H2sXpEnk8zTmdr928sURRPiRguSIh5HAcfUhXs8hbog61IloT5FA6ZRIz664pL8W gHNjmID5XwIQaaWpnsosS4mEgm/ayGRsPSWh7RJTVZ8fOiSAkR+oYgXzuf+c9l3xBTuh6n2JQmk pq5GKGmwjbCwLBvf99R17bXIdpA70vykbWeEdDW21RbJHYwCTDcJZ/DW3pmq4mt9Lzf8vRX+03H fi3jSrDjAhfCiyju95fDegAXI/W9Pm4xK+EVzS5szmnTbqOmVy7OJgAI7fXsqrlcdu+a4xs9GIk usRecDhLpjmwLtESLVCGHC7xVnd8hxVYWh0t+hZVELBT9290lCm8UQvF+y3nEf2Bi3unNp5Sy5C ta58g== X-Received: by 2002:a17:907:7f8f:b0:b8a:fae9:5c60 with SMTP id a640c23a62f3a-b8dab3aa7a1mr404537966b.51.1769616653505; Wed, 28 Jan 2026 08:10:53 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:53 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:50 +0000 Subject: [PATCH v4 01/10] dt-bindings: soc: google: add google,gs101-dtzpc Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-gs101-pd-v4-1-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.14.2 The Exynos Distributed TruztZone Protection Control (D_TZPC) provides an interface to the protection bits that are included in the TrustZone design in a secure system. It configures each area of the memory as secure or non-secure. Signed-off-by: Andr=C3=A9 Draszik --- .../bindings/soc/google/google,gs101-dtzpc.yaml | 42 ++++++++++++++++++= ++++ MAINTAINERS | 1 + 2 files changed, 43 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/google/google,gs101-dtzp= c.yaml b/Documentation/devicetree/bindings/soc/google/google,gs101-dtzpc.ya= ml new file mode 100644 index 0000000000000000000000000000000000000000..a8c61ce069d6910c47753bf14a7= 92eb58e6ae182 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/google/google,gs101-dtzpc.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/google/google,gs101-dtzpc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung Exynos Distributed TruztZone Protection Control. + +description: + Distributed TrustZone Protection Control (D_TZPC) provides an interface = to the + protection bits that are included in the TrustZone design in a secure sy= stem. + It configures each area of the memory as secure or non-secure. + +maintainers: + - Andr=C3=A9 Draszik + +properties: + compatible: + const: google,gs101-dtzpc + + clocks: + maxItems: 1 + + reg: + maxItems: 1 + +required: + - compatible + - clocks + - reg + +additionalProperties: false + +examples: + - | + #include + + dtzpc_hsi0: dtzpc@11010000 { + compatible =3D "google,gs101-dtzpc"; + reg =3D <0x11010000 0x10000>; + clocks =3D <&cmu_hsi0 CLK_GOUT_HSI0_D_TZPC_HSI0_PCLK>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index a56f8f00aebb938aa765a8a6d66dfeb7f062dac8..98b2ef47c809ac0232e6941c948= 3b19d7c798bb4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10833,6 +10833,7 @@ P: Documentation/process/maintainer-soc-clean-dts.r= st C: irc://irc.oftc.net/pixel6-kernel-dev F: Documentation/devicetree/bindings/clock/google,gs101-clock.yaml F: Documentation/devicetree/bindings/phy/google,lga-usb-phy.yaml +F: Documentation/devicetree/bindings/soc/google/google,gs101-dtzpc.yaml F: Documentation/devicetree/bindings/soc/google/google,gs101-pmu-intr-gen.= yaml F: Documentation/devicetree/bindings/usb/google,lga-dwc3.yaml F: arch/arm64/boot/dts/exynos/google/ --=20 2.52.0.457.g6b5491de43-goog From nobody Sat Feb 7 09:35:01 2026 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 2639D30C631 for ; Wed, 28 Jan 2026 16:10:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616658; cv=none; b=nVoWJhhiNfDdmCq/2Vcwp0tyx8EmC6ObbpR+t2KbvcNc44GXNRaTYgphjVOI3hgx/IRVo5Q+6kO5vnHZ/hsOFE8quvKPu29ahOTb/WJsl9nCiHZaq7gXyLoK7VVsiFm6EDB/N9YbCYl6sCbmImtq9m5814DFOEFGzW7V15fZ/B8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616658; c=relaxed/simple; bh=M1WMc4bY0aH9sS6wRakI3vA4XiZlzBJdIzFnhwIKKcI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ba9w+rMVxTx1zZ3mAgn14HJb+lz3T+Ac5ItzdiI80WqyczS4cFDjAeUBGrN1yYBR2X25nAdLhWXYIgri4LD6oQGtQdDO9+d18+5vh48qwf1/m8MGxmV7lSEGacrv2QEElRTv1i7hHmgMInxDxbgZSa+vPBZtk7s10SMuSyzXXQg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=QCGdE3fl; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QCGdE3fl" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-b8707005183so3107466b.0 for ; Wed, 28 Jan 2026 08:10:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616654; x=1770221454; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gll/OtNLbOWiVZ7Gkg5CJPf2dV1v2rLa1U/xCUl6ltg=; b=QCGdE3flOmY5lA7z/CGTDgaVRgJJhCgvFzPhY+UUOLyluMevadnWBPAthao6Ob6fzt fM0ofd/t/u4DuJYNdu7J2CHa1tTjwksp0c6qr0bMC04JCUnZFdB/Ha8XsbeH722Dbgr8 q8IuQtbHDDFTtYw9/4idzi3KOJeX6vpW+xGSgZbthE6D19rCJq6nHy8w9eyXcR5Gu1Qw 8Zn/vDkz7t25RHFJAIL4JBlAE1ZZZq8UVlPJAV5yjrQT47ruwHEKE4v063h/eMKsaFoZ MoktD3oI0Lcw6pOrErNIba9U/Nj/sjQPzgJsgMkmhzwq7ca2uA1XOrEIsrEKjpwdPYQn Ugxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616654; x=1770221454; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=gll/OtNLbOWiVZ7Gkg5CJPf2dV1v2rLa1U/xCUl6ltg=; b=Dvz1Bpb5MjUQiCKhZ46BpYuZEGeX6MPRYvePlXtQPwvHHO92izoPUq45VQI76Jt6C2 4iAqN1EFVeMhKH92LLZE2YkvBMuAxx2EOxd5RKMbYbNauCwJ8FYwTft74am36mgQtyYA 5mDNOXLjXjqReZRHTHaHJsqvzVrMrP7q52QDe8E2WKxChYEslLWH+jr+F3um8m9RYMkg hGMk/3E6azIwkXCoBnnrgPJsASye91aCxHVEEuSXItPUDEi6CEH4iO5BLybZySqgwjQX LT7APxUGdOU13hhK8tKTxCctmBKaXJAkSD5LMT8bwcEriCBaer7U/PD70XRhy3eWEBsf A7ag== X-Forwarded-Encrypted: i=1; AJvYcCUMyR7XyHmtol/w8b+NkMbMU6Ho25Ip+Fs4yp1MPQxNz7IHZMoDnIi3bz+M/NfOQJ/3hDFh5so2GDQqyN8=@vger.kernel.org X-Gm-Message-State: AOJu0YzYi/2ao5VNf+1e+08xIHZZ/BA/JzR8oF/kq0WJUkRL6467MtlW uQEQnNLdFz+XWyTHwlB1Dwif23ZhRqeNwJrlVfOO4e03esP1ILevzto1vMY0+UL5eGA= X-Gm-Gg: AZuq6aL3SA+cMC3eO1zMNMGQ5QNW/YGeGTtJLkYCcmfbW1ODQzrDsOAC0sorKJzaulS 0ENACEOPHPTAu9M89xRgf9hhvSz4KCspv/I/TTpjpRh5BRrMdD7bkEz9D2DzJtL0Kl7XCERnbEO ntlA6WHwfqojoj8yO7B+9MMUb6BIbVXuAFogJkZChg+qmUP1Mu8G7eisO9KrDbe+SBpvRoRk+c8 6ydd+UchPA3h3284ISaNK6sXWM8aufKdlQR4HmzZ1Nl/v5NCM2KDFgJIhz9GVOHeKk8MB/zf6ne vvwod3v+jZ7mFJStZej9KN3k8OklxWeSQ05JHHL4CkQ3O24PSpVnDGuS83tZyby9X5/ACNO1Ooh zvPpV8Cff/AyAdE8HGy2fR7rDMLIB9tEDV5s3nbjTL1EbU5PkyTvG8icuMoyXvh05LCTAqC9VJC 0aPaFeH6wP+oy7AhnaCIsPq4dsxwBG+EHsouZfq5yfkLMa5mGuS7bLS8npMdoL40Qcql9htIFp4 YPD6g== X-Received: by 2002:a17:907:c28:b0:b72:70ad:b8f0 with SMTP id a640c23a62f3a-b8dab423008mr381662866b.36.1769616654219; Wed, 28 Jan 2026 08:10:54 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:53 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:51 +0000 Subject: [PATCH v4 02/10] dt-bindings: power: samsung: add google,gs101-pd Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-gs101-pd-v4-2-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.14.2 Add support for the Google gs101 version of the Exynos power domains. A new compatible is needed because register fields have changed and because power domain operations involve interfacing with the TrustZone protection control on newer Exynos SoCs. Signed-off-by: Andr=C3=A9 Draszik --- v4: - add new vendor property samsung,dtzpc - drop previous tags due to that --- .../devicetree/bindings/power/pd-samsung.yaml | 29 ++++++++++++++++++= +--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/power/pd-samsung.yaml b/Docu= mentation/devicetree/bindings/power/pd-samsung.yaml index 9c2c51133457112ca0098c043e123f0a02fa1291..4ba555e11b30e6a9aaed457bcb5= 7765bf5b481e3 100644 --- a/Documentation/devicetree/bindings/power/pd-samsung.yaml +++ b/Documentation/devicetree/bindings/power/pd-samsung.yaml @@ -13,12 +13,10 @@ description: |+ Exynos processors include support for multiple power domains which are u= sed to gate power to one or more peripherals on the processor. =20 -allOf: - - $ref: power-domain.yaml# - properties: compatible: enum: + - google,gs101-pd - samsung,exynos4210-pd - samsung,exynos5433-pd =20 @@ -44,11 +42,28 @@ properties: power-domains: maxItems: 1 =20 + samsung,dtzpc: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Distributed TrustZone Protection Control (DTZPC) node. + required: - compatible - "#power-domain-cells" - reg =20 +allOf: + - $ref: power-domain.yaml# + - if: + not: + properties: + compatible: + contains: + const: google,gs101-pd + then: + properties: + samsung,dtzpc: false + unevaluatedProperties: false =20 examples: @@ -66,3 +81,11 @@ examples: #power-domain-cells =3D <0>; label =3D "MFC"; }; + + power-domain@2080 { + compatible =3D "google,gs101-pd"; + reg =3D <0x2080 0x80>; + #power-domain-cells =3D <0>; + label =3D "hsi0"; + samsung,dtzpc =3D <&dtzpc_hsi0>; + }; --=20 2.52.0.457.g6b5491de43-goog From nobody Sat Feb 7 09:35:01 2026 Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) (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 B862B30DED4 for ; Wed, 28 Jan 2026 16:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.66 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616659; cv=none; b=JFFsOlShpQP83AhsJhAJstXt5TTOfEi/Tz2VRQaU+APrYuRyvB12S6e+C6bLMRRhsX0rT2Bd+1rp+07iUJCsbPRM4aLLZ2TcAlP2OeR4QXstpJlDEGuN0SzBdFQ4lwn2yJ1Yt4HaTYormk34zvyxq26hhFm8ozGBYFHsWwANLow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616659; c=relaxed/simple; bh=nWdbadZb9pkjwxX80QRMaZ4rSW9P2s4Vs9D1Jbg0i6w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dRqKkp3q44fYyKzgvBm3iZ4d9XFbpwYE3lclhQJFQsxUSW2lvnMwIYzWbISbKcYBKPx39PlpU1Zw/aXSesopV+jwrz9HOSgyxWJwoinVxyZ8x7fY8ElO8odmtMngjfQn75VEcUCwrEYGgduMkxV4JeT+Qhd4Jd+EsTzXprMjHRA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gozXOmlR; arc=none smtp.client-ip=209.85.218.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gozXOmlR" Received: by mail-ej1-f66.google.com with SMTP id a640c23a62f3a-b8845cb5862so1099958366b.3 for ; Wed, 28 Jan 2026 08:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616655; x=1770221455; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wdKVOkYHieKbKrsTLXtUc+V5Iw2Y7K5R7/tW5O3XgDo=; b=gozXOmlR4xVEnVrXqvfNihE1DtNZa0F91k18eeMERqf1kaLoYuCa7iJ8eIH7foHFJr JzG/QIVdRys10C+iNrn1yvqd9s3c7uBA+SgV1cWfwynNser0ABaMJW6MTZ0Q2jodBwF1 wS6/8IsgDx4Mzlqhhzm8NoA44tLoRDoPrTdKUuSiHfcwtA3p3yjROMJpAviGLpqAbn2/ M2M+xqmMVfr/N7fxf7o0QsdKGqwjqvGwAOp1w9cVL+8dvn1g+/T8khOulEgpb3b3s7ls EXTUxxuS3Gcp3NEB/A+cSWt3jgazSC8LA8hznHYlOn/gLR5WbQKeIVyuR4s3LrL2FDnS B7og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616655; x=1770221455; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=wdKVOkYHieKbKrsTLXtUc+V5Iw2Y7K5R7/tW5O3XgDo=; b=QyEJNSaQHnChh426Ekznl15p9UThQen0DeK8XLwh0pUAUuy7mYqpIIzco9mAyW1K69 VQrOaJcGEzkkhj6CONhKFWub6el0D7xtfw36Ud0gbZfelTxFg85AhjcfOEowlcvSuwqH 0CPf1aV3MiqK2vm2jkwYYNe8Wag7gyPjosMGHo1Isu3PnDQttfcVOqKPQrb1nTLdOAdN pdpAV17ZK2rXt8K0vmokkCaVN7iQhCaPzIdgWRTxOjqBbXjSILQVjv2pvR7VZCmzy/DK xNDkgEPj8glMlUDlTKBMELSP+doSd/5rWrDXw/VX9W9FhD4HO/CSrtaF2w3U9mN5sUOI nK3A== X-Forwarded-Encrypted: i=1; AJvYcCVWQOA5FFTJK3i7YB6bylDgFlnQJoajcTxqVJYwklNxmPOqIEdsI3B3sqpKJMgSm/sxGdE3e4VsABFwm+Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6E2ixgVaGd+5+UmJjeqkbAtdkwbfFwDnbS5ZqpSGrSFl/1Gk5 cv5ZlkS7yzQ3cDgZ/4d9wNMhTDN/mDwhBISQbyXdgU68e4yBSgiwbiSgDlD0hMjQT84= X-Gm-Gg: AZuq6aK2I7lPwU79w7+H/KL3AgAcQZ1QbXyWaOPWfwSQSARyktBMgM+rPPWvPKPlnb5 ZRDHQ6MfZvYCeP4KmR//9V905jp92qlUKKnu9oUgZiSsfjBFnngo0spAVPENjnrAa+wrqlx2hIl agx/oN+4p4L3qQxltudFnh2SvV9uumzoxzXc/plcioeByiRm4LG+yfsmVUx64bt5bK7XCEnuHoC 71lUJhwTNAdkZTJGv3AOJfsFAtwPIcp1ODvrP8brmTF9up6no1DB43pYv8yYSsSskp8xFH/XGGD e4d70WFJxb88hRwmi8Rtdqr/BOQMELFzCcUDsCeUJSdXDh8KGsmnVmFFUdLYpYtasIsNyLdNIWb M29N9DfHOGkCu97/1M7a33Ee5dqRSujTl8js6vVM13FQoljZ+XPdwLh30462vjaHbi1nz4m+wWz Ex1HV9LiVhLf/6czS2FL3JOGYFMvxkXBCaac6QnFS+QG1SisE9cOVsi6kSaQm6hiu66j7oFlasX uTHkw== X-Received: by 2002:a17:906:2083:b0:b8d:c595:828 with SMTP id a640c23a62f3a-b8dc59517edmr136595666b.14.1769616654759; Wed, 28 Jan 2026 08:10:54 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:54 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:52 +0000 Subject: [PATCH v4 03/10] dt-bindings: soc: samsung: exynos-pmu: move gs101-pmu into separate binding Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-gs101-pd-v4-3-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= , Marek Szyprowski X-Mailer: b4 0.14.2 The gs101-pmu binding is going to acquire various additional (pattern) properties that don't apply to other PMUs supported by this binding. To enable this, move google,gs101-pmu into a separate binding. Tested-by: Marek Szyprowski Signed-off-by: Andr=C3=A9 Draszik --- v4: - update since 'syscon' was removed from gs101-pmu compatibles - update since 'select:' was removed from google,gs101-pmu.yaml v3: - use additionalProperties, not unevaluatedProperties - fix path in $id (Rob) - drop comment around 'select' (Rob) --- .../bindings/soc/google/google,gs101-pmu.yaml | 56 ++++++++++++++++++= ++++ .../bindings/soc/samsung/exynos-pmu.yaml | 20 -------- MAINTAINERS | 1 + 3 files changed, 57 insertions(+), 20 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/google/google,gs101-pmu.= yaml b/Documentation/devicetree/bindings/soc/google/google,gs101-pmu.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a06bd8ec3c20faf0b364d3d3ef1= 763502c2b09cf --- /dev/null +++ b/Documentation/devicetree/bindings/soc/google/google,gs101-pmu.yaml @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/google/google,gs101-pmu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google GS101 Power Management Unit (PMU) + +maintainers: + - Andr=C3=A9 Draszik + +properties: + compatible: + const: google,gs101-pmu + + reg: + maxItems: 1 + + reboot-mode: + $ref: /schemas/power/reset/syscon-reboot-mode.yaml + type: object + description: + Reboot mode to alter bootloader behavior for the next boot + + syscon-poweroff: + $ref: /schemas/power/reset/syscon-poweroff.yaml# + type: object + description: + Node for power off method + + syscon-reboot: + $ref: /schemas/power/reset/syscon-reboot.yaml# + type: object + description: + Node for reboot method + + google,pmu-intr-gen-syscon: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to PMU interrupt generation interface. + +required: + - compatible + - reg + - google,pmu-intr-gen-syscon + +additionalProperties: false + +examples: + - | + system-controller@17460000 { + compatible =3D "google,gs101-pmu"; + reg =3D <0x17460000 0x10000>; + + google,pmu-intr-gen-syscon =3D <&pmu_intr_gen>; + }; diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml = b/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml index 76ce7e98c10f3738e7de5579904260dd906507c9..09368dbb6de6898e2988c398b25= 06f2c2b4e73bc 100644 --- a/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml @@ -12,8 +12,6 @@ maintainers: properties: compatible: oneOf: - - enum: - - google,gs101-pmu - items: - enum: - samsung,exynos3250-pmu @@ -110,11 +108,6 @@ properties: description: Node for reboot method =20 - google,pmu-intr-gen-syscon: - $ref: /schemas/types.yaml#/definitions/phandle - description: - Phandle to PMU interrupt generation interface. - required: - compatible - reg @@ -176,19 +169,6 @@ allOf: properties: dp-phy: false =20 - - if: - properties: - compatible: - contains: - enum: - - google,gs101-pmu - then: - required: - - google,pmu-intr-gen-syscon - else: - properties: - google,pmu-intr-gen-syscon: false - examples: - | #include diff --git a/MAINTAINERS b/MAINTAINERS index 98b2ef47c809ac0232e6941c9483b19d7c798bb4..79a58769e9cb33d9bd6190c74d5= 5461e77965af5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10834,6 +10834,7 @@ C: irc://irc.oftc.net/pixel6-kernel-dev F: Documentation/devicetree/bindings/clock/google,gs101-clock.yaml F: Documentation/devicetree/bindings/phy/google,lga-usb-phy.yaml F: Documentation/devicetree/bindings/soc/google/google,gs101-dtzpc.yaml +F: Documentation/devicetree/bindings/soc/google/google,gs101-pmu.yaml F: Documentation/devicetree/bindings/soc/google/google,gs101-pmu-intr-gen.= yaml F: Documentation/devicetree/bindings/usb/google,lga-dwc3.yaml F: arch/arm64/boot/dts/exynos/google/ --=20 2.52.0.457.g6b5491de43-goog From nobody Sat Feb 7 09:35:01 2026 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 8CA1630F552 for ; Wed, 28 Jan 2026 16:10:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616660; cv=none; b=fNz4g961GnGUMdwBXvxUpxZTEbgeksmUvbrpG2fBAVWNRw7ZSb4uFMOC8WxgQ9arDnyrv487kf08uxENYJItd+hMaQHNyhCYhMwVPtmib0G9HnPGwXwFWfxtbtux6SOvJYDmBZ2LzUinNRNPVBw4x+91wnQBJ4dCVEZKO90y3Uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616660; c=relaxed/simple; bh=wjPITGHpFGOjs4GBxlDoptuom/l/Q78c7MNS9UVGVac=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nUTpnWL2Z3tlHdUaBmwZG+VE2+pQBtAcLihFwNr8pn4tka6h0nSJ9B5EFwakUl0a3qN5ggOYfl9u/1JmOcS4e1xK6ZcUxwR4LOZLOK2h68z84EANDDPtkCMxjwYyHA/N/N26EmM7g4rWyw6ojNXmjqEmAeMN3+uFeszBnoJIBVM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=z4piCGdm; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="z4piCGdm" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b885e8c6727so215644966b.1 for ; Wed, 28 Jan 2026 08:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616655; x=1770221455; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=CYVOKvbh+cV5QpKAWjih0XGIXXiGAQB69mHgAD7pq/8=; b=z4piCGdm8kMXQje7iWnuiESnv1MNEkLN6vKf/Z6CJxP2q1h/ziIPp1b93mvG0sxwYh CXUhtJwMKVFOlOO7ZiMfWRZjQT734pAiquV1jK52NyFGP2gsSKScX5FSp0K0JrgFYkmD w0VHaD2cCvPzKD4J7Essgt+UcHKbirud69CRSIUeUoP4Z0qiYK8ZD8HaPDcaDq3laa4h TGDZZP0kw7b/DPf432YoxfKFE7lUE4/kQn9mFgjdaV3UQ34sT4shPlpjUgBMfMl5Etzk KnBKYZiz9wHdH4idzKJZiS9/uwlPOSWUvWDtk0frKy8NFg41IaedeKXeKXGQPYxueHnQ rr5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616655; x=1770221455; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=CYVOKvbh+cV5QpKAWjih0XGIXXiGAQB69mHgAD7pq/8=; b=BY3pdRvw0fCBK8fvJ3sb6ofmfTz6WUzRwI2AmrrTdHrFXQP5qvT7/LOq9Jr+vyG1TH iiJNg9Bi+VJDXyEkZ81lNPr2t5bg7xAf9reABmST8jL+tQLQ0p6Iup8WoHEC8BRnDoh0 MqAIzUAds6AeB7UHYnfGhvJ8UIra4vcAN57F4UcE5pldtwrsFV3z62IkueHKUF4apCr3 sWIFpujEo1zaVOrXmD8SmftbN7FerST9rL8lE2+trG6YjugxtqJYcG2K5XXAS85AdwUq rcMtSwRvv+jNq+ND579+NgUchqE8EKsJMzHz4s1kwaj2gbofc/5PCKEGNDcgqVQ3amfY YNqg== X-Forwarded-Encrypted: i=1; AJvYcCULMR846yo0SUe9qVD9pg1E5PY2GSXZzs1ttTXilYLGwaRP7jvSYoO2xGK9tkgPE9Qc+teAd6lIyR1TLj4=@vger.kernel.org X-Gm-Message-State: AOJu0YzqXznBaRMt9OEYmVrRE03D+bPfnuDeucJUMB/wa8oq3k2gSTDj cQBI0J+dZQbsgdS8A95QHQnAdwp97O5rFCrJBKV6ZhNfAgzS2SKFFlLrTGoA1JS02eI= X-Gm-Gg: AZuq6aJC+V2XCRwxpewt4ILAXi3kQeKOllSUqybP7dzxTC2hIEapEyG3hniwxjLpnJr 28PdSx/pfrJzKVvR/paoJMJF1ptzUOL8g6UUfBagObtJxfCwtkFlV0KI/E2u7JEjXMMSCQpsdj4 +0uTZ03UZd1aPLvNRSVC53jtC6RsLsQWfcf1e+UmHx3H2XNLD5jzx3nUs9kxWpffWlQYmWJTW8h AIEvlf00CN9MzYH91nwuf93TOwnh3UecfaLzQoSPn0Knd1UCtIXP+ivRAr84uBCa3TrWxUBusm6 XyfRnLbIetfOqvioae4myXONtdbbbrtlbSP+vf4tuWi3L07ulJk2UdPSCfXJgldbjKcey1moxHA 4QoLoTxhDkmdSYzBa/0ONJwtceel7IjgK6Lw+uEj032kaJaLMWwzF2ZBRLnDfpn0/YMCSbSYuSy 0lj8wu2/5uUBz9aydEpOl3u6HnXRsrrS6csy/J93s1hFq74/oRIY7yBDikHpg+oIL4i1o/bpcUb ittoqy4OqNRs4aa X-Received: by 2002:a17:907:3f21:b0:b88:20c0:d37f with SMTP id a640c23a62f3a-b8dac9aacf6mr387798666b.9.1769616655313; Wed, 28 Jan 2026 08:10:55 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:55 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:53 +0000 Subject: [PATCH v4 04/10] dt-bindings: soc: google: gs101-pmu: allow power domains as children Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-gs101-pd-v4-4-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= , Marek Szyprowski X-Mailer: b4 0.14.2 The power domains are a property of / implemented in the PMU. As such, they should be modelled as child nodes of the PMU. Tested-by: Marek Szyprowski Signed-off-by: Andr=C3=A9 Draszik --- v4: - consistent quoting using " (Krzysztof) - add samsung,dtzpc to example Note: Ideally, the newly added properties (ranges, etc.) should only be 'required' if "^power-domain@[0-9a-f]+$" exists as a patternProperty, as they're needed only in that case. As-is, this patch now causes warnings for existing DTs as they don't specify the new properties (and they shouldn't need to). Only if DTs are updated to include power-domains, such an update should also add the new properties. I've not been able to come up with the correct schema syntax to achieve that. dependencies, dependentRequired, and dependentSchemas don't seem to support patterns. Similarly, - if: required: - ... then: required: - ... doesn't allow patterns in the 'if' block (or I didn't get the syntax right). Rob said in https://lore.kernel.org/all/20251010141357.GA219719-robh@kernel.org/ that this is a known limitation in json-schema. --- .../bindings/soc/google/google,gs101-pmu.yaml | 41 ++++++++++++++++++= ++++ 1 file changed, 41 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/google/google,gs101-pmu.= yaml b/Documentation/devicetree/bindings/soc/google/google,gs101-pmu.yaml index a06bd8ec3c20faf0b364d3d3ef1763502c2b09cf..c1ee9575092a3ab17873d228a88= 468addb62d838 100644 --- a/Documentation/devicetree/bindings/soc/google/google,gs101-pmu.yaml +++ b/Documentation/devicetree/bindings/soc/google/google,gs101-pmu.yaml @@ -16,6 +16,14 @@ properties: reg: maxItems: 1 =20 + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + + ranges: true + reboot-mode: $ref: /schemas/power/reset/syscon-reboot-mode.yaml type: object @@ -39,9 +47,23 @@ properties: description: Phandle to PMU interrupt generation interface. =20 +patternProperties: + "^power-domain@[0-9a-f]+$": + type: object + description: Child node describing one power domain within the PMU + + additionalProperties: true + + properties: + compatible: + const: google,gs101-pd + required: - compatible - reg + - '#address-cells' + - '#size-cells' + - ranges - google,pmu-intr-gen-syscon =20 additionalProperties: false @@ -51,6 +73,25 @@ examples: system-controller@17460000 { compatible =3D "google,gs101-pmu"; reg =3D <0x17460000 0x10000>; + #address-cells =3D <1>; + #size-cells =3D <1>; + ranges; =20 google,pmu-intr-gen-syscon =3D <&pmu_intr_gen>; + + pd_g3d: power-domain@1e00 { + compatible =3D "google,gs101-pd"; + reg =3D <0x1e00 0x80>; + #power-domain-cells =3D <0>; + label =3D "g3d"; + samsung,dtzpc =3D <&pd_g3d>; + }; + + power-domain@2000 { + compatible =3D "google,gs101-pd"; + reg =3D <0x2000 0x80>; + #power-domain-cells =3D <0>; + power-domains =3D <&pd_g3d>; + label =3D "embedded_g3d"; + }; }; --=20 2.52.0.457.g6b5491de43-goog From nobody Sat Feb 7 09:35:01 2026 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 E4BD130FC06 for ; Wed, 28 Jan 2026 16:10:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616660; cv=none; b=CU9FuvfvgDiCV/NEbi2TXTVbU8QzX1oGwN6jNPGBvPPnrvhNAO03tVXYL/Ek7kQHfAWA38UcOaR9YVcSQLbKAXVPyKazaOT6rSVCKivFzKYUOo9PRfY7C7044TFgNDx96QZ8HADmJwP02Nkjl3xWdnjs2B+4sLVbsgxOgydnN2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616660; c=relaxed/simple; bh=1cbyw29+xdi8VXIGles1S+s4A3CgVUMNo3a+m/ox1qA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iLO2KdkYGlwqk4sLBL+9jaSwTkwfH6mdMjvBPgFrUEeSyAoVyFZ342LWrRXq6RW2yKxeEmsAr/XbvQMwG1HgOLYzz3lov/u6RwJoUWH07uAIGgJxefQ6FY1Om45OtRUiHx6BfAy5wp+dK0WO5riE7qZbZP634MsqtyJugQMaDcc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=MQF3g+JB; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MQF3g+JB" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-658b511573cso85014a12.0 for ; Wed, 28 Jan 2026 08:10:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616656; x=1770221456; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hrnmD1pfTiX6z7osCVBlK0GrbNSN19fk3oj2Jxgvus8=; b=MQF3g+JBp6VjcnE4HMLsJN7dD1HTRVVUvzKaIiNw6nxWtQMcxlc6e+hoVf7MPOaz42 Cn9gr+6b6POJSD2CDTNnHh1sNKCSv0sNJIECFegrpHvlw69OW2ZW8NUwZnOF6uu+X5IM 0iPDlTodmsAsO1KMo5fdkv0upNHgLT/MF1OLswBWwbRdsaTZw8pIvIJPm6/PWXkaZYMU OPIcFIRxQAK3EdrwAmkZ+YpzFZrVyQTs9/WV/2HCVX48ZTx8uXccA0nle6UzldmA1VPT 9/GYcth90FSZ6kYPQi/mOh0wgNqZIqpuc+wiNvOr0QqZUxk39FqbmJWIaXYquHeG5P+r xPNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616656; x=1770221456; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=hrnmD1pfTiX6z7osCVBlK0GrbNSN19fk3oj2Jxgvus8=; b=M2IDS+jjSi0zWQghCQKmBc4JLDkBJ3MBWJussSezqvUeqMhdINovz7Ws/hYEuAe8DG w+GFdl0/GnJlylOR1mKLvkCdL6N4o5GLolIuMnppJv9KRbqinvsfD5bPGzSLtRDJ5fLh 51ZDC9TjY7ha7jGCHPa0zU9DRu7+Lg2gcU5P1M32JaRlxkuf8gLwAwyWN9ieJrSKQUjI 2vZG7auP5I3fX/WWSrd9VWBaFnifjzjkVzF8e4DT3oSmqrPcfustjkZwpT7u3HX+j36K eoauswaE8Cv+Fv1WLprgQVLEaY7H400P1zdwZLUlpopFgKk0hmBHnxBsK9yt0d/SYgij ZfkQ== X-Forwarded-Encrypted: i=1; AJvYcCViH9F8yu4sxhiXJunAKsgY+d4T1yu9kRhqc3RYEa5CT6Hu8SVY/u11iuvtwGovDwEBWkCgIr59mYqWThs=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6rdQ2WngT3KJ0PdQFyiDypfZWHTKNwAjLVl7rgEV4A45Khy4a G6i9INdXgyCq5e7Mt5zOsAuzR6LT/oAvnoVn/lCUTDPlEX05woffFxAqyNeJuMpzOns= X-Gm-Gg: AZuq6aKOcM2uKDX4QY5gnyqAk5SF724Owp7H0I+h0G85QtJbYlsxkTRSsJHIHQmYCG1 D1ychUXSAr8vGSBlol9pTcPylGKcB1eacBP7IveBLXVWlTLZGFRqHgG5iCkW59X5pzmcIl8Dk3A xw/rNlvEjxl9u8JMc4W2Pg50pkTW20LNcMyd3xXVLJxAa1stEggjoeccgh97q7E/KQZFaJXtiTH fb3e4Yftxa2fRY57lg4CvZCJzy5xPVmmPgcouZF9d6Aap0b8eF62S3WI+meAc0NzKLbKJkFBh7c VE5Ul8J0//9itx1HewftokzesHkkJ1rQObCKKybgfbBWaNfnSAdczRPLDXZij4LJp+UQmvboR2g XT/tR/2EPtadxQQ1p45lmwTlON0jo/0rUsBtot1Pr9uA+vrmxEalxgutDkjwzFWxQKXfyTCDixq DlU5hH2UTqqyISw9XKZYyn5Ae2wf7S6Rj8QGbCszY+GSkFoqa93oNeFhpwe2+AWJ5lI8DTDm+eD I4Sbw== X-Received: by 2002:a17:907:7207:b0:b72:a899:169f with SMTP id a640c23a62f3a-b8dab10cba8mr453205966b.4.1769616655855; Wed, 28 Jan 2026 08:10:55 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:55 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:54 +0000 Subject: [PATCH v4 05/10] pmdomain: samsung: convert to using regmap Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-gs101-pd-v4-5-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= , Marek Szyprowski X-Mailer: b4 0.14.2 On platforms such as Google gs101, direct mmio register access to the PMU registers doesn't necessarily work and access must happen via a regmap created by the PMU driver instead. In preparation for supporting such SoCs convert the existing mmio accesses to using a regmap wrapper. With this change in place, a follow-up patch can update the driver to optionally acquire the PMU-created regmap without having to change the rest of the code. Tested-by: Marek Szyprowski Signed-off-by: Andr=C3=A9 Draszik --- There is one checkpatch warning, relating to the non-const regmap_config. It can not easily be made const at this stage, but a follow-up patch allows us to make it const and the warning will go away anyway. v4: - rework the loop in exynos_pd_power() slightly, to not return 0 early to allow more code to be run after pd on/off register write without changing the loop again, required for gs101. - add error message in case first regmap write in exynos_pd_power() fails --- drivers/pmdomain/samsung/exynos-pm-domains.c | 83 +++++++++++++++++++++---= ---- 1 file changed, 62 insertions(+), 21 deletions(-) diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomai= n/samsung/exynos-pm-domains.c index 5c3aa898308793d424fb761c58ca01ba2580aeb5..3bcba7d38ac1572ef4bc2f4052c= 904dd6c4a7bfd 100644 --- a/drivers/pmdomain/samsung/exynos-pm-domains.c +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c @@ -9,15 +9,14 @@ // conjunction with runtime-pm. Support for both device-tree and non-devic= e-tree // based power domain support is included. =20 -#include #include #include #include #include #include #include -#include #include +#include =20 struct exynos_pm_domain_config { /* Value for LOCAL_PWR_CFG and STATUS fields for each domain */ @@ -28,7 +27,7 @@ struct exynos_pm_domain_config { * Exynos specific wrapper around the generic power domain */ struct exynos_pm_domain { - void __iomem *base; + struct regmap *regmap; struct generic_pm_domain pd; u32 local_pwr_cfg; }; @@ -36,31 +35,42 @@ struct exynos_pm_domain { static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) { struct exynos_pm_domain *pd; - void __iomem *base; u32 timeout, pwr; - char *op; + int err; =20 pd =3D container_of(domain, struct exynos_pm_domain, pd); - base =3D pd->base; =20 pwr =3D power_on ? pd->local_pwr_cfg : 0; - writel_relaxed(pwr, base); + err =3D regmap_write(pd->regmap, 0, pwr); + if (err) { + pr_err("Regmap write for power domain %s %sable failed: %d\n", + domain->name, power_on ? "en" : "dis", err); + return err; + } =20 /* Wait max 1ms */ timeout =3D 10; - - while ((readl_relaxed(base + 0x4) & pd->local_pwr_cfg) !=3D pwr) { - if (!timeout) { - op =3D (power_on) ? "enable" : "disable"; - pr_err("Power domain %s %s failed\n", domain->name, op); - return -ETIMEDOUT; + while (timeout-- > 0) { + unsigned int val; + + err =3D regmap_read(pd->regmap, 0x4, &val); + if (err || ((val & pd->local_pwr_cfg) !=3D pwr)) { + cpu_relax(); + usleep_range(80, 100); + continue; } - timeout--; - cpu_relax(); - usleep_range(80, 100); + + break; } =20 - return 0; + if (!timeout && !err) + /* Only return timeout if no other error also occurred. */ + err =3D -ETIMEDOUT; + if (err) + pr_err("Power domain %s %sable failed: %d\n", domain->name, + power_on ? "en" : "dis", err); + + return err; } =20 static int exynos_pd_power_on(struct generic_pm_domain *domain) @@ -109,8 +119,18 @@ static int exynos_pd_probe(struct platform_device *pde= v) struct device_node *np =3D dev->of_node; struct of_phandle_args child, parent; struct exynos_pm_domain *pd; + struct resource *res; + void __iomem *base; + unsigned int val; int on, ret; =20 + struct regmap_config reg_config =3D { + .reg_bits =3D 32, + .val_bits =3D 32, + .reg_stride =3D 4, + .use_relaxed_mmio =3D true, + }; + pm_domain_cfg =3D of_device_get_match_data(dev); pd =3D devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); if (!pd) @@ -120,9 +140,26 @@ static int exynos_pd_probe(struct platform_device *pde= v) if (!pd->pd.name) return -ENOMEM; =20 - pd->base =3D of_iomap(np, 0); - if (!pd->base) - return -ENODEV; + /* + * The resource typically points into the address space of the PMU. + * Therefore, avoid using devm_platform_get_and_ioremap_resource() and + * instead use platform_get_resource() and devm_ioremap() to avoid + * conflicts due to address space overlap. + */ + res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return dev_err_probe(dev, -ENXIO, "missing IO resources"); + + base =3D devm_ioremap(dev, res->start, resource_size(res)); + if (!base) + return dev_err_probe(dev, -ENOMEM, + "failed to ioremap PMU registers"); + + reg_config.max_register =3D resource_size(res) - reg_config.reg_stride; + pd->regmap =3D devm_regmap_init_mmio(dev, base, ®_config); + if (IS_ERR(pd->regmap)) + return dev_err_probe(dev, PTR_ERR(base), + "failed to init regmap"); =20 pd->pd.power_off =3D exynos_pd_power_off; pd->pd.power_on =3D exynos_pd_power_on; @@ -137,7 +174,11 @@ static int exynos_pd_probe(struct platform_device *pde= v) of_device_is_compatible(np, "samsung,exynos4210-pd")) exynos_pd_power_off(&pd->pd); =20 - on =3D readl_relaxed(pd->base + 0x4) & pd->local_pwr_cfg; + ret =3D regmap_read(pd->regmap, 0x4, &val); + if (ret) + return dev_err_probe(dev, ret, "failed to read status"); + + on =3D val & pd->local_pwr_cfg; =20 pm_genpd_init(&pd->pd, NULL, !on); ret =3D of_genpd_add_provider_simple(np, &pd->pd); --=20 2.52.0.457.g6b5491de43-goog From nobody Sat Feb 7 09:35:01 2026 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 E74A630DD3A for ; Wed, 28 Jan 2026 16:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616662; cv=none; b=Ks+fVm6LKSkRAYjzLTf4uPzmO0HqxvpKIsO6uSNXeDuFnczBxSheIpLka8GRsPxUl/3cviJDuy9J8siuR7S9IvD2W4w/Z+nVO1fgFFr1gtJazHecXy051PLffo6HkuLu9ON9eey3BSNKJ6M9Jvg0o/t9l3CLjI4H7eDGUmxEgqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616662; c=relaxed/simple; bh=ZYxzBg9tkVWzCzaxuPaae5TIGD91nZXT5GPxtR4tPNQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tQmPIpomv/U6zXjKXgVWfgDiecy6CIDAnimdNg8pJiIKUaaClDlny5NCxkEUcOEqLBoa7SrnulXDMKhfXUthzjHqKygaPXihU1INQmUrYiEPjTBVatx+2x8SLrrRWIloXTvFTZSBEo4MDYicpEaf8B0Oriq5xwLuzFmFCGy5sxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=aOwci1JH; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aOwci1JH" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-64b92abe63aso123286a12.0 for ; Wed, 28 Jan 2026 08:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616656; x=1770221456; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=9J9mAVn8R3b4lSWOfrbKrodX1tmUBpKSiHbvrB/eirA=; b=aOwci1JHIkQcJgyHu9Y1mf2aJ3de79GIiCo4W27OV7FX/DAPhEPUF14G1MfhlPyx9u EjpXgHy2y2d3sqzYCemE835xJKRA+XllCN2WMtrqi4ViqpA5ArmZkFaUaLkN1/2RrjGb oj5bTs7rWnv/UWtOT01HtTcES/4p/ZATxkkQFKH5+Xq8dhBBbiMv2nOl8UJTdDg90Mmy 2MpfTFKhDIODwAx7w/P+iGb81mCNtCTbFdloi49fjMPNnUOnKjToL2PXwGrZ/eu1wsin 9qNSJ1pJXPZL4WP9ETPS3J5E/memQx6n4prPrWK5XHyBmsSwZUdYHPeD4OvvXuzR1rAb yDiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616656; x=1770221456; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=9J9mAVn8R3b4lSWOfrbKrodX1tmUBpKSiHbvrB/eirA=; b=h7L2YvReZJW5EsMRt9Vq6Iz/9an8xdsXHCqHUH39uJ83gNj3GXkpfyKLW8KnosLw1t 4tGZm8PtIMXE5vYeAvy6TuwAZ5uV6oxIT15CtP1VCqMqzvATIukRR1CKeLiRF9Gk7CEg gGAoLplmKaOqlwrRdsjRhln/NGjwUsHlvwc46LcRCVsdba8yRr0yao2lHLg57DKaE9vj EAqslPgci+IWXayxr0trVU+CJo37A9awMl1qGP/9vDqa8ySjJVSyYA/IRZqIeuYlGy1q f1VWv7TgK6DUR4WbEk56H/XmzvVRNw1gtD2M+YatbRj7nvxjF4r3i6BJODpH/H1EbRfd Qcxg== X-Forwarded-Encrypted: i=1; AJvYcCW+npL8T1MNaFwHWCCiMkF7geqMZQ2GWaIuwWxOSOPrv2fPjAyMuQubsMaheioSoCDgB1090bOyuauFwIA=@vger.kernel.org X-Gm-Message-State: AOJu0YwycCfjImsVpy4GNgugzwPfK6+27uARtN29XcGxWL1nzafTVWBD bFFfWCAd7VEcwrILWaLKYtoiMRwJjrwKrbauwgpZAoRHqmYaq6LTrJh2m7jjuiBGi7Y= X-Gm-Gg: AZuq6aLBuEWN7AzP5ie/qpRJq6ql9BY+CuNLMTUI0jNECMHMvoek0NDyeHa0du4zGGq X0qR2Rst4IpRBP+/tnjV4IvxRz9pnfrAdxLZ866MGP8g5jVklRioOGTguiPmddmQiyVTgWjnyUD fwzkX0G4HNbFzLSz1yQpWhI2BmrRMSj3L55tr3hT+Qn/qUv9C/19F+nAGBoq4l6HIjJkmZuO5T9 HYnYPs+y+Cgojv2TGkrvITjSvVPNNcnBqZNccQJUMQP++Vas5KwZMFj+eBcRv0de5ADv4jPtapb e6j5mF7DFcfAicPV+rcN6LTpTfxZaIUW8tW/B+Eim8dAJo2/bi8LuAV3jxDOWxWU7yW0YsqE67r 9kiZP/eP/wjS0LCWI4AomU6Rkpg+hq+hdvi1yC0lfaYhjjBVWducJsQT9iwCxq1VmmBfmyuU3kE lonrTA+p5z2x7Xd1y57ZMoFg3G5k1a2POlqbjO4O6QGOegRIDpvrjwrT0ED7rv15ovwpqyWtqVi zOejVTaNivZ9kql X-Received: by 2002:a17:907:3f93:b0:b87:892:f43b with SMTP id a640c23a62f3a-b8dab4455a7mr396560766b.42.1769616656353; Wed, 28 Jan 2026 08:10:56 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:56 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:55 +0000 Subject: [PATCH v4 06/10] pmdomain: samsung: don't hard-code offset for registers to 0 and 4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-gs101-pd-v4-6-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= , Marek Szyprowski X-Mailer: b4 0.14.2 On platforms such as Google gs101, direct mmio register access to the PMU registers doesn't necessarily work and access must happen via a regmap created by the PMU driver instead. When such a regmap is used it will cover the complete PMU memory region rather than individual power domains. This means the register offsets for the configuration and status registers will have to take the power domain offsets into account, rather than unconditionally hard-coding 0 and 4 respectively. Update the code to allow that. Tested-by: Marek Szyprowski Signed-off-by: Andr=C3=A9 Draszik --- drivers/pmdomain/samsung/exynos-pm-domains.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomai= n/samsung/exynos-pm-domains.c index 3bcba7d38ac1572ef4bc2f4052c904dd6c4a7bfd..8df46b41f9bc8f0b2a03300169a= 4b52457faaf4d 100644 --- a/drivers/pmdomain/samsung/exynos-pm-domains.c +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c @@ -30,6 +30,8 @@ struct exynos_pm_domain { struct regmap *regmap; struct generic_pm_domain pd; u32 local_pwr_cfg; + u32 configuration_reg; + u32 status_reg; }; =20 static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) @@ -41,7 +43,7 @@ static int exynos_pd_power(struct generic_pm_domain *doma= in, bool power_on) pd =3D container_of(domain, struct exynos_pm_domain, pd); =20 pwr =3D power_on ? pd->local_pwr_cfg : 0; - err =3D regmap_write(pd->regmap, 0, pwr); + err =3D regmap_write(pd->regmap, pd->configuration_reg, pwr); if (err) { pr_err("Regmap write for power domain %s %sable failed: %d\n", domain->name, power_on ? "en" : "dis", err); @@ -53,7 +55,7 @@ static int exynos_pd_power(struct generic_pm_domain *doma= in, bool power_on) while (timeout-- > 0) { unsigned int val; =20 - err =3D regmap_read(pd->regmap, 0x4, &val); + err =3D regmap_read(pd->regmap, pd->status_reg, &val); if (err || ((val & pd->local_pwr_cfg) !=3D pwr)) { cpu_relax(); usleep_range(80, 100); @@ -164,6 +166,8 @@ static int exynos_pd_probe(struct platform_device *pdev) pd->pd.power_off =3D exynos_pd_power_off; pd->pd.power_on =3D exynos_pd_power_on; pd->local_pwr_cfg =3D pm_domain_cfg->local_pwr_cfg; + pd->configuration_reg +=3D 0; + pd->status_reg +=3D 4; =20 /* * Some Samsung platforms with bootloaders turning on the splash-screen @@ -174,7 +178,7 @@ static int exynos_pd_probe(struct platform_device *pdev) of_device_is_compatible(np, "samsung,exynos4210-pd")) exynos_pd_power_off(&pd->pd); =20 - ret =3D regmap_read(pd->regmap, 0x4, &val); + ret =3D regmap_read(pd->regmap, pd->status_reg, &val); if (ret) return dev_err_probe(dev, ret, "failed to read status"); =20 --=20 2.52.0.457.g6b5491de43-goog From nobody Sat Feb 7 09:35:01 2026 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 5636F313295 for ; Wed, 28 Jan 2026 16:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616662; cv=none; b=TwMEhARQ6xueLKYIZqdaRR0grBsDqc+IPamVnpZmwjUnkUoOoiyX6o0shdDdPrYJkUZzOUQ5m1JVkPnHCKah0uQWYx3brOklH+Pwj1EnjAvry7ZeIHYIKCfJ3Y82lqqQmr6zz3gZ2JiMFgntoOTvU0PCrNVEn6zk9HC5sXwQ6gM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616662; c=relaxed/simple; bh=A57iIyprnVVgXhFe5kC51yr0jTxIdK2LZO5HdrKp1WA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OZNBS6VbdtrmEwEbSOsqMmQng0J9gEBsxD7Z1xDgnQoVLf1/3bpjJnBa76GWLdlv7AcnPs0bdB7aNQTch/Rx23I8ZOrWXi2ZB0IKD2YkeIjiBLWu/+MgQA5l0Thbyj/AFqRcZNaDZPylzLImjxnnSRooIxrQqoiXWE5L0npZ9JY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=MCmkrr8d; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MCmkrr8d" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b8715a4d9fdso2716866b.0 for ; Wed, 28 Jan 2026 08:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616657; x=1770221457; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=iN7RPaetGrCUTSxMSp2jttEhwD8uGc4/qT3ZtQUJgjk=; b=MCmkrr8djzNFnlcajREnK5/+2Uz/mFERo3i0dQDr6UMYz2mNtOx210O7IoaamFcPtz lPdPQ48sEQOVbC2l7KsbN/P5d8w8Erh4kYUmL9VMqfWxEQFMKs/A0LFPXPWyLptUZL6y utOh2H7mYeOxO3WgpKkmiDDwhNv1Np180OiSnUQaY0D76olHPoGgwmwYckvKkjJLXwMN FdFVnWyyHqK1XAWUnEhOXyDMLIv9lQLCQmOTw67bUbM/JxhUsPPXBXQ6ZMKUUkfz5unr MlQIz+IyJihIL4LA/j/P4St6tus1x8ElmbYlij4wNe2aE83GLbUxz+1xf7yVJCYz3tCf pqHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616657; x=1770221457; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=iN7RPaetGrCUTSxMSp2jttEhwD8uGc4/qT3ZtQUJgjk=; b=WQ6bAhYB5Ao94Fi3OaJd56hEyE6blGaOHVTwOLeePSGTAcVLBqrRYlHKdfHAQ2DZxj c/8GBrIlh1q4REO3wVabZQMDcaPnOPXyNzm8wOgYp/ogvW8lNC5uOrV2dBkaor5M/ejN RW1rstL+i8e5Zr+aVnwZk+sKZLinrEaXIOblb4AXBYg4XCcZv06TPF+P0J7hfrtT3sgf +G9QOulWph/djmBox69y5djU9MIZ5p+6Hz/tr3BiDpeT3pBrZoM6O6M2QUcW1T2oBE4s NkrBO6CpQSe36MiNarDcoBxASFDS4Rdndlu5DXi2tq5jAT0pl+5+6etUhvTH1V2Ahrum YF6A== X-Forwarded-Encrypted: i=1; AJvYcCVQ/51unHjfKvO9dcYWiDW/C0Saxrht1yM+BLwDlBPoaAg0TEYZB9ENVNItFFbCXvJJTWLLpp9ATl2HrIA=@vger.kernel.org X-Gm-Message-State: AOJu0Yz9cFy8bUxS6hIz6Yv8p19J/PjhvhxGFQpOlB+1MHfPwV6PBHOl RDXHu/i/j3Su5WsL1tEuT2Z99FEvhIwe0P0q6F3CwW2cgWLGNUl7aHE0YSjALGyLIzw= X-Gm-Gg: AZuq6aLMayOuBneGpLcYDmfPDMmuL3GSGzXVgEsPhMVI6NzWwmH0JZaYSotSxcGAAmv eyHjkxnBcz49ckGe0HjqMpyre6uJzAV/oxOBeGScNQZ45Y4oWMrhh4iw2E7+AwWX0HpjYK06qEw g4ZVJtpJA+RITkLieFYcHDpdU+lmemAV1oaHNOkyVYqnnzdtWgDEKG4bVpmbrZLQJ60SRlRhgAJ 280NUNOjQMW8Spe4DLPqt1JPjSYZbBat3O2rSwhB7mhmk4bkA2nludVGyvsHAkix1dSN8dE2QM8 N5sMBQimuJrr5XeiuMjGGmlS3vipt/kNJOsF+K12LNjVHMCwPqB0HfyrRSmHSL9x1PuYbcoWGCp +s4VX/pKnGOoB3ky1IPbveFJQWHFpsKsibU45RjOY+FeWj6zuGTU0ovuI7HrGXOsxLYcfikcXLO qMerjqv0joCO2u/YcnIedTlE3CDihaxm6UM7FREdupi45mv9l13e7zIYKQN8whNXNB9YJEmDI4M YlgNj2va5LxIs8L X-Received: by 2002:a17:907:7289:b0:b88:5d85:47c with SMTP id a640c23a62f3a-b8dab1bc003mr399775066b.26.1769616656849; Wed, 28 Jan 2026 08:10:56 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:56 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:56 +0000 Subject: [PATCH v4 07/10] pmdomain: samsung: add support for google,gs101-pd Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-gs101-pd-v4-7-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= , Marek Szyprowski X-Mailer: b4 0.14.2 On Google gs101, direct mmio register access to the PMU registers doesn't work and access must happen via a regmap created by the PMU driver instead. Add a flag to the device match data to denote this case, and obtain the regmap using the parent node in DT if true, while keeping to use the traditional direct mmio regmap otherwise. Additionally, the status is just one bit on gs101. Tested-by: Marek Szyprowski Signed-off-by: Andr=C3=A9 Draszik --- v4: - add 'use_parent_regmap' flag instead of going by 'syscon' compatible in parent, as it's not a given that the parent provides a syscon- compatible regmap (it actually doesn't anymore after recent changes on gs101) I've still kept Marek's Tested-by from v3, as legacy Exynos code doesn't change. --- drivers/pmdomain/samsung/exynos-pm-domains.c | 66 +++++++++++++++++++-----= ---- 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomai= n/samsung/exynos-pm-domains.c index 8df46b41f9bc8f0b2a03300169a4b52457faaf4d..2214d9f32d5967b60e84f68f4e9= 9a725d66a39eb 100644 --- a/drivers/pmdomain/samsung/exynos-pm-domains.c +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -21,6 +22,7 @@ struct exynos_pm_domain_config { /* Value for LOCAL_PWR_CFG and STATUS fields for each domain */ u32 local_pwr_cfg; + bool use_parent_regmap; }; =20 /* @@ -93,8 +95,16 @@ static const struct exynos_pm_domain_config exynos5433_c= fg =3D { .local_pwr_cfg =3D 0xf, }; =20 +static const struct exynos_pm_domain_config gs101_cfg =3D { + .local_pwr_cfg =3D BIT(0), + .use_parent_regmap =3D true, +}; + static const struct of_device_id exynos_pm_domain_of_match[] =3D { { + .compatible =3D "google,gs101-pd", + .data =3D &gs101_cfg, + }, { .compatible =3D "samsung,exynos4210-pd", .data =3D &exynos4210_cfg, }, { @@ -122,17 +132,9 @@ static int exynos_pd_probe(struct platform_device *pde= v) struct of_phandle_args child, parent; struct exynos_pm_domain *pd; struct resource *res; - void __iomem *base; unsigned int val; int on, ret; =20 - struct regmap_config reg_config =3D { - .reg_bits =3D 32, - .val_bits =3D 32, - .reg_stride =3D 4, - .use_relaxed_mmio =3D true, - }; - pm_domain_cfg =3D of_device_get_match_data(dev); pd =3D devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); if (!pd) @@ -143,25 +145,49 @@ static int exynos_pd_probe(struct platform_device *pd= ev) return -ENOMEM; =20 /* - * The resource typically points into the address space of the PMU. + * The resource typically points into the address space of the PMU and + * we have to consider two cases: + * 1) some implementations require a custom regmap (from PMU parent) + * 2) this driver might map the same addresses as the PMU driver * Therefore, avoid using devm_platform_get_and_ioremap_resource() and - * instead use platform_get_resource() and devm_ioremap() to avoid + * instead use platform_get_resource() here, and below for case 1) use + * syscon_node_to_regmap() while for case 2) use devm_ioremap() to avoid * conflicts due to address space overlap. */ res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return dev_err_probe(dev, -ENXIO, "missing IO resources"); =20 - base =3D devm_ioremap(dev, res->start, resource_size(res)); - if (!base) - return dev_err_probe(dev, -ENOMEM, - "failed to ioremap PMU registers"); - - reg_config.max_register =3D resource_size(res) - reg_config.reg_stride; - pd->regmap =3D devm_regmap_init_mmio(dev, base, ®_config); - if (IS_ERR(pd->regmap)) - return dev_err_probe(dev, PTR_ERR(base), - "failed to init regmap"); + if (pm_domain_cfg->use_parent_regmap) { + pd->regmap =3D syscon_node_to_regmap(dev->parent->of_node); + if (IS_ERR(pd->regmap)) + return dev_err_probe(dev, PTR_ERR(pd->regmap), + "failed to acquire PMU regmap"); + + pd->configuration_reg =3D res->start; + pd->status_reg =3D res->start; + } else { + void __iomem *base; + + const struct regmap_config reg_config =3D { + .reg_bits =3D 32, + .val_bits =3D 32, + .reg_stride =3D 4, + .use_relaxed_mmio =3D true, + .max_register =3D (resource_size(res) + - reg_config.reg_stride), + }; + + base =3D devm_ioremap(dev, res->start, resource_size(res)); + if (!base) + return dev_err_probe(dev, -ENOMEM, + "failed to ioremap PMU registers"); + + pd->regmap =3D devm_regmap_init_mmio(dev, base, ®_config); + if (IS_ERR(pd->regmap)) + return dev_err_probe(dev, PTR_ERR(base), + "failed to init regmap"); + } =20 pd->pd.power_off =3D exynos_pd_power_off; pd->pd.power_on =3D exynos_pd_power_on; --=20 2.52.0.457.g6b5491de43-goog From nobody Sat Feb 7 09:35:01 2026 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 65933313558 for ; Wed, 28 Jan 2026 16:11:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616664; cv=none; b=orzcr2m3gR/MzK8kvjwG8uc/UwuQJkqhfYdoz7l+2E3VVAa3KQVYRx9ErUrE2nMsoL6qrZqipfZA5ade/AocGDr4vol+vdZxm61Q4CoYgIgqxVaKs2qxAIf43gVuCdb51Pe0bC4popmsplmx3u6+c2hOb/U4Smprnc7I8LaL00Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616664; c=relaxed/simple; bh=7uwE3SELXGLKzf5NF/JJUetLs0EPpYebrCJSp0Xb+8Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r1mF1rUmH+Dwr+6GsslJ7tLGD1kaDDeFsOx0A4h/RGD1braAZgcNv14si39hyOcli8TBuoUUMDxuoePAUt7ig/EDDfGKGH2inhwYOaO71t3DjnsQPi6DSIY/4BLkGJbBaZeOxy+kagAl+vRgkdi1+jT78KTO9/1/qMhr7UiTY8E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=NhKz5PJd; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NhKz5PJd" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-6580dbdb41eso80713a12.0 for ; Wed, 28 Jan 2026 08:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616657; x=1770221457; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ebxIe09ZJP2AO9RkSAId8NpKhFo/Pn2AHgb75qkbgKA=; b=NhKz5PJdbQ9dT0RtSek4l50aFl9txrXWHGMi7Q+pHmTwxofOUGV1/wpP+79VmYwDfe C6SvIxPUlihJwuypAOAWMjBe95annT7CZJYD70chcnzzVNT9zOBiaxmkfRX8RX/gx2ql BE8GHpvKJfoTDrtAbmVlEyfqrCTu7J2J+lbW9QzgO7dRd944Hu/Lj2tDxKvJYI21tRgO phNJ/ObcCe4L2rWIKMNqrRsHVfLvifBFNqAU3lS/tBT0+KVd2SO5WPw0gJ2rOOnDBHdd 4svNkEjBwpKPFKD57GVzcVuv9PYpDYmQQJuYjVpuO9kAWF6tIEDWFc87Tg64nfuA+p5/ 5FQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616657; x=1770221457; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ebxIe09ZJP2AO9RkSAId8NpKhFo/Pn2AHgb75qkbgKA=; b=nzOMss4KuqRaPk/qk3VIPlyfVgkBHYJqltWIxB/QrW4wQrIW0Intke2edW4/XyRoBY Mg4bEruSgo5Bu3D5hphZ51mZuvwOtwbu2wLBXNeBQVE3amwbZ0YldGNpraRbdP4KB6Er Qi/k9RcXx5+aY7rlIkvkAFLOv9GyWXQvfEZcEyOZdUpBPZ9WjI1OhTUXmsb4tLlijDyQ jtpNeaEIiB/K/4JRocerKBTGx4ORpF7JyqbftJZEWnRJRbpobWeJ654h0qBrkU+Y0ERw emttT6VoRnzH5stcQW+vzJWPYw9+Jm0TXAfW4ojmpzhzh4ovfKAxrY8MDpuX0Ob4Dy5t yP/g== X-Forwarded-Encrypted: i=1; AJvYcCXxzJLxA69Hza3MOBDNpd1LY6s6D1vNFyE4vaJug0bPG8BV6JcyASNfZMMVBr1FPtLHOp7TS2ssMk9Uzy8=@vger.kernel.org X-Gm-Message-State: AOJu0YytilPr6KM1wZ5NfsM+yxxCSRK/560A1wGwlzS7mKNqn/7WWn60 +490ZP0hlGG1uql9Ngj/Q6y/yX4htXscugOMcbBHGvCq+fJDqHGjVpRy+J8dZsXn7Es= X-Gm-Gg: AZuq6aKoZnA7yYpS9j3xwZAvGaovZ+NuVWF6rt/2rIqKJq5YnBWk+HzHGNVsRg+LeP3 ROMUp7F73HAZinJS89fOXBoK5yaKzrVfXB6qlfeR9g/6PRqGSBUdHCSweLQKF6xMTqnY7UnaoNF m0rK4lS18QwWaLVqfKD3cLD4dCTzlF+6Cx9qVSTVjmtrOITN1dtDGqCIA2pG2c12LemGkmK93rL Lu+Q5TKwP+hdxaT/3/hAinojzgS+aQ4Vk4nCyMqzMHQbCsmBJwgO5yzYv8MbU+fkldS8V/Ck8hE PILLsNlZ2jYmMIQlnj41v/ziXio+frNx2QJilZPNWgxI0apL5mv7lCYWkJTAjrd+/Q7U2/TXh35 aa2yMj0sha364EPSRr9CNklKwni+yOt9Aq+n784VQA4A7Jxh7GB7xRc4nlfV52y4iRkq0lt5qUn X7rWiSgzLlXIj3miSvLa9fPXKTo63DWrSz7DIR3hjuOh8q2VZrdMO+3Wm/VXKKowfeFwwU4K11+ PugWw== X-Received: by 2002:a17:907:1b24:b0:b87:3c4a:e68f with SMTP id a640c23a62f3a-b8dab434f1emr359018266b.36.1769616657368; Wed, 28 Jan 2026 08:10:57 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:57 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:57 +0000 Subject: [PATCH v4 08/10] pmdomain: samsung: use dev_err() instead of pr_err() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-gs101-pd-v4-8-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= , Marek Szyprowski , Krzysztof Kozlowski X-Mailer: b4 0.14.2 dev_err() gives us more consistent error messages, which include the device. Switch to using dev_err(). Reviewed-by: Krzysztof Kozlowski Tested-by: Marek Szyprowski Signed-off-by: Andr=C3=A9 Draszik --- drivers/pmdomain/samsung/exynos-pm-domains.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomai= n/samsung/exynos-pm-domains.c index 2214d9f32d5967b60e84f68f4e99a725d66a39eb..41a232b3cdaf0f4be413b25d937= 3b99c6a3db602 100644 --- a/drivers/pmdomain/samsung/exynos-pm-domains.c +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c @@ -30,6 +30,7 @@ struct exynos_pm_domain_config { */ struct exynos_pm_domain { struct regmap *regmap; + struct device *dev; struct generic_pm_domain pd; u32 local_pwr_cfg; u32 configuration_reg; @@ -47,8 +48,9 @@ static int exynos_pd_power(struct generic_pm_domain *doma= in, bool power_on) pwr =3D power_on ? pd->local_pwr_cfg : 0; err =3D regmap_write(pd->regmap, pd->configuration_reg, pwr); if (err) { - pr_err("Regmap write for power domain %s %sable failed: %d\n", - domain->name, power_on ? "en" : "dis", err); + dev_err(pd->dev, + "Regmap write for power domain %s %sable failed: %d\n", + domain->name, power_on ? "en" : "dis", err); return err; } =20 @@ -71,8 +73,8 @@ static int exynos_pd_power(struct generic_pm_domain *doma= in, bool power_on) /* Only return timeout if no other error also occurred. */ err =3D -ETIMEDOUT; if (err) - pr_err("Power domain %s %sable failed: %d\n", domain->name, - power_on ? "en" : "dis", err); + dev_err(pd->dev, "Power domain %s %sable failed: %d\n", + domain->name, power_on ? "en" : "dis", err); =20 return err; } @@ -140,6 +142,8 @@ static int exynos_pd_probe(struct platform_device *pdev) if (!pd) return -ENOMEM; =20 + pd->dev =3D dev; + pd->pd.name =3D exynos_get_domain_name(dev, np); if (!pd->pd.name) return -ENOMEM; --=20 2.52.0.457.g6b5491de43-goog From nobody Sat Feb 7 09:35:01 2026 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 66FBF313E20 for ; Wed, 28 Jan 2026 16:11:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616663; cv=none; b=otYDWG2TDpHjFkmP/MqIY0IbGaFUlsuXsf3n2VUuDsY719MhvrrcPfjhBh8wo6z5X3BVWrSgOPdC97aRWdTH+ib39XgKSSa7onUZsOgevm3qPl3OxDXY93o8rfHu5WVhNhaDgGCzcLURPnF39tZNEVg+jiKx3gfzWRuEu6wThxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616663; c=relaxed/simple; bh=t2PVoqEhqZMJZC67I3W1iuIM3JwoW/UJ4k6IbMPc6/4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZzfF9EyoFCQlhgao1hLszNKY79kG5nJScTcRSXOpKzgEdPDa5rm2M2cqSg3IP+vCcrrIixzqTC0Ltt6VdS4aPbQ9LOswWkHlPqZPnGmwM1uHd6l+I1UDcJ2X6xN8OIfnIRqLwr/F8lw3dFG5iN6mPUgycGOYTPHfi/acPB+9nGE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=i36qBX9Z; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="i36qBX9Z" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-b885d8f4092so991639866b.2 for ; Wed, 28 Jan 2026 08:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616658; x=1770221458; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=mLy2uL/FtYE0GEpGfFAeMw9BLXBDMwcv0NDa1wsnuec=; b=i36qBX9ZCm4UYSDy3nAO1ZgaU8uTJhDvrQxW5TpHFRsK9BuzqjTx/sgAdym/2GmPrO VzigOhwMLa6AOQWvdBFA3sYCv9PYjOxgtmYF5ngPiyDRkbrmKQRQ24rUCrDr/67aqdfE E8GE9JSNLvJ6NNdAfvZPV3kys8pawHvTkBT+c+4y8zRPYuqwAQVFYFPhLoLUynkMtdR8 pBONNAssteMPC/7tSHN3qxfNw1fvifxo7Jooj0JouXgLQkVDogccWZvJAslFbkIUnxAi uNa345TczAeNMn3zDYKYw3sDRIo4Jo2D+01wQZ2iD50zH/VAs9s3WVfaaG/KQoDUBSwl 1DzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616658; x=1770221458; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=mLy2uL/FtYE0GEpGfFAeMw9BLXBDMwcv0NDa1wsnuec=; b=RoBXhwOg0rM/6Y3kTwsWY1rMfDdDKNTv9Z8acf+f/WCSURep5DcBcBf3cpofjUKoKm Gw1E5PIFKJZNp4udK/xiG7dRyhjxVX5xfVr2tpaEW9Fj5kfyGVNSWMUTZF3vlCevvvyS 0htDL/vH3Ysbw6/MP8GwvawlNiytVB5K9ShI5c1VNH4JSkD3nwE4huJIJoBTbgm8dqSw UTYkiLOEVxVlGpASujmmoWfW7ZnoFn2Uv2v+Keoh2UAk0G1P7Hrqua1qPjTziEJzBn1W dCrxQ4Lz62eIhT1T81jS6iFi0asWs6Gz7tlfFog2qFVtlWHH9/Io7Sc2TKyeA+xV8d/B Bn5w== X-Forwarded-Encrypted: i=1; AJvYcCXgbdhLy2zH4mGy1AEXJoOxvXnKu6XXa8AupdWNTS+NqUS9ewvzCpVGymvpcQngTLl08ZjpWu9nDWwVkyE=@vger.kernel.org X-Gm-Message-State: AOJu0YxcVLWQeHjbvm+Z5n0NFutvX7crYUJnQV6NQwM9JyGvjirSfuTQ zKcUWtJNO/ZP/1tG9o/41cdcu5YCoQf9e28s816Z7zwqoe0Rqz6Rk5Eg554awDKxnjc= X-Gm-Gg: AZuq6aJ4mcAcdJgf14pxNxEiIop1doHcJo4ulPkkqjJi3UNCfbiP9skcX11Azc0KnFf sye3BG2nXqQ+6MsRbk64fivAj8YnUhVNXMMHieF5UQ3JGwRC3U6d8X3/s8198o58VLVFqLKKTWd DpXuG+eMSZY01ytGfs0iKXqJ1twpUTFeRaGn5o0OjtPZ9YqVUNF+/4ytq14OSDQ6ITXPxCyGKwY horMEx4stfuTsD11tqtDlUkqtMd4RoHj3spnwZgOfx0s1ofKaGeWVgGyeQHkcPnz7hQqzhK2iav SLJfC1wfztXlj5KFDTB0qp+Lx5xrjFCQa2w9HF4VY0By64PD5q3/2oo8LmN2Ma/JnJBZdr311Jr IN56/hz1XlMI1Dk9VlEAYymUTjSQGVQHPZlEf85r56BAAdCTUXzH8D31vGs9XN1zB0EWvoXisCS 9d0d9cNl9kmGUY9rqJ9ulMEuNAmHcUpRnlecj9dvkeDTpmFXkM67tZGQDnkl793nZs4AbBF2OyC 1B0yw== X-Received: by 2002:a17:907:d88:b0:b88:587f:f594 with SMTP id a640c23a62f3a-b8dab1b526bmr445917666b.18.1769616657919; Wed, 28 Jan 2026 08:10:57 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:57 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:58 +0000 Subject: [PATCH v4 09/10] pmdomain: samsung: implement SMC to save / restore TZ config Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-gs101-pd-v4-9-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.14.2 Newer Exynos platforms have a Distributed Trust Zone Protection Control (DTZPC) linked to each power domain. It controls the access permissions to various registers from secure and non-secure world. An SMC call is required to instruct the firmware that the power domain is about to be turned off and again once it was turned on. This allows the firmware to save and restore the DTZPC configuration. Without, register access to various registers becomes impossible from Linux (causing SError), as the PoR configuration doesn't allow access. Neither the requirement for the SMC call, nor its arguments appear to be specific to gs101, as at least Exynos E850 also uses the same as can be seen in [1], hence prefix the new macros simply with EXYNOS_. At least on gs101, this SMC call isn't implemented for all power domains (e.g. it's missing for HSI2 (UFS)), therefore we issue a test SMC to store the configuration during probe, and if it fails we mark a domain as always-on to avoid the SErrors and to avoid unnecessarily retrying for each domain on/off. Link: https://lore.kernel.org/all/20230308233822.31180-4-semen.protsenko@li= naro.org/ [1] Signed-off-by: Andr=C3=A9 Draszik --- drivers/pmdomain/samsung/exynos-pm-domains.c | 96 ++++++++++++++++++++++++= ++-- 1 file changed, 90 insertions(+), 6 deletions(-) diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomai= n/samsung/exynos-pm-domains.c index 41a232b3cdaf0f4be413b25d9373b99c6a3db602..f59986b56213dfcc470d9cccc61= a36a81954bdcc 100644 --- a/drivers/pmdomain/samsung/exynos-pm-domains.c +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c @@ -9,6 +9,7 @@ // conjunction with runtime-pm. Support for both device-tree and non-devic= e-tree // based power domain support is included. =20 +#include #include #include #include @@ -16,12 +17,19 @@ #include #include #include +#include #include #include =20 +#define EXYNOS_SMC_CMD_PREPARE_PD_ONOFF 0x82000410 +#define EXYNOS_GET_IN_PD_DOWN 0 +#define EXYNOS_WAKEUP_PD_DOWN 1 +#define EXYNOS_RUNTIME_PM_TZPC_GROUP 2 + struct exynos_pm_domain_config { /* Value for LOCAL_PWR_CFG and STATUS fields for each domain */ u32 local_pwr_cfg; + u32 smc_offset; bool use_parent_regmap; }; =20 @@ -32,11 +40,28 @@ struct exynos_pm_domain { struct regmap *regmap; struct device *dev; struct generic_pm_domain pd; - u32 local_pwr_cfg; + const struct exynos_pm_domain_config *cfg; u32 configuration_reg; u32 status_reg; + phys_addr_t ac_pa; }; =20 +static int exynos_pd_access_controller_power(struct exynos_pm_domain *pd, + bool power_on) +{ + struct arm_smccc_res res; + + if (!pd->ac_pa || !pd->cfg->smc_offset) + return 0; + + arm_smccc_smc(EXYNOS_SMC_CMD_PREPARE_PD_ONOFF, + power_on ? EXYNOS_WAKEUP_PD_DOWN : EXYNOS_GET_IN_PD_DOWN, + pd->ac_pa + pd->cfg->smc_offset, + EXYNOS_RUNTIME_PM_TZPC_GROUP, 0, 0, 0, 0, &res); + + return res.a0; +} + static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) { struct exynos_pm_domain *pd; @@ -45,7 +70,17 @@ static int exynos_pd_power(struct generic_pm_domain *dom= ain, bool power_on) =20 pd =3D container_of(domain, struct exynos_pm_domain, pd); =20 - pwr =3D power_on ? pd->local_pwr_cfg : 0; + if (!power_on) { + err =3D exynos_pd_access_controller_power(pd, power_on); + if (err) { + dev_err(pd->dev, + "SMC for power domain %s %sable failed: %d\n", + domain->name, power_on ? "en" : "dis", err); + return err; + } + } + + pwr =3D power_on ? pd->cfg->local_pwr_cfg : 0; err =3D regmap_write(pd->regmap, pd->configuration_reg, pwr); if (err) { dev_err(pd->dev, @@ -60,7 +95,7 @@ static int exynos_pd_power(struct generic_pm_domain *doma= in, bool power_on) unsigned int val; =20 err =3D regmap_read(pd->regmap, pd->status_reg, &val); - if (err || ((val & pd->local_pwr_cfg) !=3D pwr)) { + if (err || ((val & pd->cfg->local_pwr_cfg) !=3D pwr)) { cpu_relax(); usleep_range(80, 100); continue; @@ -72,9 +107,21 @@ static int exynos_pd_power(struct generic_pm_domain *do= main, bool power_on) if (!timeout && !err) /* Only return timeout if no other error also occurred. */ err =3D -ETIMEDOUT; - if (err) + if (err) { dev_err(pd->dev, "Power domain %s %sable failed: %d\n", domain->name, power_on ? "en" : "dis", err); + return err; + } + + if (power_on) { + err =3D exynos_pd_access_controller_power(pd, power_on); + if (err) { + dev_err(pd->dev, + "SMC for power domain %s %sable failed: %d\n", + domain->name, power_on ? "en" : "dis", err); + return err; + } + } =20 return err; } @@ -99,6 +146,7 @@ static const struct exynos_pm_domain_config exynos5433_c= fg =3D { =20 static const struct exynos_pm_domain_config gs101_cfg =3D { .local_pwr_cfg =3D BIT(0), + .smc_offset =3D 0x0204, .use_parent_regmap =3D true, }; =20 @@ -126,6 +174,38 @@ static const char *exynos_get_domain_name(struct devic= e *dev, return devm_kstrdup_const(dev, name, GFP_KERNEL); } =20 +static int exynos_pd_get_access_controller(struct exynos_pm_domain *pd) +{ + struct device_node *ac_np; + struct resource ac_res; + int ret; + + ac_np =3D of_parse_phandle(pd->dev->of_node, "samsung,dtzpc", 0); + if (!ac_np) + return 0; + + ret =3D of_address_to_resource(ac_np, 0, &ac_res); + of_node_put(ac_np); + if (ret) + return dev_err_probe(pd->dev, ret, + "failed to get access controller\n"); + + pd->ac_pa =3D ac_res.start; + + /* + * For some domains, TZ save/restore might not be implemented. If that + * is the case, simply mark it as always on, as otherwise a power cycle + * will lead to lost TZ configuration, making it impossible to access + * registers from Linux afterwards. + */ + if (exynos_pd_access_controller_power(pd, false) =3D=3D -ENOENT) { + pd->ac_pa =3D 0; + pd->pd.flags |=3D GENPD_FLAG_ALWAYS_ON; + } + + return 0; +} + static int exynos_pd_probe(struct platform_device *pdev) { const struct exynos_pm_domain_config *pm_domain_cfg; @@ -195,10 +275,14 @@ static int exynos_pd_probe(struct platform_device *pd= ev) =20 pd->pd.power_off =3D exynos_pd_power_off; pd->pd.power_on =3D exynos_pd_power_on; - pd->local_pwr_cfg =3D pm_domain_cfg->local_pwr_cfg; + pd->cfg =3D pm_domain_cfg; pd->configuration_reg +=3D 0; pd->status_reg +=3D 4; =20 + ret =3D exynos_pd_get_access_controller(pd); + if (ret) + return ret; + /* * Some Samsung platforms with bootloaders turning on the splash-screen * and handing it over to the kernel, requires the power-domains to be @@ -212,7 +296,7 @@ static int exynos_pd_probe(struct platform_device *pdev) if (ret) return dev_err_probe(dev, ret, "failed to read status"); =20 - on =3D val & pd->local_pwr_cfg; + on =3D val & pd->cfg->local_pwr_cfg; =20 pm_genpd_init(&pd->pd, NULL, !on); ret =3D of_genpd_add_provider_simple(np, &pd->pd); --=20 2.52.0.457.g6b5491de43-goog From nobody Sat Feb 7 09:35:01 2026 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (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 43FE4318B91 for ; Wed, 28 Jan 2026 16:11:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616665; cv=none; b=VPdrECphE9G9PWztdACyxlJeV4Zrb2TY2aidFYk/uMTOCEEa6hvs6Cc6f108YRaZtPwzaw2yvTZZGg9pMGqd/M38p576boRT+rdTfUM57+sqOz2QfJLv0j4xiJtDojGc1oxvi3IIFmHmPgonecGzYieuO0H7Y/gmf8HQ6lXDKgY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769616665; c=relaxed/simple; bh=JnjfvK+MHgibmXdj8c8QyUL8Q5i+pDFvx54OCA4Mehc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m5MLTp+Sp4JB2bQ7eBwNcVMtozXJ/u78UVClfMNGUHNpym2RFZyiJbiIBhEt5At+k7XpziyQa5cdZpS4OGWG0OX5F9wV9dQg+lXAWmo0QLy45Hk8KITc0FRw+mKf0f2ObqbXRQ/YJd3bHyplQVvSHpMTFf4rSgojC8uJg/LVGIQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=M1a+HWFu; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="M1a+HWFu" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-658ad86082dso101517a12.0 for ; Wed, 28 Jan 2026 08:11:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769616658; x=1770221458; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=kov2pn4auGP7KnNGCEIBpS1LmUNVpZnSgM4Kim/Xeow=; b=M1a+HWFu6T15gKjZ0K74uqkZreQ+DrsmvCWoA/WiSiJ67d5lxxS68++U8Y87bc0Reo /j2HMN4IEqnEzIcitkAwT/TDHqq34PqB0RRrAV4E5sb5UXLno70/DbsKlnDpe6TWiatV fulSoIZceU3LaWGnhk+uX7nwvlC/lCKr5bC36O1+7kg78ZkhXeNSMTG5nEvAimTRpMH7 +dGsT0qHqopLXizz+DUcZBLPvuGXxHSwEUfIzLL6amtbjxkgJgQVXRtO47pxJlhMv/KE abK9pj7RTXzzyspIAjSjfuFGVLtojLQSGeQZYWoc7hd+NXLBduB5kmxi26e2XpnOh/jg ik+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769616658; x=1770221458; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=kov2pn4auGP7KnNGCEIBpS1LmUNVpZnSgM4Kim/Xeow=; b=ebhQnHAyqqAd9KSAtzOCjZljPpDEvF8sHVztfjwDS4tZgtmEAJSZ76Bhcq6pz6nigS BPUQPZtgy4hfCKTcs2rqowz+m57mpwRKVAdHJSbOQKJT7wKZLbU/MgfFkNCjDmfz9f79 KZm8AWxJMT7hhhjlGAIOLx02qlV1V4WfSr6ptDH/7emIW1lvqX4NnOW/NHNhWTc0JP64 AGnZGr/SART5VWdCKun3K8oIP/MfMYYI7XaP0xbNfQw9zmEp4fWC5XXjCzE8kIjktICO 3NTJytp8Lj7iImgmX0XZsxobhximfObvtGcEpWRHKGr4dClWqZsubX501RmQukF57X2T tjCA== X-Forwarded-Encrypted: i=1; AJvYcCUlSTh5W20A12Dl0CD0yFESNaPNs/E3CoYFX5XrEUt0FTg3QADa2itJtoVWhBURzCqbeBerd9GJ3Dvkajs=@vger.kernel.org X-Gm-Message-State: AOJu0YwQ4fyAl/0Ew8VZHHp/fhItnfr4wsgSuUmWykK93dyKxbpQGBEv F82Ds4hY9YTxFsHcXGB+jHVCrCEHI4uALy8q2LfWKiCX2AbzPDQBbdVCNsA82ruSURM= X-Gm-Gg: AZuq6aI3T2g4oDUjpXbNGHhbmH6Vq/rgK5DUQ7FOmxDA8XvW1MwaZHG7SvkZXSQm3If URsmroQyPIO/HUMrQ1QGryEV8G+a/Fuy1gz+JgKK21CI5THawNJH3GPH+IBt5PiRj6UCPA0potY npZ/eEb1U8R0MslF07CHMC/Mds+NwaucSJB/JopTWIav/TVGNGjWxJMPjIJePwGa47x0MAl9rQo v+1+KEdr50NqVBgEwSiiUIOBTBBLuKNrCUnzieMiy8DpbBZ/0Mss7HyMptH4Vd5G3Q6jVl/PInt 4BhNzUY7JIarW0ljGUii5IJVSROZde7gM1Hwiv88a6V4qDr2M6n5Ywh1BTzuPtZk+MBm+3c4Dbn NYOKjfdnUGwVSK4RwN3L6KJGICbFqIzKyiyFtGimfjjk41ApS74zK3uVOvQiGYQ2eVw18XDSmLZ ukSPwKNq0sUYZwpwKL6w7gdFE8+3S6tTYrc1nYIw9cyeu4U9t6iprAuIztVx5oCVsItRtYPSEYg guEDw== X-Received: by 2002:a17:907:94c4:b0:b87:2780:1b29 with SMTP id a640c23a62f3a-b8dab32edfdmr423420166b.37.1769616658444; Wed, 28 Jan 2026 08:10:58 -0800 (PST) Received: from puffmais2.c.googlers.com (244.175.141.34.bc.googleusercontent.com. [34.141.175.244]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1c021fsm148553366b.49.2026.01.28.08.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 08:10:58 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 28 Jan 2026 16:10:59 +0000 Subject: [PATCH v4 10/10] pmdomain: samsung: implement domain-supply regulator Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-gs101-pd-v4-10-cbe7bd5a4060@linaro.org> References: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> In-Reply-To: <20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org> To: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Ulf Hansson , Liam Girdwood , Mark Brown Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.14.2 Some power domains on Exynos are fed by a regulator rail and therefore regulator control needs be implemented for Exynos power domains. On Google gs101, HSI0 (USB) is one example of such a power domain. While at it, add a to_exynos_pd() to avoid direct use of container_of() in various additional places, and update existing code to use it. Signed-off-by: Andr=C3=A9 Draszik --- drivers/pmdomain/samsung/exynos-pm-domains.c | 53 ++++++++++++++++++++++++= +--- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomai= n/samsung/exynos-pm-domains.c index f59986b56213dfcc470d9cccc61a36a81954bdcc..ed7a5807555bcf86e4ec88166bf= d5f6c06c9322c 100644 --- a/drivers/pmdomain/samsung/exynos-pm-domains.c +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c @@ -20,12 +20,15 @@ #include #include #include +#include =20 #define EXYNOS_SMC_CMD_PREPARE_PD_ONOFF 0x82000410 #define EXYNOS_GET_IN_PD_DOWN 0 #define EXYNOS_WAKEUP_PD_DOWN 1 #define EXYNOS_RUNTIME_PM_TZPC_GROUP 2 =20 +#define to_exynos_pd(gpd) container_of_const(gpd, struct exynos_pm_domain,= pd) + struct exynos_pm_domain_config { /* Value for LOCAL_PWR_CFG and STATUS fields for each domain */ u32 local_pwr_cfg; @@ -39,6 +42,7 @@ struct exynos_pm_domain_config { struct exynos_pm_domain { struct regmap *regmap; struct device *dev; + struct regulator *supply; struct generic_pm_domain pd; const struct exynos_pm_domain_config *cfg; u32 configuration_reg; @@ -64,12 +68,10 @@ static int exynos_pd_access_controller_power(struct exy= nos_pm_domain *pd, =20 static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) { - struct exynos_pm_domain *pd; + struct exynos_pm_domain *pd =3D to_exynos_pd(domain); u32 timeout, pwr; int err; =20 - pd =3D container_of(domain, struct exynos_pm_domain, pd); - if (!power_on) { err =3D exynos_pd_access_controller_power(pd, power_on); if (err) { @@ -126,14 +128,45 @@ static int exynos_pd_power(struct generic_pm_domain *= domain, bool power_on) return err; } =20 +static int exynos_pd_regulator_enable(struct regulator *supply) +{ + return supply ? regulator_enable(supply) : 0; +} + +static int exynos_pd_regulator_disable(struct regulator *supply) +{ + return supply ? regulator_disable(supply) : 0; +} + static int exynos_pd_power_on(struct generic_pm_domain *domain) { - return exynos_pd_power(domain, true); + struct exynos_pm_domain *pd =3D to_exynos_pd(domain); + int ret; + + ret =3D exynos_pd_regulator_enable(pd->supply); + if (ret) + return ret; + + ret =3D exynos_pd_power(domain, true); + if (ret) + exynos_pd_regulator_disable(pd->supply); + + return ret; } =20 static int exynos_pd_power_off(struct generic_pm_domain *domain) { - return exynos_pd_power(domain, false); + struct exynos_pm_domain *pd =3D to_exynos_pd(domain); + int ret; + + ret =3D exynos_pd_power(domain, false); + if (ret) + return ret; + + /* Ignore regulator errors - the domain was disabled after all. */ + exynos_pd_regulator_disable(pd->supply); + + return 0; } =20 static const struct exynos_pm_domain_config exynos4210_cfg =3D { @@ -283,6 +316,16 @@ static int exynos_pd_probe(struct platform_device *pde= v) if (ret) return ret; =20 + /* get the domain power supply if required */ + pd->supply =3D devm_regulator_get_optional(dev, "domain"); + if (IS_ERR(pd->supply)) { + if (PTR_ERR(pd->supply) !=3D -ENODEV) + return dev_err_probe(dev, PTR_ERR(pd->supply), + "failed to get domain supply"); + + pd->supply =3D NULL; + } + /* * Some Samsung platforms with bootloaders turning on the splash-screen * and handing it over to the kernel, requires the power-domains to be --=20 2.52.0.457.g6b5491de43-goog