* [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101
@ 2026-02-05 21:42 André Draszik
2026-02-05 21:42 ` [PATCH v5 01/10] dt-bindings: soc: google: add google,gs101-dtzpc André Draszik
` (10 more replies)
0 siblings, 11 replies; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik, Marek Szyprowski,
Krzysztof Kozlowski
Hi,
This series adds support for the power domains on Google GS101.
There are a few differences compared to SoCs already supported by this
driver:
* register access does not work via plain ioremap() / readl() /
writel().
Instead, the regmap created by the PMU driver must be used (which
uses Arm SMCC calls under the hood).
* DTZPC: a call needs to be made before and after power domain off/on,
to inform the EL3 firmware of the request.
* power domains can and are fed by a regulator rail and therefore
regulator control needed be implemented.
Bullet points 2 and 3 are new since version 4 of this series, and
related changes are in patches 1, 2, 9, and 10. I can merge patch 9
(SMC call) into the gs101 patch (patch 7) if preferred, but for now I
kept them independent to make it easier to see changes compared to
previous versions of this series, and because patch 9 actually applies
to not only gs101, but to many newer Exynos SoCs, and to make patches 9
and 10 themselves easier to review and reason about.
The DT update to add the new required properties on gs101 will be
posted separately.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
Changes in v5:
- add domain-supply to binding (patch 2)
- Link to v4: https://lore.kernel.org/r/20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org
Changes in v4:
- drop unneeded or already merged patches
- drop patch "pmdomain: samsung: convert to regmap_read_poll_timeout()"
as Marek reported issues on some platforms
- rebase
- DTZPC related changes
- Link to v3: https://lore.kernel.org/r/20251016-gs101-pd-v3-0-7b30797396e7@linaro.org
Changes in v3:
- use additionalProperties, not unevaluatedProperties in patch 2
- fix path in $id in patch 2 (Rob)
- drop comment around 'select' in patch 2 (Rob)
- collect tags
- Link to v2: https://lore.kernel.org/r/20251009-gs101-pd-v2-0-3f4a6db2af39@linaro.org
Changes in v2:
- Krzysztof:
- move google,gs101-pmu binding into separate file
- mark devm_kstrdup_const() patch as fix
- use bool for need_early_sync_state
- merge patches 8 and 10 from v1 series into one patch
- collect tags
- Link to v1: https://lore.kernel.org/r/20251006-gs101-pd-v1-0-f0cb0c01ea7b@linaro.org
---
André Draszik (10):
dt-bindings: soc: google: add google,gs101-dtzpc
dt-bindings: power: samsung: add google,gs101-pd
dt-bindings: soc: samsung: exynos-pmu: move gs101-pmu into separate binding
dt-bindings: soc: google: gs101-pmu: allow power domains as children
pmdomain: samsung: convert to using regmap
pmdomain: samsung: don't hard-code offset for registers to 0 and 4
pmdomain: samsung: add support for google,gs101-pd
pmdomain: samsung: use dev_err() instead of pr_err()
pmdomain: samsung: implement SMC to save / restore TZ config
pmdomain: samsung: implement domain-supply regulator
.../devicetree/bindings/power/pd-samsung.yaml | 33 ++-
.../bindings/soc/google/google,gs101-dtzpc.yaml | 42 ++++
.../bindings/soc/google/google,gs101-pmu.yaml | 97 ++++++++
.../bindings/soc/samsung/exynos-pmu.yaml | 20 --
MAINTAINERS | 2 +
drivers/pmdomain/samsung/exynos-pm-domains.c | 254 ++++++++++++++++++---
6 files changed, 399 insertions(+), 49 deletions(-)
---
base-commit: 9845cf73f7db6094c0d8419d6adb848028f4a921
change-id: 20251001-gs101-pd-d4dc97d70a84
Best regards,
--
André Draszik <andre.draszik@linaro.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v5 01/10] dt-bindings: soc: google: add google,gs101-dtzpc
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
@ 2026-02-05 21:42 ` André Draszik
2026-02-11 20:58 ` Rob Herring (Arm)
2026-02-05 21:42 ` [PATCH v5 02/10] dt-bindings: power: samsung: add google,gs101-pd André Draszik
` (9 subsequent siblings)
10 siblings, 1 reply; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik
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é Draszik <andre.draszik@linaro.org>
---
.../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-dtzpc.yaml b/Documentation/devicetree/bindings/soc/google/google,gs101-dtzpc.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..a8c61ce069d6910c47753bf14a792eb58e6ae182
--- /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 system.
+ It configures each area of the memory as secure or non-secure.
+
+maintainers:
+ - André Draszik <andre.draszik@linaro.org>
+
+properties:
+ compatible:
+ const: google,gs101-dtzpc
+
+ clocks:
+ maxItems: 1
+
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - clocks
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/google,gs101.h>
+
+ dtzpc_hsi0: dtzpc@11010000 {
+ compatible = "google,gs101-dtzpc";
+ reg = <0x11010000 0x10000>;
+ clocks = <&cmu_hsi0 CLK_GOUT_HSI0_D_TZPC_HSI0_PCLK>;
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index 900fc00b73e6d17443f7cee12fa7589b56facaaa..7fc1964b6beaf835a398a9bcee4ded191034d2e3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10855,6 +10855,7 @@ P: Documentation/process/maintainer-soc-clean-dts.rst
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/
--
2.53.0.rc2.204.g2597b5adb4-goog
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 02/10] dt-bindings: power: samsung: add google,gs101-pd
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
2026-02-05 21:42 ` [PATCH v5 01/10] dt-bindings: soc: google: add google,gs101-dtzpc André Draszik
@ 2026-02-05 21:42 ` André Draszik
2026-02-11 21:01 ` Rob Herring (Arm)
2026-02-05 21:42 ` [PATCH v5 03/10] dt-bindings: soc: samsung: exynos-pmu: move gs101-pmu into separate binding André Draszik
` (8 subsequent siblings)
10 siblings, 1 reply; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik
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.
Power domains can also have a power supply linked to them, so add
optional support for that, too. It is believed that all (existing)
platforms could benefit from this, hence it's not being limited to
gs101-pd.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
v5:
- add domain-supply and update commit message
v4:
- add new vendor property samsung,dtzpc
- drop previous tags due to that
---
.../devicetree/bindings/power/pd-samsung.yaml | 33 ++++++++++++++++++++--
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/power/pd-samsung.yaml b/Documentation/devicetree/bindings/power/pd-samsung.yaml
index 9c2c51133457112ca0098c043e123f0a02fa1291..3f1a2dc178625f8cfdbb913d0c7cb5b2519fe477 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 used
to gate power to one or more peripherals on the processor.
-allOf:
- - $ref: power-domain.yaml#
-
properties:
compatible:
enum:
+ - google,gs101-pd
- samsung,exynos4210-pd
- samsung,exynos5433-pd
@@ -33,6 +31,9 @@ properties:
deprecated: true
maxItems: 1
+ domain-supply:
+ description: domain regulator supply.
+
label:
description:
Human readable string with domain name. Will be visible in userspace
@@ -44,11 +45,28 @@ properties:
power-domains:
maxItems: 1
+ samsung,dtzpc:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description:
+ Distributed TrustZone Protection Control (DTZPC) node.
+
required:
- compatible
- "#power-domain-cells"
- reg
+allOf:
+ - $ref: power-domain.yaml#
+ - if:
+ not:
+ properties:
+ compatible:
+ contains:
+ const: google,gs101-pd
+ then:
+ properties:
+ samsung,dtzpc: false
+
unevaluatedProperties: false
examples:
@@ -66,3 +84,12 @@ examples:
#power-domain-cells = <0>;
label = "MFC";
};
+
+ power-domain@2080 {
+ compatible = "google,gs101-pd";
+ reg = <0x2080 0x80>;
+ #power-domain-cells = <0>;
+ label = "hsi0";
+ domain-supply = <&ldo7m>;
+ samsung,dtzpc = <&dtzpc_hsi0>;
+ };
--
2.53.0.rc2.204.g2597b5adb4-goog
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 03/10] dt-bindings: soc: samsung: exynos-pmu: move gs101-pmu into separate binding
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
2026-02-05 21:42 ` [PATCH v5 01/10] dt-bindings: soc: google: add google,gs101-dtzpc André Draszik
2026-02-05 21:42 ` [PATCH v5 02/10] dt-bindings: power: samsung: add google,gs101-pd André Draszik
@ 2026-02-05 21:42 ` André Draszik
2026-02-11 21:03 ` Rob Herring (Arm)
2026-02-05 21:42 ` [PATCH v5 04/10] dt-bindings: soc: google: gs101-pmu: allow power domains as children André Draszik
` (7 subsequent siblings)
10 siblings, 1 reply; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik, Marek Szyprowski
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 <m.szyprowski@samsung.com>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
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..a06bd8ec3c20faf0b364d3d3ef1763502c2b09cf
--- /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é Draszik <andre.draszik@linaro.org>
+
+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 = "google,gs101-pmu";
+ reg = <0x17460000 0x10000>;
+
+ google,pmu-intr-gen-syscon = <&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..09368dbb6de6898e2988c398b2506f2c2b4e73bc 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
- 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
- - 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 <dt-bindings/clock/exynos5250.h>
diff --git a/MAINTAINERS b/MAINTAINERS
index 7fc1964b6beaf835a398a9bcee4ded191034d2e3..212fa7ca48b8272ebf189fa1d105b319a849c5c2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10856,6 +10856,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/
--
2.53.0.rc2.204.g2597b5adb4-goog
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 04/10] dt-bindings: soc: google: gs101-pmu: allow power domains as children
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
` (2 preceding siblings ...)
2026-02-05 21:42 ` [PATCH v5 03/10] dt-bindings: soc: samsung: exynos-pmu: move gs101-pmu into separate binding André Draszik
@ 2026-02-05 21:42 ` André Draszik
2026-02-11 21:12 ` Rob Herring
2026-02-05 21:42 ` [PATCH v5 05/10] pmdomain: samsung: convert to using regmap André Draszik
` (6 subsequent siblings)
10 siblings, 1 reply; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik, Marek Szyprowski
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 <m.szyprowski@samsung.com>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
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..c1ee9575092a3ab17873d228a88468addb62d838 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
+ "#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.
+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
additionalProperties: false
@@ -51,6 +73,25 @@ examples:
system-controller@17460000 {
compatible = "google,gs101-pmu";
reg = <0x17460000 0x10000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
google,pmu-intr-gen-syscon = <&pmu_intr_gen>;
+
+ pd_g3d: power-domain@1e00 {
+ compatible = "google,gs101-pd";
+ reg = <0x1e00 0x80>;
+ #power-domain-cells = <0>;
+ label = "g3d";
+ samsung,dtzpc = <&pd_g3d>;
+ };
+
+ power-domain@2000 {
+ compatible = "google,gs101-pd";
+ reg = <0x2000 0x80>;
+ #power-domain-cells = <0>;
+ power-domains = <&pd_g3d>;
+ label = "embedded_g3d";
+ };
};
--
2.53.0.rc2.204.g2597b5adb4-goog
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 05/10] pmdomain: samsung: convert to using regmap
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
` (3 preceding siblings ...)
2026-02-05 21:42 ` [PATCH v5 04/10] dt-bindings: soc: google: gs101-pmu: allow power domains as children André Draszik
@ 2026-02-05 21:42 ` André Draszik
2026-02-05 21:42 ` [PATCH v5 06/10] pmdomain: samsung: don't hard-code offset for registers to 0 and 4 André Draszik
` (5 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik, Marek Szyprowski
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 <m.szyprowski@samsung.com>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
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/pmdomain/samsung/exynos-pm-domains.c
index 5c3aa898308793d424fb761c58ca01ba2580aeb5..3bcba7d38ac1572ef4bc2f4052c904dd6c4a7bfd 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-device-tree
// based power domain support is included.
-#include <linux/io.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/pm_domain.h>
#include <linux/delay.h>
#include <linux/of.h>
-#include <linux/of_address.h>
#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
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;
pd = container_of(domain, struct exynos_pm_domain, pd);
- base = pd->base;
pwr = power_on ? pd->local_pwr_cfg : 0;
- writel_relaxed(pwr, base);
+ err = 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;
+ }
/* Wait max 1ms */
timeout = 10;
-
- while ((readl_relaxed(base + 0x4) & pd->local_pwr_cfg) != pwr) {
- if (!timeout) {
- op = (power_on) ? "enable" : "disable";
- pr_err("Power domain %s %s failed\n", domain->name, op);
- return -ETIMEDOUT;
+ while (timeout-- > 0) {
+ unsigned int val;
+
+ err = regmap_read(pd->regmap, 0x4, &val);
+ if (err || ((val & pd->local_pwr_cfg) != pwr)) {
+ cpu_relax();
+ usleep_range(80, 100);
+ continue;
}
- timeout--;
- cpu_relax();
- usleep_range(80, 100);
+
+ break;
}
- return 0;
+ if (!timeout && !err)
+ /* Only return timeout if no other error also occurred. */
+ err = -ETIMEDOUT;
+ if (err)
+ pr_err("Power domain %s %sable failed: %d\n", domain->name,
+ power_on ? "en" : "dis", err);
+
+ return err;
}
static int exynos_pd_power_on(struct generic_pm_domain *domain)
@@ -109,8 +119,18 @@ static int exynos_pd_probe(struct platform_device *pdev)
struct device_node *np = 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;
+ struct regmap_config reg_config = {
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_stride = 4,
+ .use_relaxed_mmio = true,
+ };
+
pm_domain_cfg = of_device_get_match_data(dev);
pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
if (!pd)
@@ -120,9 +140,26 @@ static int exynos_pd_probe(struct platform_device *pdev)
if (!pd->pd.name)
return -ENOMEM;
- pd->base = 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 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res)
+ return dev_err_probe(dev, -ENXIO, "missing IO resources");
+
+ base = 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 = resource_size(res) - reg_config.reg_stride;
+ pd->regmap = devm_regmap_init_mmio(dev, base, ®_config);
+ if (IS_ERR(pd->regmap))
+ return dev_err_probe(dev, PTR_ERR(base),
+ "failed to init regmap");
pd->pd.power_off = exynos_pd_power_off;
pd->pd.power_on = exynos_pd_power_on;
@@ -137,7 +174,11 @@ static int exynos_pd_probe(struct platform_device *pdev)
of_device_is_compatible(np, "samsung,exynos4210-pd"))
exynos_pd_power_off(&pd->pd);
- on = readl_relaxed(pd->base + 0x4) & pd->local_pwr_cfg;
+ ret = regmap_read(pd->regmap, 0x4, &val);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to read status");
+
+ on = val & pd->local_pwr_cfg;
pm_genpd_init(&pd->pd, NULL, !on);
ret = of_genpd_add_provider_simple(np, &pd->pd);
--
2.53.0.rc2.204.g2597b5adb4-goog
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 06/10] pmdomain: samsung: don't hard-code offset for registers to 0 and 4
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
` (4 preceding siblings ...)
2026-02-05 21:42 ` [PATCH v5 05/10] pmdomain: samsung: convert to using regmap André Draszik
@ 2026-02-05 21:42 ` André Draszik
2026-02-05 21:42 ` [PATCH v5 07/10] pmdomain: samsung: add support for google,gs101-pd André Draszik
` (4 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik, Marek Szyprowski
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 <m.szyprowski@samsung.com>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
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/pmdomain/samsung/exynos-pm-domains.c
index 3bcba7d38ac1572ef4bc2f4052c904dd6c4a7bfd..8df46b41f9bc8f0b2a03300169a4b52457faaf4d 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;
};
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 *domain, bool power_on)
pd = container_of(domain, struct exynos_pm_domain, pd);
pwr = power_on ? pd->local_pwr_cfg : 0;
- err = regmap_write(pd->regmap, 0, pwr);
+ err = 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 *domain, bool power_on)
while (timeout-- > 0) {
unsigned int val;
- err = regmap_read(pd->regmap, 0x4, &val);
+ err = regmap_read(pd->regmap, pd->status_reg, &val);
if (err || ((val & pd->local_pwr_cfg) != pwr)) {
cpu_relax();
usleep_range(80, 100);
@@ -164,6 +166,8 @@ static int exynos_pd_probe(struct platform_device *pdev)
pd->pd.power_off = exynos_pd_power_off;
pd->pd.power_on = exynos_pd_power_on;
pd->local_pwr_cfg = pm_domain_cfg->local_pwr_cfg;
+ pd->configuration_reg += 0;
+ pd->status_reg += 4;
/*
* 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);
- ret = regmap_read(pd->regmap, 0x4, &val);
+ ret = regmap_read(pd->regmap, pd->status_reg, &val);
if (ret)
return dev_err_probe(dev, ret, "failed to read status");
--
2.53.0.rc2.204.g2597b5adb4-goog
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 07/10] pmdomain: samsung: add support for google,gs101-pd
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
` (5 preceding siblings ...)
2026-02-05 21:42 ` [PATCH v5 06/10] pmdomain: samsung: don't hard-code offset for registers to 0 and 4 André Draszik
@ 2026-02-05 21:42 ` André Draszik
2026-02-05 21:42 ` [PATCH v5 08/10] pmdomain: samsung: use dev_err() instead of pr_err() André Draszik
` (3 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik, Marek Szyprowski
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 <m.szyprowski@samsung.com>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
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/pmdomain/samsung/exynos-pm-domains.c
index 8df46b41f9bc8f0b2a03300169a4b52457faaf4d..2214d9f32d5967b60e84f68f4e99a725d66a39eb 100644
--- a/drivers/pmdomain/samsung/exynos-pm-domains.c
+++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
@@ -12,6 +12,7 @@
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
+#include <linux/mfd/syscon.h>
#include <linux/pm_domain.h>
#include <linux/delay.h>
#include <linux/of.h>
@@ -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;
};
/*
@@ -93,8 +95,16 @@ static const struct exynos_pm_domain_config exynos5433_cfg = {
.local_pwr_cfg = 0xf,
};
+static const struct exynos_pm_domain_config gs101_cfg = {
+ .local_pwr_cfg = BIT(0),
+ .use_parent_regmap = true,
+};
+
static const struct of_device_id exynos_pm_domain_of_match[] = {
{
+ .compatible = "google,gs101-pd",
+ .data = &gs101_cfg,
+ }, {
.compatible = "samsung,exynos4210-pd",
.data = &exynos4210_cfg,
}, {
@@ -122,17 +132,9 @@ static int exynos_pd_probe(struct platform_device *pdev)
struct of_phandle_args child, parent;
struct exynos_pm_domain *pd;
struct resource *res;
- void __iomem *base;
unsigned int val;
int on, ret;
- struct regmap_config reg_config = {
- .reg_bits = 32,
- .val_bits = 32,
- .reg_stride = 4,
- .use_relaxed_mmio = true,
- };
-
pm_domain_cfg = of_device_get_match_data(dev);
pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
if (!pd)
@@ -143,25 +145,49 @@ static int exynos_pd_probe(struct platform_device *pdev)
return -ENOMEM;
/*
- * 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 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return dev_err_probe(dev, -ENXIO, "missing IO resources");
- base = 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 = resource_size(res) - reg_config.reg_stride;
- pd->regmap = 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 = 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 = res->start;
+ pd->status_reg = res->start;
+ } else {
+ void __iomem *base;
+
+ const struct regmap_config reg_config = {
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_stride = 4,
+ .use_relaxed_mmio = true,
+ .max_register = (resource_size(res)
+ - reg_config.reg_stride),
+ };
+
+ base = devm_ioremap(dev, res->start, resource_size(res));
+ if (!base)
+ return dev_err_probe(dev, -ENOMEM,
+ "failed to ioremap PMU registers");
+
+ pd->regmap = devm_regmap_init_mmio(dev, base, ®_config);
+ if (IS_ERR(pd->regmap))
+ return dev_err_probe(dev, PTR_ERR(base),
+ "failed to init regmap");
+ }
pd->pd.power_off = exynos_pd_power_off;
pd->pd.power_on = exynos_pd_power_on;
--
2.53.0.rc2.204.g2597b5adb4-goog
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 08/10] pmdomain: samsung: use dev_err() instead of pr_err()
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
` (6 preceding siblings ...)
2026-02-05 21:42 ` [PATCH v5 07/10] pmdomain: samsung: add support for google,gs101-pd André Draszik
@ 2026-02-05 21:42 ` André Draszik
2026-02-05 21:42 ` [PATCH v5 09/10] pmdomain: samsung: implement SMC to save / restore TZ config André Draszik
` (2 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik, Marek Szyprowski,
Krzysztof Kozlowski
dev_err() gives us more consistent error messages, which include the
device. Switch to using dev_err().
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
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/pmdomain/samsung/exynos-pm-domains.c
index 2214d9f32d5967b60e84f68f4e99a725d66a39eb..41a232b3cdaf0f4be413b25d9373b99c6a3db602 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 *domain, bool power_on)
pwr = power_on ? pd->local_pwr_cfg : 0;
err = 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;
}
@@ -71,8 +73,8 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
/* Only return timeout if no other error also occurred. */
err = -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);
return err;
}
@@ -140,6 +142,8 @@ static int exynos_pd_probe(struct platform_device *pdev)
if (!pd)
return -ENOMEM;
+ pd->dev = dev;
+
pd->pd.name = exynos_get_domain_name(dev, np);
if (!pd->pd.name)
return -ENOMEM;
--
2.53.0.rc2.204.g2597b5adb4-goog
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 09/10] pmdomain: samsung: implement SMC to save / restore TZ config
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
` (7 preceding siblings ...)
2026-02-05 21:42 ` [PATCH v5 08/10] pmdomain: samsung: use dev_err() instead of pr_err() André Draszik
@ 2026-02-05 21:42 ` André Draszik
2026-02-05 21:42 ` [PATCH v5 10/10] pmdomain: samsung: implement domain-supply regulator André Draszik
2026-03-03 15:46 ` [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 Ulf Hansson
10 siblings, 0 replies; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik
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@linaro.org/ [1]
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
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/pmdomain/samsung/exynos-pm-domains.c
index 41a232b3cdaf0f4be413b25d9373b99c6a3db602..f59986b56213dfcc470d9cccc61a36a81954bdcc 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-device-tree
// based power domain support is included.
+#include <linux/arm-smccc.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
@@ -16,12 +17,19 @@
#include <linux/pm_domain.h>
#include <linux/delay.h>
#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
+#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;
};
@@ -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;
};
+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 *domain, bool power_on)
pd = container_of(domain, struct exynos_pm_domain, pd);
- pwr = power_on ? pd->local_pwr_cfg : 0;
+ if (!power_on) {
+ err = 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 = power_on ? pd->cfg->local_pwr_cfg : 0;
err = 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 *domain, bool power_on)
unsigned int val;
err = regmap_read(pd->regmap, pd->status_reg, &val);
- if (err || ((val & pd->local_pwr_cfg) != pwr)) {
+ if (err || ((val & pd->cfg->local_pwr_cfg) != pwr)) {
cpu_relax();
usleep_range(80, 100);
continue;
@@ -72,9 +107,21 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
if (!timeout && !err)
/* Only return timeout if no other error also occurred. */
err = -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 = 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;
+ }
+ }
return err;
}
@@ -99,6 +146,7 @@ static const struct exynos_pm_domain_config exynos5433_cfg = {
static const struct exynos_pm_domain_config gs101_cfg = {
.local_pwr_cfg = BIT(0),
+ .smc_offset = 0x0204,
.use_parent_regmap = true,
};
@@ -126,6 +174,38 @@ static const char *exynos_get_domain_name(struct device *dev,
return devm_kstrdup_const(dev, name, GFP_KERNEL);
}
+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 = of_parse_phandle(pd->dev->of_node, "samsung,dtzpc", 0);
+ if (!ac_np)
+ return 0;
+
+ ret = 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 = 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) == -ENOENT) {
+ pd->ac_pa = 0;
+ pd->pd.flags |= 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 *pdev)
pd->pd.power_off = exynos_pd_power_off;
pd->pd.power_on = exynos_pd_power_on;
- pd->local_pwr_cfg = pm_domain_cfg->local_pwr_cfg;
+ pd->cfg = pm_domain_cfg;
pd->configuration_reg += 0;
pd->status_reg += 4;
+ ret = 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");
- on = val & pd->local_pwr_cfg;
+ on = val & pd->cfg->local_pwr_cfg;
pm_genpd_init(&pd->pd, NULL, !on);
ret = of_genpd_add_provider_simple(np, &pd->pd);
--
2.53.0.rc2.204.g2597b5adb4-goog
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 10/10] pmdomain: samsung: implement domain-supply regulator
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
` (8 preceding siblings ...)
2026-02-05 21:42 ` [PATCH v5 09/10] pmdomain: samsung: implement SMC to save / restore TZ config André Draszik
@ 2026-02-05 21:42 ` André Draszik
2026-03-03 15:46 ` [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 Ulf Hansson
10 siblings, 0 replies; 19+ messages in thread
From: André Draszik @ 2026-02-05 21:42 UTC (permalink / raw)
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, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, André Draszik
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é Draszik <andre.draszik@linaro.org>
---
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/pmdomain/samsung/exynos-pm-domains.c
index f59986b56213dfcc470d9cccc61a36a81954bdcc..ed7a5807555bcf86e4ec88166bfd5f6c06c9322c 100644
--- a/drivers/pmdomain/samsung/exynos-pm-domains.c
+++ b/drivers/pmdomain/samsung/exynos-pm-domains.c
@@ -20,12 +20,15 @@
#include <linux/of_address.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
#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
+#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 exynos_pm_domain *pd,
static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
{
- struct exynos_pm_domain *pd;
+ struct exynos_pm_domain *pd = to_exynos_pd(domain);
u32 timeout, pwr;
int err;
- pd = container_of(domain, struct exynos_pm_domain, pd);
-
if (!power_on) {
err = 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;
}
+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 = to_exynos_pd(domain);
+ int ret;
+
+ ret = exynos_pd_regulator_enable(pd->supply);
+ if (ret)
+ return ret;
+
+ ret = exynos_pd_power(domain, true);
+ if (ret)
+ exynos_pd_regulator_disable(pd->supply);
+
+ return ret;
}
static int exynos_pd_power_off(struct generic_pm_domain *domain)
{
- return exynos_pd_power(domain, false);
+ struct exynos_pm_domain *pd = to_exynos_pd(domain);
+ int ret;
+
+ ret = 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;
}
static const struct exynos_pm_domain_config exynos4210_cfg = {
@@ -283,6 +316,16 @@ static int exynos_pd_probe(struct platform_device *pdev)
if (ret)
return ret;
+ /* get the domain power supply if required */
+ pd->supply = devm_regulator_get_optional(dev, "domain");
+ if (IS_ERR(pd->supply)) {
+ if (PTR_ERR(pd->supply) != -ENODEV)
+ return dev_err_probe(dev, PTR_ERR(pd->supply),
+ "failed to get domain supply");
+
+ pd->supply = NULL;
+ }
+
/*
* Some Samsung platforms with bootloaders turning on the splash-screen
* and handing it over to the kernel, requires the power-domains to be
--
2.53.0.rc2.204.g2597b5adb4-goog
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v5 01/10] dt-bindings: soc: google: add google,gs101-dtzpc
2026-02-05 21:42 ` [PATCH v5 01/10] dt-bindings: soc: google: add google,gs101-dtzpc André Draszik
@ 2026-02-11 20:58 ` Rob Herring (Arm)
0 siblings, 0 replies; 19+ messages in thread
From: Rob Herring (Arm) @ 2026-02-11 20:58 UTC (permalink / raw)
To: André Draszik
Cc: Mark Brown, Liam Girdwood, Ulf Hansson, kernel-team,
linux-samsung-soc, linux-kernel, Tudor Ambarus, Peter Griffin,
Will McVicker, devicetree, linux-arm-kernel, linux-pm,
Conor Dooley, Krzysztof Kozlowski, Juan Yescas,
Krzysztof Kozlowski, Alim Akhtar
On Thu, 05 Feb 2026 21:42:29 +0000, André Draszik wrote:
> 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é Draszik <andre.draszik@linaro.org>
> ---
> .../bindings/soc/google/google,gs101-dtzpc.yaml | 42 ++++++++++++++++++++++
> MAINTAINERS | 1 +
> 2 files changed, 43 insertions(+)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v5 02/10] dt-bindings: power: samsung: add google,gs101-pd
2026-02-05 21:42 ` [PATCH v5 02/10] dt-bindings: power: samsung: add google,gs101-pd André Draszik
@ 2026-02-11 21:01 ` Rob Herring (Arm)
0 siblings, 0 replies; 19+ messages in thread
From: Rob Herring (Arm) @ 2026-02-11 21:01 UTC (permalink / raw)
To: André Draszik
Cc: Conor Dooley, linux-kernel, Liam Girdwood, linux-samsung-soc,
Mark Brown, Krzysztof Kozlowski, linux-pm, Alim Akhtar,
devicetree, linux-arm-kernel, kernel-team, Tudor Ambarus,
Peter Griffin, Krzysztof Kozlowski, Will McVicker, Ulf Hansson,
Juan Yescas
On Thu, 05 Feb 2026 21:42:30 +0000, André Draszik wrote:
> 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.
>
> Power domains can also have a power supply linked to them, so add
> optional support for that, too. It is believed that all (existing)
> platforms could benefit from this, hence it's not being limited to
> gs101-pd.
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
>
> ---
> v5:
> - add domain-supply and update commit message
>
> v4:
> - add new vendor property samsung,dtzpc
> - drop previous tags due to that
> ---
> .../devicetree/bindings/power/pd-samsung.yaml | 33 ++++++++++++++++++++--
> 1 file changed, 30 insertions(+), 3 deletions(-)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v5 03/10] dt-bindings: soc: samsung: exynos-pmu: move gs101-pmu into separate binding
2026-02-05 21:42 ` [PATCH v5 03/10] dt-bindings: soc: samsung: exynos-pmu: move gs101-pmu into separate binding André Draszik
@ 2026-02-11 21:03 ` Rob Herring (Arm)
0 siblings, 0 replies; 19+ messages in thread
From: Rob Herring (Arm) @ 2026-02-11 21:03 UTC (permalink / raw)
To: André Draszik
Cc: kernel-team, linux-pm, Liam Girdwood, Krzysztof Kozlowski,
Marek Szyprowski, Mark Brown, Juan Yescas, Will McVicker,
linux-arm-kernel, Krzysztof Kozlowski, Tudor Ambarus, Ulf Hansson,
Peter Griffin, linux-samsung-soc, devicetree, Alim Akhtar,
Conor Dooley, linux-kernel
On Thu, 05 Feb 2026 21:42:31 +0000, André Draszik wrote:
> 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 <m.szyprowski@samsung.com>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
> 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(-)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v5 04/10] dt-bindings: soc: google: gs101-pmu: allow power domains as children
2026-02-05 21:42 ` [PATCH v5 04/10] dt-bindings: soc: google: gs101-pmu: allow power domains as children André Draszik
@ 2026-02-11 21:12 ` Rob Herring
2026-02-12 12:03 ` André Draszik
0 siblings, 1 reply; 19+ messages in thread
From: Rob Herring @ 2026-02-11 21:12 UTC (permalink / raw)
To: André Draszik
Cc: Krzysztof Kozlowski, Alim Akhtar, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson, Liam Girdwood, Mark Brown,
Peter Griffin, Tudor Ambarus, Juan Yescas, Will McVicker,
kernel-team, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, Marek Szyprowski
On Thu, Feb 05, 2026 at 09:42:32PM +0000, André Draszik wrote:
> 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 <m.szyprowski@samsung.com>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
> 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).
We can't have warnings added if they aren't valid.
> 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.
For a given compatible, you should either have child nodes or you don't.
The h/w is not variable. So something like this should work:
if:
properties:
compatible:
contains:
const: foo,bar
then:
required:
- ranges
- '#address-cells'
- '#size-cells'
Rob
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v5 04/10] dt-bindings: soc: google: gs101-pmu: allow power domains as children
2026-02-11 21:12 ` Rob Herring
@ 2026-02-12 12:03 ` André Draszik
2026-02-12 20:06 ` Rob Herring
0 siblings, 1 reply; 19+ messages in thread
From: André Draszik @ 2026-02-12 12:03 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, Alim Akhtar, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson, Liam Girdwood, Mark Brown,
Peter Griffin, Tudor Ambarus, Juan Yescas, Will McVicker,
kernel-team, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, Marek Szyprowski
Hi Rob,
On Wed, 2026-02-11 at 15:12 -0600, Rob Herring wrote:
> On Thu, Feb 05, 2026 at 09:42:32PM +0000, André Draszik wrote:
> > 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 <m.szyprowski@samsung.com>
> > Signed-off-by: André Draszik <andre.draszik@linaro.org>
> > ---
> > 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).
>
> We can't have warnings added if they aren't valid.
>
> > 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.
>
> For a given compatible, you should either have child nodes or you don't.
> The h/w is not variable. So something like this should work:
>
> if:
> properties:
> compatible:
> contains:
> const: foo,bar
>
> then:
> required:
> - ranges
> - '#address-cells'
> - '#size-cells'
>
Thanks Rob, yes, that works in general, but unfortunately in this case existing
DTs don't specify ranges etc for the google,gs101-pmu compatible. (This binding
is specifically for google,gs101-pmu only anyway).
The above suggestion will cause the same validation warnings for existing DTs
which is no different to just adding those properties to the top-level required:
as my patch is doing. Unless I misunderstood your suggestion.
The compatible doesn't change with these patches. So I'm not sure how to make
your suggestion work without causing warnings for existing DTs. We can either
have an old incomplete DT+binding:
pmu_system_controller: system-controller@17460000 {
compatible = "google,gs101-pmu";
reg = <0x17460000 0x10000>;
};
or the new one:
pmu_system_controller: system-controller@17460000 {
compatible = "google,gs101-pmu";
reg = <0x17460000 0x10000>;
ranges;
#address-cells = <1>;
#size-cells = <1>;
power-domain@1c00 {
compatible = "google,gs101-pd";
reg = <0x1c00 0x80>;
#power-domain-cells = <0>;
label = "eh";
samsung,dtzpc = <&dtzpc_eh>;
};
};
I.e. in the old case (when binding + DT were incomplete) ranges etc. are
not 'required' (and shouldn't be), while with the power-domain@[0-9a-f]+
child node(s) added, ranges etc must be specified.
If power-domain@[0-9a-f]+ wasn't a pattern, it'd be easy, but I really want
it to be a pattern, not least because there are so many instances.
What works (at the top level) is:
dependentRequired:
power-domain@1e00: [ranges]
but it would require spelling out all the instances instead of a pattern. The
following (or various variations I've tried) doesn't:
dependentRequired:
power-domain@.*: [ranges]
I've also tried to come up with something involving dependentSchemas:, but to no
avail.
Similarly,
allOf:
- if:
anyOf:
- required: [power-domain@1e00]
- required: [power-domain@2000]
then:
required:
- ranges
works, but when using a regex, it doesn't:
allOf:
- if:
anyOf:
- required: [power-domain@.*]
then:
required:
- ranges
I've also tried:
allOf:
- if:
required:
- "^power-domain@[0-9a-f]+$"
then:
required:
- ranges
and
anyOf:
- required:
- power-domain@1e00
- ranges
- reg
- required:
- reg
and
anyOf:
- required:
- "^power-domain@[0-9a-f]+$"
- ranges
- reg
- required:
- reg
None of these seem to do what I would like (even the non-regex one).
Cheers,
Andre'
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v5 04/10] dt-bindings: soc: google: gs101-pmu: allow power domains as children
2026-02-12 12:03 ` André Draszik
@ 2026-02-12 20:06 ` Rob Herring
2026-02-12 20:33 ` André Draszik
0 siblings, 1 reply; 19+ messages in thread
From: Rob Herring @ 2026-02-12 20:06 UTC (permalink / raw)
To: André Draszik
Cc: Krzysztof Kozlowski, Alim Akhtar, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson, Liam Girdwood, Mark Brown,
Peter Griffin, Tudor Ambarus, Juan Yescas, Will McVicker,
kernel-team, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, Marek Szyprowski
On Thu, Feb 12, 2026 at 6:03 AM André Draszik <andre.draszik@linaro.org> wrote:
>
> Hi Rob,
>
> On Wed, 2026-02-11 at 15:12 -0600, Rob Herring wrote:
> > On Thu, Feb 05, 2026 at 09:42:32PM +0000, André Draszik wrote:
> > > 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 <m.szyprowski@samsung.com>
> > > Signed-off-by: André Draszik <andre.draszik@linaro.org>
> > > ---
> > > 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).
> >
> > We can't have warnings added if they aren't valid.
> >
> > > 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.
> >
> > For a given compatible, you should either have child nodes or you don't.
> > The h/w is not variable. So something like this should work:
> >
> > if:
> > properties:
> > compatible:
> > contains:
> > const: foo,bar
> >
> > then:
> > required:
> > - ranges
> > - '#address-cells'
> > - '#size-cells'
> >
>
> Thanks Rob, yes, that works in general, but unfortunately in this case existing
> DTs don't specify ranges etc for the google,gs101-pmu compatible. (This binding
> is specifically for google,gs101-pmu only anyway).
>
> The above suggestion will cause the same validation warnings for existing DTs
> which is no different to just adding those properties to the top-level required:
> as my patch is doing. Unless I misunderstood your suggestion.
"google,gs101-pmu" represents some specific h/w. That h/w either has
power domains or it doesn't. So which is it?
> The compatible doesn't change with these patches. So I'm not sure how to make
> your suggestion work without causing warnings for existing DTs. We can either
> have an old incomplete DT+binding:
If this is considered incomplete, then you are going to complete it
and add the child nodes? If so, then the warnings are appropriate.
If you were going to maintain both bindings forever, then you would
probably want a new compatible. Or just drop the properties from
required. Note that if you have child nodes with 'reg' and parent
missing #address-cells or #size-cells, then dtc will warn about that.
So it's not too important if the schema doesn't.
>
> pmu_system_controller: system-controller@17460000 {
> compatible = "google,gs101-pmu";
> reg = <0x17460000 0x10000>;
> };
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v5 04/10] dt-bindings: soc: google: gs101-pmu: allow power domains as children
2026-02-12 20:06 ` Rob Herring
@ 2026-02-12 20:33 ` André Draszik
0 siblings, 0 replies; 19+ messages in thread
From: André Draszik @ 2026-02-12 20:33 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, Alim Akhtar, Conor Dooley,
Krzysztof Kozlowski, Ulf Hansson, Liam Girdwood, Mark Brown,
Peter Griffin, Tudor Ambarus, Juan Yescas, Will McVicker,
kernel-team, linux-arm-kernel, linux-samsung-soc, devicetree,
linux-kernel, linux-pm, Marek Szyprowski
Hi Rob,
On Thu, 2026-02-12 at 14:06 -0600, Rob Herring wrote:
> On Thu, Feb 12, 2026 at 6:03 AM André Draszik <andre.draszik@linaro.org> wrote:
>
>
> "google,gs101-pmu" represents some specific h/w. That h/w either has
> power domains or it doesn't. So which is it?
It does have power domains, they were missing during the initial submission of
bindings and DTS.
>
> > The compatible doesn't change with these patches. So I'm not sure how to make
> > your suggestion work without causing warnings for existing DTs. We can either
> > have an old incomplete DT+binding:
>
> If this is considered incomplete, then you are going to complete it
> and add the child nodes? If so, then the warnings are appropriate.
Yes, I'm going to update the relevant DTS to include power domains.
> If you were going to maintain both bindings forever, then you would
> probably want a new compatible. Or just drop the properties from
> required. Note that if you have child nodes with 'reg' and parent
> missing #address-cells or #size-cells, then dtc will warn about that.
> So it's not too important if the schema doesn't.
Maybe the commit message or footer comment was clear enough, sorry for that.
I never intended to support both old (incomplete) and new DT.
Dropping from required did cross my mind, as I also saw the warning about
missing #address-cells or #size-cells in that case. Missing 'ranges' would
still not trigger a warning, though.
So does my above explanation mean you're OK with the patch as such? I can
reword the commit message a bit to point out that while this binding update
breaks existing DTS, I will update them as they're simply incomplete.
Cheers,
Andre'
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
` (9 preceding siblings ...)
2026-02-05 21:42 ` [PATCH v5 10/10] pmdomain: samsung: implement domain-supply regulator André Draszik
@ 2026-03-03 15:46 ` Ulf Hansson
10 siblings, 0 replies; 19+ messages in thread
From: Ulf Hansson @ 2026-03-03 15:46 UTC (permalink / raw)
To: André Draszik
Cc: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
Krzysztof Kozlowski, Liam Girdwood, Mark Brown, Peter Griffin,
Tudor Ambarus, Juan Yescas, Will McVicker, kernel-team,
linux-arm-kernel, linux-samsung-soc, devicetree, linux-kernel,
linux-pm, Marek Szyprowski
On Thu, 5 Feb 2026 at 22:42, André Draszik <andre.draszik@linaro.org> wrote:
>
> Hi,
>
> This series adds support for the power domains on Google GS101.
>
> There are a few differences compared to SoCs already supported by this
> driver:
> * register access does not work via plain ioremap() / readl() /
> writel().
> Instead, the regmap created by the PMU driver must be used (which
> uses Arm SMCC calls under the hood).
> * DTZPC: a call needs to be made before and after power domain off/on,
> to inform the EL3 firmware of the request.
> * power domains can and are fed by a regulator rail and therefore
> regulator control needed be implemented.
>
> Bullet points 2 and 3 are new since version 4 of this series, and
> related changes are in patches 1, 2, 9, and 10. I can merge patch 9
> (SMC call) into the gs101 patch (patch 7) if preferred, but for now I
> kept them independent to make it easier to see changes compared to
> previous versions of this series, and because patch 9 actually applies
> to not only gs101, but to many newer Exynos SoCs, and to make patches 9
> and 10 themselves easier to review and reason about.
>
> The DT update to add the new required properties on gs101 will be
> posted separately.
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
> Changes in v5:
> - add domain-supply to binding (patch 2)
> - Link to v4: https://lore.kernel.org/r/20260128-gs101-pd-v4-0-cbe7bd5a4060@linaro.org
[...]
FYI, I have reviewed this and it looks good to me. Although, I am
awaiting a new version/confirmation about the last DT patch from Rob
before applying.
Kind regards
Uffe
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2026-03-03 15:47 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05 21:42 [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 André Draszik
2026-02-05 21:42 ` [PATCH v5 01/10] dt-bindings: soc: google: add google,gs101-dtzpc André Draszik
2026-02-11 20:58 ` Rob Herring (Arm)
2026-02-05 21:42 ` [PATCH v5 02/10] dt-bindings: power: samsung: add google,gs101-pd André Draszik
2026-02-11 21:01 ` Rob Herring (Arm)
2026-02-05 21:42 ` [PATCH v5 03/10] dt-bindings: soc: samsung: exynos-pmu: move gs101-pmu into separate binding André Draszik
2026-02-11 21:03 ` Rob Herring (Arm)
2026-02-05 21:42 ` [PATCH v5 04/10] dt-bindings: soc: google: gs101-pmu: allow power domains as children André Draszik
2026-02-11 21:12 ` Rob Herring
2026-02-12 12:03 ` André Draszik
2026-02-12 20:06 ` Rob Herring
2026-02-12 20:33 ` André Draszik
2026-02-05 21:42 ` [PATCH v5 05/10] pmdomain: samsung: convert to using regmap André Draszik
2026-02-05 21:42 ` [PATCH v5 06/10] pmdomain: samsung: don't hard-code offset for registers to 0 and 4 André Draszik
2026-02-05 21:42 ` [PATCH v5 07/10] pmdomain: samsung: add support for google,gs101-pd André Draszik
2026-02-05 21:42 ` [PATCH v5 08/10] pmdomain: samsung: use dev_err() instead of pr_err() André Draszik
2026-02-05 21:42 ` [PATCH v5 09/10] pmdomain: samsung: implement SMC to save / restore TZ config André Draszik
2026-02-05 21:42 ` [PATCH v5 10/10] pmdomain: samsung: implement domain-supply regulator André Draszik
2026-03-03 15:46 ` [PATCH v5 00/10] pmdomain: samsung: add support for Google GS101 Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox