devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture
@ 2025-11-19  9:37 Jon Hunter
  2025-11-19  9:37 ` [PATCH V2 2/2] soc/tegra: pmc: don't fail if "aotag" is not present Jon Hunter
  2025-11-19 10:04 ` [PATCH V2 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture Krzysztof Kozlowski
  0 siblings, 2 replies; 4+ messages in thread
From: Jon Hunter @ 2025-11-19  9:37 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thierry Reding
  Cc: devicetree, linux-tegra, Jon Hunter, Prathamesh Shete

Not all Tegra SoCs or all versions of a particular Tegra SoC may include
the AOTAG aperture. This change makes "aotag" as an optional aperture for
Tegra234 and Tegra264.

Co-developed-by: Prathamesh Shete <pshete@nvidia.com>
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
Changes since V1:
- Simplified reg-names handling of optional aotag range by upon
  Krzysztof's feedback.
- Dropped removal of reg modifications for tegra186 and tegra194.
- Updated reg minItems for tegra186.

 .../bindings/arm/tegra/nvidia,tegra186-pmc.yaml       | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
index be70819020c5..dcd1c5376507 100644
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
+++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
@@ -19,15 +19,15 @@ properties:
       - nvidia,tegra264-pmc
 
   reg:
-    minItems: 4
+    minItems: 3
     maxItems: 5
 
   reg-names:
-    minItems: 4
+    minItems: 3
     items:
       - const: pmc
       - const: wake
-      - const: aotag
+      - enum: [ aotag, scratch, misc ]
       - enum: [ scratch, misc ]
       - const: misc
 
@@ -51,6 +51,7 @@ allOf:
     then:
       properties:
         reg:
+          minItems: 4
           maxItems: 4
         reg-names:
           maxItems: 4
@@ -73,7 +74,9 @@ allOf:
       properties:
         compatible:
           contains:
-            const: nvidia,tegra234-pmc
+            enum:
+              - nvidia,tegra234-pmc
+              - nvidia,tegra264-pmc
     then:
       properties:
         reg-names:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH V2 2/2] soc/tegra: pmc: don't fail if "aotag" is not present
  2025-11-19  9:37 [PATCH V2 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture Jon Hunter
@ 2025-11-19  9:37 ` Jon Hunter
  2025-11-20 10:32   ` Stanimir Varbanov
  2025-11-19 10:04 ` [PATCH V2 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture Krzysztof Kozlowski
  1 sibling, 1 reply; 4+ messages in thread
From: Jon Hunter @ 2025-11-19  9:37 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thierry Reding
  Cc: devicetree, linux-tegra, Prathamesh Shete, Shardar Mohammed,
	Jon Hunter

From: Prathamesh Shete <pshete@nvidia.com>

The "aotog" is an optional aperture, so if that aperture is not defined
for a given device, then initialise the 'aotag' pointer to NULL instead
of returning an error. Note that the PMC driver will not use 'aotag'
pointer if initialised to NULL.

Co-developed-by: Shardar Mohammed <smohammed@nvidia.com>
Signed-off-by: Shardar Mohammed <smohammed@nvidia.com>
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
Changes since V2:
- None

 drivers/soc/tegra/pmc.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 034a2a535a1e..d8c8894a8f38 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -2897,9 +2897,16 @@ static int tegra_pmc_probe(struct platform_device *pdev)
 		if (IS_ERR(pmc->wake))
 			return PTR_ERR(pmc->wake);
 
-		pmc->aotag = devm_platform_ioremap_resource_byname(pdev, "aotag");
-		if (IS_ERR(pmc->aotag))
-			return PTR_ERR(pmc->aotag);
+		/* "aotag" is an optional aperture */
+		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+						   "aotag");
+		if (res) {
+			pmc->aotag = devm_ioremap_resource(&pdev->dev, res);
+			if (IS_ERR(pmc->aotag))
+				return PTR_ERR(pmc->aotag);
+		} else {
+			pmc->aotag = NULL;
+		}
 
 		/* "scratch" is an optional aperture */
 		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH V2 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture
  2025-11-19  9:37 [PATCH V2 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture Jon Hunter
  2025-11-19  9:37 ` [PATCH V2 2/2] soc/tegra: pmc: don't fail if "aotag" is not present Jon Hunter
@ 2025-11-19 10:04 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-19 10:04 UTC (permalink / raw)
  To: Jon Hunter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Thierry Reding
  Cc: devicetree, linux-tegra, Prathamesh Shete

On 19/11/2025 10:37, Jon Hunter wrote:
> Not all Tegra SoCs or all versions of a particular Tegra SoC may include
> the AOTAG aperture. This change makes "aotag" as an optional aperture for
> Tegra234 and Tegra264.
> 
> Co-developed-by: Prathamesh Shete <pshete@nvidia.com>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---


Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2 2/2] soc/tegra: pmc: don't fail if "aotag" is not present
  2025-11-19  9:37 ` [PATCH V2 2/2] soc/tegra: pmc: don't fail if "aotag" is not present Jon Hunter
@ 2025-11-20 10:32   ` Stanimir Varbanov
  0 siblings, 0 replies; 4+ messages in thread
From: Stanimir Varbanov @ 2025-11-20 10:32 UTC (permalink / raw)
  To: Jon Hunter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Thierry Reding
  Cc: devicetree, linux-tegra, Prathamesh Shete, Shardar Mohammed

Hi Jon,

On 11/19/25 11:37 AM, Jon Hunter wrote:
> From: Prathamesh Shete <pshete@nvidia.com>
> 
> The "aotog" is an optional aperture, so if that aperture is not defined
> for a given device, then initialise the 'aotag' pointer to NULL instead
> of returning an error. Note that the PMC driver will not use 'aotag'
> pointer if initialised to NULL.
> 
> Co-developed-by: Shardar Mohammed <smohammed@nvidia.com>
> Signed-off-by: Shardar Mohammed <smohammed@nvidia.com>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> Changes since V2:
> - None
> 
>  drivers/soc/tegra/pmc.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)

Reviewed-by: Stanimir Varbanov <svarbanov@suse.de>
Tested-by: Stanimir Varbanov <svarbanov@suse.de>

~Stan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-20 10:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19  9:37 [PATCH V2 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture Jon Hunter
2025-11-19  9:37 ` [PATCH V2 2/2] soc/tegra: pmc: don't fail if "aotag" is not present Jon Hunter
2025-11-20 10:32   ` Stanimir Varbanov
2025-11-19 10:04 ` [PATCH V2 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).