Re: [PATCH 3/4] dt-bindings: memory: Add jedec,lpddr4 and jedec,lpddr5 bindings

From: Krzysztof Kozlowski
Date: Wed Aug 31 2022 - 02:29:06 EST


On 31/08/2022 04:33, Julius Werner wrote:
> This patch adds bindings for LPDDR4 and LPDDR5 memory analogous to the
> existing bindings for LPDDR2 and LPDDR3. For now, the new types are only
> needed for topology description, so other properties like timing
> parameters are omitted. They can be added later if needed.
>
> Signed-off-by: Julius Werner <jwerner@xxxxxxxxxxxx>
> ---
> .../ddr/jedec,lpddr-props.yaml | 4 ++
> .../memory-controllers/ddr/jedec,lpddr4.yaml | 36 ++++++++++++++
> .../memory-controllers/ddr/jedec,lpddr5.yaml | 48 +++++++++++++++++++
> 3 files changed, 88 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr4.yaml
> create mode 100644 Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr5.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
> index 0c7d2feafd77c8..e1182e75ca1a3f 100644
> --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml
> +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml
> @@ -53,9 +53,13 @@ properties:
> - 512
> - 1024
> - 2048
> + - 3072
> - 4096
> + - 6144
> - 8192
> + - 12288
> - 16384
> + - 24576
> - 32768

Either you limit now LPDDR2 and LPDDR3 to old values or instead add this
bigger list to LPDDR4 and LPDDR5 (if it works that way).

>
> io-width:
> diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr4.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr4.yaml
> new file mode 100644
> index 00000000000000..860300cebee754
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr4.yaml
> @@ -0,0 +1,36 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,lpddr4.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LPDDR4 SDRAM compliant to JEDEC JESD209-4
> +
> +allOf:
> + - $ref: "jedec,lpddr-props.yaml#"

allOf goes below maintainers.

> +
> +maintainers:
> + - Krzysztof Kozlowski <krzk@xxxxxxxxxx>
> +
> +properties:
> + compatible:
> + items:
> + - pattern: "^lpddr4-[0-9a-f]{2},[0-9a-f]{4}$"
> + - const: jedec,lpddr4
> +
> +required:
> + - compatible
> + - density
> + - io-width
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + lpddr4 {

Let's just call it "lpddr" to be generic.

> + compatible = "lpddr4-ff,0100", "jedec,lpddr4";
> + density = <8192>;
> + io-width = <16>;
> + manufacturer-id = <255>;
> + revision-id = <1 0>;
> + };
> diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr5.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr5.yaml
> new file mode 100644
> index 00000000000000..ae3894bb346d5e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr5.yaml
> @@ -0,0 +1,48 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,lpddr5.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LPDDR5 SDRAM compliant to JEDEC JESD209-5
> +
> +allOf:
> + - $ref: "jedec,lpddr-props.yaml#"
> +
> +maintainers:
> + - Krzysztof Kozlowski <krzk@xxxxxxxxxx>
> +
> +properties:
> + compatible:
> + items:
> + - pattern: "^lpddr5-[0-9a-f]{2},[0-9a-f]{4}$"
> + - const: jedec,lpddr5
> +
> + serial-id:
> + $ref: /schemas/types.yaml#/definitions/uint32-array
> + description:
> + Serial IDs read from Mode Registers 47 through 54. One byte per uint32
> + cell (i.e. <MR47 MR48 MR49 MR50 MR51 MR52 MR53 MR54>).
> + minItems: 8

No need for minItems.

> + maxItems: 8
> + items:
> + minimum: 0
> + maximum: 255
> +
> +required:
> + - compatible
> + - density
> + - io-width
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + lpddr4 {

Let's just call it "lpddr" to be generic (it's lpddr5 anyway).

> + compatible = "lpddr5-01,0200", "jedec,lpddr5";
> + density = <8192>;
> + io-width = <8>;
> + manufacturer-id = <1>;
> + revision-id = <2 0>;
> + serial-id = <3 1 0 0 0 0 0 0>;
> + };


Best regards,
Krzysztof