devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julius Werner <jwerner@chromium.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Dmitry Osipenko <digetx@gmail.com>,
	Doug Anderson <dianders@chromium.org>,
	Jian-Jia Su <jjsu@google.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Julius Werner <jwerner@chromium.org>
Subject: [PATCH 1/4] dt-bindings: memory: Factor out common properties of LPDDR bindings
Date: Tue, 30 Aug 2022 18:33:56 -0700	[thread overview]
Message-ID: <20220831013359.1807905-2-jwerner@chromium.org> (raw)
In-Reply-To: <20220831013359.1807905-1-jwerner@chromium.org>

The bindings for different LPDDR versions mostly use the same kinds of
properties, so in order to reduce duplication when we're adding support
for more versions, this patch creates a new lpddr-props subschema that
can be referenced by the others to define these common parts. (This will
consider a few smaller I/O width and density numbers "legal" for LPDDR3
that are usually not used there, but this should be harmless.)

This also un-deprecates the manufacturer ID property for LPDDR3 (and
introduces it to LPDDR2), since it was found that having this
information available in a separate property can be useful in some
cases.

Signed-off-by: Julius Werner <jwerner@chromium.org>
---
 .../ddr/jedec,lpddr-props.yaml                | 60 +++++++++++++++++++
 .../memory-controllers/ddr/jedec,lpddr2.yaml  | 40 ++-----------
 .../memory-controllers/ddr/jedec,lpddr3.yaml  | 39 ++----------
 3 files changed, 68 insertions(+), 71 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml

diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml
new file mode 100644
index 00000000000000..8b31c60ea2435b
--- /dev/null
+++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,lpddr-props.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common properties for LPDDR types
+
+description:
+  Different LPDDR types generally use the same properties and only differ in the
+  range of legal values for each. This file defines the common parts that can be
+  reused for each type.
+
+maintainers:
+  - Krzysztof Kozlowski <krzk@kernel.org>
+
+properties:
+  manufacturer-id:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Manufacturer ID read from Mode Register 5.
+    minimum: 0
+    maximum: 255
+
+  revision-id:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description:
+      Revision IDs read from Mode Register 6 and 7. One byte per uint32 cell (i.e. <MR6 MR7>).
+    minItems: 2
+    maxItems: 2
+    items:
+      minimum: 0
+      maximum: 255
+
+  density:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Density in megabits of SDRAM chip. Decoded from Mode Register 8.
+    enum:
+      - 64
+      - 128
+      - 256
+      - 512
+      - 1024
+      - 2048
+      - 4096
+      - 8192
+      - 16384
+      - 32768
+
+  io-width:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      IO bus width in bits of SDRAM chip. Decoded from Mode Register 8.
+    enum:
+      - 32
+      - 16
+      - 8
+
+additionalProperties: true
diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml
index 9d78f140609b6c..63c47235cb9896 100644
--- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml
+++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml
@@ -6,6 +6,9 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: LPDDR2 SDRAM compliant to JEDEC JESD209-2
 
+allOf:
+  - $ref: "jedec,lpddr-props.yaml#"
+
 maintainers:
   - Krzysztof Kozlowski <krzk@kernel.org>
 
@@ -41,41 +44,6 @@ properties:
       Property is deprecated, use revision-id instead.
     deprecated: true
 
-  revision-id:
-    $ref: /schemas/types.yaml#/definitions/uint32-array
-    description: |
-      Revision IDs read from Mode Register 6 and 7. One byte per uint32 cell (i.e. <MR6 MR7>).
-    minItems: 2
-    maxItems: 2
-    items:
-      minimum: 0
-      maximum: 255
-
-  density:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description: |
-      Density in megabits of SDRAM chip. Obtained from device datasheet.
-    enum:
-      - 64
-      - 128
-      - 256
-      - 512
-      - 1024
-      - 2048
-      - 4096
-      - 8192
-      - 16384
-      - 32768
-
-  io-width:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description: |
-      IO bus width in bits of SDRAM chip. Obtained from device datasheet.
-    enum:
-      - 32
-      - 16
-      - 8
-
   tRRD-min-tck:
     $ref: /schemas/types.yaml#/definitions/uint32
     maximum: 16
@@ -168,7 +136,7 @@ required:
   - density
   - io-width
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml
index 48908a19473c3f..5969166cdc9e0f 100644
--- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml
+++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml
@@ -6,6 +6,9 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: LPDDR3 SDRAM compliant to JEDEC JESD209-3
 
+allOf:
+  - $ref: "jedec,lpddr-props.yaml#"
+
 maintainers:
   - Krzysztof Kozlowski <krzk@kernel.org>
 
@@ -20,40 +23,6 @@ properties:
     const: 1
     deprecated: true
 
-  density:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description: |
-      Density in megabits of SDRAM chip.
-    enum:
-      - 4096
-      - 8192
-      - 16384
-      - 32768
-
-  io-width:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description: |
-      IO bus width in bits of SDRAM chip.
-    enum:
-      - 32
-      - 16
-
-  manufacturer-id:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description: |
-      Manufacturer ID value read from Mode Register 5.  The property is
-      deprecated, manufacturer should be derived from the compatible.
-    deprecated: true
-
-  revision-id:
-    $ref: /schemas/types.yaml#/definitions/uint32-array
-    minItems: 2
-    maxItems: 2
-    items:
-      maximum: 255
-    description: |
-      Revision value of SDRAM chip read from Mode Registers 6 and 7.
-
   '#size-cells':
     const: 0
     deprecated: true
@@ -206,7 +175,7 @@ required:
   - density
   - io-width
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
-- 
2.31.0


  reply	other threads:[~2022-08-31  1:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31  1:33 [PATCH 0/4] dt-bindings: memory: Describing LPDDR topology Julius Werner
2022-08-31  1:33 ` Julius Werner [this message]
2022-08-31  6:18   ` [PATCH 1/4] dt-bindings: memory: Factor out common properties of LPDDR bindings Krzysztof Kozlowski
2022-09-01  1:09     ` Julius Werner
2022-09-05 12:32       ` Krzysztof Kozlowski
2022-08-31  6:30   ` Krzysztof Kozlowski
2022-08-31  1:33 ` [PATCH 2/4] dt-bindings: memory: Add numeric LPDDR compatible string variant Julius Werner
2022-08-31  6:23   ` Krzysztof Kozlowski
2022-08-31  1:33 ` [PATCH 3/4] dt-bindings: memory: Add jedec,lpddr4 and jedec,lpddr5 bindings Julius Werner
2022-08-31  6:28   ` Krzysztof Kozlowski
2022-09-01  1:10     ` Julius Werner
2022-09-02 20:24       ` Rob Herring
2022-08-31  1:33 ` [PATCH 4/4] dt-bindings: memory: Add jedec,lpddrX-channel binding Julius Werner
2022-08-31  6:55   ` Krzysztof Kozlowski
2022-09-01  1:11     ` Julius Werner
2022-09-08 13:56       ` Krzysztof Kozlowski
2022-09-09 23:36         ` Julius Werner
2022-08-31  6:34 ` [PATCH 0/4] dt-bindings: memory: Describing LPDDR topology Krzysztof Kozlowski
2022-09-01  1:05   ` Julius Werner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220831013359.1807905-2-jwerner@chromium.org \
    --to=jwerner@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=digetx@gmail.com \
    --cc=jjsu@google.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).