[PATCH v7 2/7] dt-bindings: memory: introduce DDR4

Clément Le Goffic posted 7 patches 1 week, 2 days ago
There is a newer version of this series
[PATCH v7 2/7] dt-bindings: memory: introduce DDR4
Posted by Clément Le Goffic 1 week, 2 days ago
From: Clément Le Goffic <clement.legoffic@foss.st.com>

Introduce JEDEC compliant DDR bindings, that use new memory-props binding.

Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Signed-off-by: Clément Le Goffic <legoffic.clement@gmail.com>
---
 .../memory-controllers/ddr/jedec,ddr4.yaml         | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,ddr4.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,ddr4.yaml
new file mode 100644
index 000000000000..bf1dae15b65b
--- /dev/null
+++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,ddr4.yaml
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,ddr4.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: DDR4 SDRAM compliant to JEDEC JESD79-4D
+
+maintainers:
+  - Krzysztof Kozlowski <krzk@kernel.org>
+
+allOf:
+  - $ref: jedec,sdram-props.yaml#
+
+properties:
+  compatible:
+    items:
+      - pattern: "^ddr4-[0-9a-f]{4},[a-z]{1,10},[0-9a-f]{2}$"
+      - const: jedec,ddr4
+
+required:
+  - compatible
+  - density
+  - io-width
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    ddr {
+        compatible = "ddr4-00ff,azaz,ff", "jedec,ddr4";
+        density = <8192>;
+        io-width = <8>;
+    };

-- 
2.43.0

Re: [PATCH v7 2/7] dt-bindings: memory: introduce DDR4
Posted by Julius Werner 1 week, 2 days ago
> +      - pattern: "^ddr4-[0-9a-f]{4},[a-z]{1,10},[0-9a-f]{2}$"

I don't really understand why there can only be up to 10 characters in
the module part number. I also don't understand why you wrote "20
bytes (10 chars)" for this in the previous patch. Are you assuming
that module part numbers are UTF16LE? According to my reading of the
spec, it sounds like they're supposed to be plain ASCII, i.e. 20 bytes
should be able to contain up to 20 chars.
Re: [PATCH v7 2/7] dt-bindings: memory: introduce DDR4
Posted by Clément Le Goffic 1 week ago
On 23/09/2025 00:51, Julius Werner wrote:
>> +      - pattern: "^ddr4-[0-9a-f]{4},[a-z]{1,10},[0-9a-f]{2}$"
> 
> I don't really understand why there can only be up to 10 characters in
> the module part number. I also don't understand why you wrote "20
> bytes (10 chars)" for this in the previous patch. Are you assuming
> that module part numbers are UTF16LE? According to my reading of the
> spec, it sounds like they're supposed to be plain ASCII, i.e. 20 bytes
> should be able to contain up to 20 chars.

Hi Julius,

Yes plain ASCII needs 8 bits for each char as the value range is 0-127
I was having hexadecimal in mind while writing this, I'm sorry.
I'll fix it here and in the previous patch.

Best regards,
Clément