linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] soc/tegra: pmc: Update address mapping sequence for PMC apertures
@ 2024-01-06  7:51 Petlozu Pravareshwar
  2024-01-06  7:51 ` [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture Petlozu Pravareshwar
  2024-01-06  7:51 ` [PATCH 3/3] soc/tegra: " Petlozu Pravareshwar
  0 siblings, 2 replies; 8+ messages in thread
From: Petlozu Pravareshwar @ 2024-01-06  7:51 UTC (permalink / raw)
  To: thierry.reding, jonathanh, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, p.zabel, dmitry.osipenko, ulf.hansson, kkartik,
	cai.huoqing, spatra, linux-tegra, linux-kernel, devicetree
  Cc: petlozup

On Tegra SoCs prior to Tegra186, PMC has single address range only.
Starting from and after Tegra186, PMC has additional address ranges
apart from base address range. Currently in PMC driver, we try to
map these additional address ranges on all SoCs and if we fail then
we assume that the range is not valid for an SoC. This change makes
it more explicit on which address ranges are expected to be present
on which SoCs and maps the additional address ranges only on SoCs
from and after Tegra186.

Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
---
 drivers/soc/tegra/pmc.c | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 6dfcc7f50ece..0bc983f6b088 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -384,6 +384,7 @@ struct tegra_pmc_soc {
 	bool has_blink_output;
 	bool has_usb_sleepwalk;
 	bool supports_core_domain;
+	bool has_single_mmio_aperture;
 };
 
 /**
@@ -2885,31 +2886,28 @@ static int tegra_pmc_probe(struct platform_device *pdev)
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wake");
-	if (res) {
+	if (pmc->soc->has_single_mmio_aperture) {
+		pmc->wake = base;
+		pmc->aotag = base;
+		pmc->scratch = base;
+	} else {
+		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+						"wake");
 		pmc->wake = devm_ioremap_resource(&pdev->dev, res);
 		if (IS_ERR(pmc->wake))
 			return PTR_ERR(pmc->wake);
-	} else {
-		pmc->wake = base;
-	}
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "aotag");
-	if (res) {
+		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+						"aotag");
 		pmc->aotag = devm_ioremap_resource(&pdev->dev, res);
 		if (IS_ERR(pmc->aotag))
 			return PTR_ERR(pmc->aotag);
-	} else {
-		pmc->aotag = base;
-	}
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "scratch");
-	if (res) {
+		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+						"scratch");
 		pmc->scratch = devm_ioremap_resource(&pdev->dev, res);
 		if (IS_ERR(pmc->scratch))
 			return PTR_ERR(pmc->scratch);
-	} else {
-		pmc->scratch = base;
 	}
 
 	pmc->clk = devm_clk_get_optional(&pdev->dev, "pclk");
@@ -3300,6 +3298,7 @@ static const struct tegra_pmc_soc tegra20_pmc_soc = {
 	.num_pmc_clks = 0,
 	.has_blink_output = true,
 	.has_usb_sleepwalk = true,
+	.has_single_mmio_aperture = true,
 };
 
 static const char * const tegra30_powergates[] = {
@@ -3361,6 +3360,7 @@ static const struct tegra_pmc_soc tegra30_pmc_soc = {
 	.num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data),
 	.has_blink_output = true,
 	.has_usb_sleepwalk = true,
+	.has_single_mmio_aperture = true,
 };
 
 static const char * const tegra114_powergates[] = {
@@ -3418,6 +3418,7 @@ static const struct tegra_pmc_soc tegra114_pmc_soc = {
 	.num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data),
 	.has_blink_output = true,
 	.has_usb_sleepwalk = true,
+	.has_single_mmio_aperture = true,
 };
 
 static const char * const tegra124_powergates[] = {
@@ -3562,6 +3563,7 @@ static const struct tegra_pmc_soc tegra124_pmc_soc = {
 	.num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data),
 	.has_blink_output = true,
 	.has_usb_sleepwalk = true,
+	.has_single_mmio_aperture = true,
 };
 
 static const char * const tegra210_powergates[] = {
@@ -3725,6 +3727,7 @@ static const struct tegra_pmc_soc tegra210_pmc_soc = {
 	.num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data),
 	.has_blink_output = true,
 	.has_usb_sleepwalk = true,
+	.has_single_mmio_aperture = true,
 };
 
 static const struct tegra_io_pad_soc tegra186_io_pads[] = {
@@ -3922,6 +3925,7 @@ static const struct tegra_pmc_soc tegra186_pmc_soc = {
 	.num_pmc_clks = 0,
 	.has_blink_output = false,
 	.has_usb_sleepwalk = false,
+	.has_single_mmio_aperture = false,
 };
 
 static const struct tegra_io_pad_soc tegra194_io_pads[] = {
@@ -4107,6 +4111,7 @@ static const struct tegra_pmc_soc tegra194_pmc_soc = {
 	.num_pmc_clks = 0,
 	.has_blink_output = false,
 	.has_usb_sleepwalk = false,
+	.has_single_mmio_aperture = false,
 };
 
 static const struct tegra_io_pad_soc tegra234_io_pads[] = {
@@ -4235,6 +4240,7 @@ static const struct tegra_pmc_soc tegra234_pmc_soc = {
 	.pmc_clks_data = NULL,
 	.num_pmc_clks = 0,
 	.has_blink_output = false,
+	.has_single_mmio_aperture = false,
 };
 
 static const struct of_device_id tegra_pmc_match[] = {
-- 
2.17.1


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

* [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture
  2024-01-06  7:51 [PATCH 1/3] soc/tegra: pmc: Update address mapping sequence for PMC apertures Petlozu Pravareshwar
@ 2024-01-06  7:51 ` Petlozu Pravareshwar
  2024-01-06  9:51   ` Rob Herring
                     ` (2 more replies)
  2024-01-06  7:51 ` [PATCH 3/3] soc/tegra: " Petlozu Pravareshwar
  1 sibling, 3 replies; 8+ messages in thread
From: Petlozu Pravareshwar @ 2024-01-06  7:51 UTC (permalink / raw)
  To: thierry.reding, jonathanh, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, p.zabel, dmitry.osipenko, ulf.hansson, kkartik,
	cai.huoqing, spatra, linux-tegra, linux-kernel, devicetree
  Cc: petlozup

Scratch address space register is used to store reboot reason. For
some Tegra234 systems, the scratch space is not available to store
the reboot reason. This is because scratch region on these systems
is not accessible by the kernel as restricted by the Hypervisor.
Such systems would delist scratch aperture from PMC DT node.

Accordingly, this change makes "scratch" as an optional aperture for
Tegra234 in PMC dt-binding document.

Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
---
 .../arm/tegra/nvidia,tegra186-pmc.yaml        | 83 +++++++++++++------
 1 file changed, 58 insertions(+), 25 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
index 0faa403f68c8..2716610a1a02 100644
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
+++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
@@ -23,12 +23,7 @@ properties:
 
   reg-names:
     minItems: 4
-    items:
-      - const: pmc
-      - const: wake
-      - const: aotag
-      - const: scratch
-      - const: misc
+    maxItems: 5
 
   interrupt-controller: true
 
@@ -41,25 +36,63 @@ properties:
     description: If present, inverts the PMU interrupt signal.
     $ref: /schemas/types.yaml#/definitions/flag
 
-if:
-  properties:
-    compatible:
-      contains:
-        const: nvidia,tegra186-pmc
-then:
-  properties:
-    reg:
-      maxItems: 4
-
-    reg-names:
-      maxItems: 4
-else:
-  properties:
-    reg:
-      minItems: 5
-
-    reg-names:
-      minItems: 5
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nvidia,tegra186-pmc
+    then:
+      properties:
+        reg:
+          maxItems: 4
+        reg-names:
+          items:
+            - const: pmc
+            - const: wake
+            - const: aotag
+            - const: scratch
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nvidia,tegra194-pmc
+    then:
+      properties:
+        reg:
+          minItems: 5
+        reg-names:
+          items:
+            - const: pmc
+            - const: wake
+            - const: aotag
+            - const: scratch
+            - const: misc
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nvidia,tegra234-pmc
+    then:
+      properties:
+        reg:
+          minItems: 4
+          maxItems: 5
+        reg-names:
+          anyOf:
+           - items:
+               - const: pmc
+               - const: wake
+               - const: aotag
+               - const: misc
+           - items:
+               - const: pmc
+               - const: wake
+               - const: aotag
+               - const: scratch
+               - const: misc
 
 patternProperties:
   "^[a-z0-9]+-[a-z0-9]+$":
-- 
2.17.1


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

* [PATCH 3/3] soc/tegra: pmc: Update scratch as an optional aperture
  2024-01-06  7:51 [PATCH 1/3] soc/tegra: pmc: Update address mapping sequence for PMC apertures Petlozu Pravareshwar
  2024-01-06  7:51 ` [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture Petlozu Pravareshwar
@ 2024-01-06  7:51 ` Petlozu Pravareshwar
  1 sibling, 0 replies; 8+ messages in thread
From: Petlozu Pravareshwar @ 2024-01-06  7:51 UTC (permalink / raw)
  To: thierry.reding, jonathanh, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, p.zabel, dmitry.osipenko, ulf.hansson, kkartik,
	cai.huoqing, spatra, linux-tegra, linux-kernel, devicetree
  Cc: petlozup

Scratch address space register is used to store reboot reason. For
some Tegra234 systems, the scratch space is not available to store
the reboot reason. This is because scratch region on these systems
is not accessible by the kernel as restricted by the Hypervisor.
Such systems would delist scratch aperture from PMC DT node.

Hence this change makes scratch as optional aperture and also avoids
registering reboot notifier if scratch address space isn't mapped.

Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
---
 drivers/soc/tegra/pmc.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 0bc983f6b088..6948f78c7a4a 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -2903,11 +2903,16 @@ static int tegra_pmc_probe(struct platform_device *pdev)
 		if (IS_ERR(pmc->aotag))
 			return PTR_ERR(pmc->aotag);
 
+		/* "scratch" is an optional aperture */
 		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
 						"scratch");
-		pmc->scratch = devm_ioremap_resource(&pdev->dev, res);
-		if (IS_ERR(pmc->scratch))
-			return PTR_ERR(pmc->scratch);
+		if (res) {
+			pmc->scratch = devm_ioremap_resource(&pdev->dev, res);
+			if (IS_ERR(pmc->scratch))
+				return PTR_ERR(pmc->scratch);
+		} else {
+			pmc->scratch = NULL;
+		}
 	}
 
 	pmc->clk = devm_clk_get_optional(&pdev->dev, "pclk");
@@ -2919,12 +2924,15 @@ static int tegra_pmc_probe(struct platform_device *pdev)
 	 * PMC should be last resort for restarting since it soft-resets
 	 * CPU without resetting everything else.
 	 */
-	err = devm_register_reboot_notifier(&pdev->dev,
-					    &tegra_pmc_reboot_notifier);
-	if (err) {
-		dev_err(&pdev->dev, "unable to register reboot notifier, %d\n",
-			err);
-		return err;
+	if (pmc->scratch) {
+		err = devm_register_reboot_notifier(&pdev->dev,
+						    &tegra_pmc_reboot_notifier);
+		if (err) {
+			dev_err(&pdev->dev,
+				"unable to register reboot notifier, %d\n",
+				err);
+			return err;
+		}
 	}
 
 	err = devm_register_sys_off_handler(&pdev->dev,
-- 
2.17.1


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

* Re: [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture
  2024-01-06  7:51 ` [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture Petlozu Pravareshwar
@ 2024-01-06  9:51   ` Rob Herring
  2024-01-17 15:41     ` Petlozu Pravareshwar
  2024-01-08 16:16   ` kernel test robot
  2024-01-08 19:58   ` Rob Herring
  2 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2024-01-06  9:51 UTC (permalink / raw)
  To: Petlozu Pravareshwar
  Cc: conor+dt, cai.huoqing, devicetree, linux-kernel, ulf.hansson,
	thierry.reding, krzysztof.kozlowski+dt, p.zabel, spatra,
	linux-tegra, kkartik, robh+dt, dmitry.osipenko, jonathanh


On Sat, 06 Jan 2024 07:51:33 +0000, Petlozu Pravareshwar wrote:
> Scratch address space register is used to store reboot reason. For
> some Tegra234 systems, the scratch space is not available to store
> the reboot reason. This is because scratch region on these systems
> is not accessible by the kernel as restricted by the Hypervisor.
> Such systems would delist scratch aperture from PMC DT node.
> 
> Accordingly, this change makes "scratch" as an optional aperture for
> Tegra234 in PMC dt-binding document.
> 
> Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
> ---
>  .../arm/tegra/nvidia,tegra186-pmc.yaml        | 83 +++++++++++++------
>  1 file changed, 58 insertions(+), 25 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml:85:12: [warning] wrong indentation: expected 12 but found 11 (indentation)

dtschema/dtc warnings/errors:

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240106075134.3933491-2-petlozup@nvidia.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


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

* Re: [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture
  2024-01-06  7:51 ` [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture Petlozu Pravareshwar
  2024-01-06  9:51   ` Rob Herring
@ 2024-01-08 16:16   ` kernel test robot
  2024-01-08 19:58   ` Rob Herring
  2 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2024-01-08 16:16 UTC (permalink / raw)
  To: Petlozu Pravareshwar, thierry.reding, jonathanh, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, p.zabel, dmitry.osipenko,
	ulf.hansson, kkartik, cai.huoqing, spatra, linux-tegra,
	linux-kernel, devicetree
  Cc: oe-kbuild-all, petlozup

Hi Petlozu,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tegra/for-next]
[also build test WARNING on robh/for-next linus/master v6.7 next-20240108]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Petlozu-Pravareshwar/dt-bindings-tegra-pmc-Update-scratch-as-an-optional-aperture/20240106-155615
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
patch link:    https://lore.kernel.org/r/20240106075134.3933491-2-petlozup%40nvidia.com
patch subject: [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240109/202401090058.4xtTta86-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401090058.4xtTta86-lkp@intel.com/

dtcheck warnings: (new ones prefixed by >>)
>> Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml:85:12: [warning] wrong indentation: expected 12 but found 11 (indentation)

vim +85 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml

     8	
     9	maintainers:
    10	  - Thierry Reding <thierry.reding@gmail.com>
    11	  - Jon Hunter <jonathanh@nvidia.com>
    12	
    13	properties:
    14	  compatible:
    15	    enum:
    16	      - nvidia,tegra186-pmc
    17	      - nvidia,tegra194-pmc
    18	      - nvidia,tegra234-pmc
    19	
    20	  reg:
    21	    minItems: 4
    22	    maxItems: 5
    23	
    24	  reg-names:
    25	    minItems: 4
    26	    maxItems: 5
    27	
    28	  interrupt-controller: true
    29	
    30	  "#interrupt-cells":
    31	    description: Specifies the number of cells needed to encode an
    32	      interrupt source. The value must be 2.
    33	    const: 2
    34	
    35	  nvidia,invert-interrupt:
    36	    description: If present, inverts the PMU interrupt signal.
    37	    $ref: /schemas/types.yaml#/definitions/flag
    38	
    39	allOf:
    40	  - if:
    41	      properties:
    42	        compatible:
    43	          contains:
    44	            const: nvidia,tegra186-pmc
    45	    then:
    46	      properties:
    47	        reg:
    48	          maxItems: 4
    49	        reg-names:
    50	          items:
    51	            - const: pmc
    52	            - const: wake
    53	            - const: aotag
    54	            - const: scratch
    55	
    56	  - if:
    57	      properties:
    58	        compatible:
    59	          contains:
    60	            const: nvidia,tegra194-pmc
    61	    then:
    62	      properties:
    63	        reg:
    64	          minItems: 5
    65	        reg-names:
    66	          items:
    67	            - const: pmc
    68	            - const: wake
    69	            - const: aotag
    70	            - const: scratch
    71	            - const: misc
    72	
    73	  - if:
    74	      properties:
    75	        compatible:
    76	          contains:
    77	            const: nvidia,tegra234-pmc
    78	    then:
    79	      properties:
    80	        reg:
    81	          minItems: 4
    82	          maxItems: 5
    83	        reg-names:
    84	          anyOf:
  > 85	           - items:
    86	               - const: pmc
    87	               - const: wake
    88	               - const: aotag
    89	               - const: misc
    90	           - items:
    91	               - const: pmc
    92	               - const: wake
    93	               - const: aotag
    94	               - const: scratch
    95	               - const: misc
    96	
    97	patternProperties:
    98	  "^[a-z0-9]+-[a-z0-9]+$":
    99	    if:
   100	      type: object
   101	    then:
   102	      description: |
   103	        These are pad configuration nodes. On Tegra SoCs a pad is a set of
   104	        pins which are configured as a group. The pin grouping is a fixed
   105	        attribute of the hardware. The PMC can be used to set pad power
   106	        state and signaling voltage. A pad can be either in active or
   107	        power down mode. The support for power state and signaling voltage
   108	        configuration varies depending on the pad in question. 3.3 V and
   109	        1.8 V signaling voltages are supported on pins where software
   110	        controllable signaling voltage switching is available.
   111	
   112	        Pad configurations are described with pin configuration nodes
   113	        which are placed under the pmc node and they are referred to by
   114	        the pinctrl client properties. For more information see
   115	
   116	          Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
   117	
   118	        The following pads are present on Tegra186:
   119	
   120	          csia, csib, dsi, mipi-bias, pex-clk-bias, pex-clk3, pex-clk2,
   121	          pex-clk1, usb0, usb1, usb2, usb-bias, uart, audio, hsic, dbg,
   122	          hdmi-dp0, hdmi-dp1, pex-cntrl, sdmmc2-hv, sdmmc4, cam, dsib,
   123	          dsic, dsid, csic, csid, csie, dsif, spi, ufs, dmic-hv, edp,
   124	          sdmmc1-hv, sdmmc3-hv, conn, audio-hv, ao-hv
   125	
   126	        The following pads are present on Tegra194:
   127	
   128	          csia, csib, mipi-bias, pex-clk-bias, pex-clk3, pex-clk2,
   129	          pex-clk1, eqos, pex-clk-2-bias, pex-clk-2, dap3, dap5, uart,
   130	          pwr-ctl, soc-gpio53, audio, gp-pwm2, gp-pwm3, soc-gpio12,
   131	          soc-gpio13, soc-gpio10, uart4, uart5, dbg, hdmi-dp3, hdmi-dp2,
   132	          hdmi-dp0, hdmi-dp1, pex-cntrl, pex-ctl2, pex-l0-rst,
   133	          pex-l1-rst, sdmmc4, pex-l5-rst, cam, csic, csid, csie, csif,
   134	          spi, ufs, csig, csih, edp, sdmmc1-hv, sdmmc3-hv, conn,
   135	          audio-hv, ao-hv
   136	
   137	      properties:
   138	        pins:
   139	          $ref: /schemas/types.yaml#/definitions/string
   140	          description: Must contain the name of the pad(s) to be
   141	            configured.
   142	
   143	        low-power-enable:
   144	          description: Configure the pad into power down mode.
   145	          $ref: /schemas/types.yaml#/definitions/flag
   146	
   147	        low-power-disable:
   148	          description: Configure the pad into active mode.
   149	          $ref: /schemas/types.yaml#/definitions/flag
   150	
   151	        power-source:
   152	          $ref: /schemas/types.yaml#/definitions/uint32
   153	          description: |
   154	            Must contain either TEGRA_IO_PAD_VOLTAGE_1V8 or
   155	            TEGRA_IO_PAD_VOLTAGE_3V3 to select between signalling
   156	            voltages.
   157	
   158	            The values are defined in
   159	
   160	              include/dt-bindings/pinctrl/pinctrl-tegra-io-pad.h
   161	
   162	            The power state can be configured on all of the above pads
   163	            except for ao-hv. Following pads have software configurable
   164	            signaling voltages: sdmmc2-hv, dmic-hv, sdmmc1-hv, sdmmc3-hv,
   165	            audio-hv, ao-hv.
   166	
   167	        phandle: true
   168	
   169	      required:
   170	        - pins
   171	
   172	      additionalProperties: false
   173	
   174	required:
   175	  - compatible
   176	  - reg
   177	  - reg-names
   178	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture
  2024-01-06  7:51 ` [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture Petlozu Pravareshwar
  2024-01-06  9:51   ` Rob Herring
  2024-01-08 16:16   ` kernel test robot
@ 2024-01-08 19:58   ` Rob Herring
  2024-01-17 15:46     ` Petlozu Pravareshwar
  2 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2024-01-08 19:58 UTC (permalink / raw)
  To: Petlozu Pravareshwar
  Cc: thierry.reding, jonathanh, krzysztof.kozlowski+dt, conor+dt,
	p.zabel, dmitry.osipenko, ulf.hansson, kkartik, cai.huoqing,
	spatra, linux-tegra, linux-kernel, devicetree

On Sat, Jan 06, 2024 at 07:51:33AM +0000, Petlozu Pravareshwar wrote:
> Scratch address space register is used to store reboot reason. For
> some Tegra234 systems, the scratch space is not available to store
> the reboot reason. This is because scratch region on these systems
> is not accessible by the kernel as restricted by the Hypervisor.
> Such systems would delist scratch aperture from PMC DT node.
> 
> Accordingly, this change makes "scratch" as an optional aperture for
> Tegra234 in PMC dt-binding document.
> 
> Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
> ---
>  .../arm/tegra/nvidia,tegra186-pmc.yaml        | 83 +++++++++++++------
>  1 file changed, 58 insertions(+), 25 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
> index 0faa403f68c8..2716610a1a02 100644
> --- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
> +++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
> @@ -23,12 +23,7 @@ properties:
>  
>    reg-names:
>      minItems: 4
> -    items:
> -      - const: pmc
> -      - const: wake
> -      - const: aotag
> -      - const: scratch
> -      - const: misc
> +    maxItems: 5

You can just make the 4th entry: enum: [ scratch, misc ]

>  
>    interrupt-controller: true
>  
> @@ -41,25 +36,63 @@ properties:
>      description: If present, inverts the PMU interrupt signal.
>      $ref: /schemas/types.yaml#/definitions/flag
>  
> -if:
> -  properties:
> -    compatible:
> -      contains:
> -        const: nvidia,tegra186-pmc
> -then:
> -  properties:
> -    reg:
> -      maxItems: 4
> -
> -    reg-names:
> -      maxItems: 4
> -else:
> -  properties:
> -    reg:
> -      minItems: 5
> -
> -    reg-names:
> -      minItems: 5
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: nvidia,tegra186-pmc
> +    then:
> +      properties:
> +        reg:
> +          maxItems: 4
> +        reg-names:
> +          items:
> +            - const: pmc
> +            - const: wake
> +            - const: aotag
> +            - const: scratch
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: nvidia,tegra194-pmc
> +    then:
> +      properties:
> +        reg:
> +          minItems: 5
> +        reg-names:
> +          items:
> +            - const: pmc
> +            - const: wake
> +            - const: aotag
> +            - const: scratch
> +            - const: misc
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: nvidia,tegra234-pmc
> +    then:
> +      properties:
> +        reg:
> +          minItems: 4
> +          maxItems: 5
> +        reg-names:
> +          anyOf:
> +           - items:
> +               - const: pmc
> +               - const: wake
> +               - const: aotag
> +               - const: misc
> +           - items:
> +               - const: pmc
> +               - const: wake
> +               - const: aotag
> +               - const: scratch
> +               - const: misc
>  
>  patternProperties:
>    "^[a-z0-9]+-[a-z0-9]+$":
> -- 
> 2.17.1
> 

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

* RE: [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture
  2024-01-06  9:51   ` Rob Herring
@ 2024-01-17 15:41     ` Petlozu Pravareshwar
  0 siblings, 0 replies; 8+ messages in thread
From: Petlozu Pravareshwar @ 2024-01-17 15:41 UTC (permalink / raw)
  To: Rob Herring
  Cc: conor+dt, cai.huoqing, devicetree, linux-kernel, ulf.hansson,
	thierry.reding, krzysztof.kozlowski+dt, p.zabel, Sandipan Patra,
	linux-tegra, Kartik Rajput, robh+dt, dmitry.osipenko,
	Jonathan Hunter

 > On Sat, 06 Jan 2024 07:51:33 +0000, Petlozu Pravareshwar wrote:
> > Scratch address space register is used to store reboot reason. For
> > some Tegra234 systems, the scratch space is not available to store the
> > reboot reason. This is because scratch region on these systems is not
> > accessible by the kernel as restricted by the Hypervisor.
> > Such systems would delist scratch aperture from PMC DT node.
> >
> > Accordingly, this change makes "scratch" as an optional aperture for
> > Tegra234 in PMC dt-binding document.
> >
> > Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
> > ---
> >  .../arm/tegra/nvidia,tegra186-pmc.yaml        | 83 +++++++++++++------
> >  1 file changed, 58 insertions(+), 25 deletions(-)
> >
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m
> dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
> yamllint warnings/errors:
> ./Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-
> pmc.yaml:85:12: [warning] wrong indentation: expected 12 but found 11
> (indentation)
> 
> dtschema/dtc warnings/errors:
> 
> doc reference errors (make refcheckdocs):
> 
> See https://patchwork.ozlabs.org/project/devicetree-
> bindings/patch/20240106075134.3933491-2-petlozup@nvidia.com
> 
> The base for the series is generally the latest rc1. A different dependency
> should be noted in *this* patch.
> 
> If you already ran 'make dt_binding_check' and didn't see the above error(s),
> then make sure 'yamllint' is installed and dt-schema is up to
> date:
> 
> pip3 install dtschema --upgrade
> 
> Please check and re-submit after running the above command yourself. Note
> that DT_SCHEMA_FILES can be set to your schema file to speed up checking
> your schema. However, it must be unset to test all examples with your
> schema.
I could reproduce the above warning after installing 'yamllint'. I will fix this warning in the next patch.
Thanks.

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

* RE: [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture
  2024-01-08 19:58   ` Rob Herring
@ 2024-01-17 15:46     ` Petlozu Pravareshwar
  0 siblings, 0 replies; 8+ messages in thread
From: Petlozu Pravareshwar @ 2024-01-17 15:46 UTC (permalink / raw)
  To: Rob Herring
  Cc: thierry.reding, Jonathan Hunter, krzysztof.kozlowski+dt,
	conor+dt, p.zabel, dmitry.osipenko, ulf.hansson, Kartik Rajput,
	cai.huoqing, Sandipan Patra, linux-tegra, linux-kernel,
	devicetree

> On Sat, Jan 06, 2024 at 07:51:33AM +0000, Petlozu Pravareshwar wrote:
> > Scratch address space register is used to store reboot reason. For
> > some Tegra234 systems, the scratch space is not available to store the
> > reboot reason. This is because scratch region on these systems is not
> > accessible by the kernel as restricted by the Hypervisor.
> > Such systems would delist scratch aperture from PMC DT node.
> >
> > Accordingly, this change makes "scratch" as an optional aperture for
> > Tegra234 in PMC dt-binding document.
> >
> > Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
> > ---
> >  .../arm/tegra/nvidia,tegra186-pmc.yaml        | 83 +++++++++++++------
> >  1 file changed, 58 insertions(+), 25 deletions(-)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-
> pmc.yaml
> > b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-
> pmc.yaml
> > index 0faa403f68c8..2716610a1a02 100644
> > ---
> > a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-
> pmc.yaml
> > +++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-
> pmc.
> > +++ yaml
> > @@ -23,12 +23,7 @@ properties:
> >
> >    reg-names:
> >      minItems: 4
> > -    items:
> > -      - const: pmc
> > -      - const: wake
> > -      - const: aotag
> > -      - const: scratch
> > -      - const: misc
> > +    maxItems: 5
> 
> You can just make the 4th entry: enum: [ scratch, misc ]

Agree. I would address this in the next patch.
Thanks.

> 
> >
> >    interrupt-controller: true
> >
> > @@ -41,25 +36,63 @@ properties:
> >      description: If present, inverts the PMU interrupt signal.
> >      $ref: /schemas/types.yaml#/definitions/flag
> >
> > -if:
> > -  properties:
> > -    compatible:
> > -      contains:
> > -        const: nvidia,tegra186-pmc
> > -then:
> > -  properties:
> > -    reg:
> > -      maxItems: 4
> > -
> > -    reg-names:
> > -      maxItems: 4
> > -else:
> > -  properties:
> > -    reg:
> > -      minItems: 5
> > -
> > -    reg-names:
> > -      minItems: 5
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: nvidia,tegra186-pmc
> > +    then:
> > +      properties:
> > +        reg:
> > +          maxItems: 4
> > +        reg-names:
> > +          items:
> > +            - const: pmc
> > +            - const: wake
> > +            - const: aotag
> > +            - const: scratch
> > +
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: nvidia,tegra194-pmc
> > +    then:
> > +      properties:
> > +        reg:
> > +          minItems: 5
> > +        reg-names:
> > +          items:
> > +            - const: pmc
> > +            - const: wake
> > +            - const: aotag
> > +            - const: scratch
> > +            - const: misc
> > +
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: nvidia,tegra234-pmc
> > +    then:
> > +      properties:
> > +        reg:
> > +          minItems: 4
> > +          maxItems: 5
> > +        reg-names:
> > +          anyOf:
> > +           - items:
> > +               - const: pmc
> > +               - const: wake
> > +               - const: aotag
> > +               - const: misc
> > +           - items:
> > +               - const: pmc
> > +               - const: wake
> > +               - const: aotag
> > +               - const: scratch
> > +               - const: misc
> >
> >  patternProperties:
> >    "^[a-z0-9]+-[a-z0-9]+$":
> > --
> > 2.17.1
> >

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

end of thread, other threads:[~2024-01-17 15:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-06  7:51 [PATCH 1/3] soc/tegra: pmc: Update address mapping sequence for PMC apertures Petlozu Pravareshwar
2024-01-06  7:51 ` [PATCH 2/3] dt-bindings: tegra: pmc: Update scratch as an optional aperture Petlozu Pravareshwar
2024-01-06  9:51   ` Rob Herring
2024-01-17 15:41     ` Petlozu Pravareshwar
2024-01-08 16:16   ` kernel test robot
2024-01-08 19:58   ` Rob Herring
2024-01-17 15:46     ` Petlozu Pravareshwar
2024-01-06  7:51 ` [PATCH 3/3] soc/tegra: " Petlozu Pravareshwar

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).