Skip to content

Commit dffaa1b

Browse files
clegoffickrzk
authored andcommitted
dt-bindings: memory: factorise LPDDR props into SDRAM props
LPDDR and DDR bindings are SDRAM types and are likely to share the same properties (at least for density, io-width and reg). To avoid bindings duplication, factorise the properties. The compatible description has been updated because the MR (Mode registers) used to get manufacturer ID and revision ID are not present in case of DDR. Those information should be in a SPD (Serial Presence Detect) EEPROM in case of DIMM module or are known in case of soldered memory chips as they are in the datasheet of the memory chips. Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Clément Le Goffic <legoffic.clement@gmail.com> Link: https://patch.msgid.link/20251118-b4-ddr-bindings-v9-1-a033ac5144da@gmail.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
1 parent 78da702 commit dffaa1b

6 files changed

Lines changed: 98 additions & 78 deletions

File tree

Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml

Lines changed: 0 additions & 74 deletions
This file was deleted.

Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ maintainers:
1010
- Krzysztof Kozlowski <krzk@kernel.org>
1111

1212
allOf:
13-
- $ref: jedec,lpddr-props.yaml#
13+
- $ref: jedec,sdram-props.yaml#
1414

1515
properties:
1616
compatible:

Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ maintainers:
1010
- Krzysztof Kozlowski <krzk@kernel.org>
1111

1212
allOf:
13-
- $ref: jedec,lpddr-props.yaml#
13+
- $ref: jedec,sdram-props.yaml#
1414

1515
properties:
1616
compatible:

Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr4.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ maintainers:
1010
- Krzysztof Kozlowski <krzk@kernel.org>
1111

1212
allOf:
13-
- $ref: jedec,lpddr-props.yaml#
13+
- $ref: jedec,sdram-props.yaml#
1414

1515
properties:
1616
compatible:

Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr5.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ maintainers:
1010
- Krzysztof Kozlowski <krzk@kernel.org>
1111

1212
allOf:
13-
- $ref: jedec,lpddr-props.yaml#
13+
- $ref: jedec,sdram-props.yaml#
1414

1515
properties:
1616
compatible:
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,sdram-props.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Common properties for SDRAM types
8+
9+
description:
10+
Different SDRAM types generally use the same properties and only differ in the
11+
range of legal values for each. This file defines the common parts that can be
12+
reused for each type. Nodes using this schema should generally be nested under
13+
a SDRAM channel node.
14+
15+
maintainers:
16+
- Krzysztof Kozlowski <krzk@kernel.org>
17+
18+
properties:
19+
compatible:
20+
description: |
21+
Compatible strings can be either explicit vendor names and part numbers
22+
(e.g. elpida,ECB240ABACN), or generated strings of the form
23+
lpddrX-YY,ZZZZ or ddrX-YYYY,AAAA...-ZZ where X, Y, and Z are lowercase
24+
hexadecimal with leading zeroes, and A is lowercase ASCII.
25+
For LPDDR and DDR SDRAM, X is the SDRAM version (2, 3, 4, etc.).
26+
For LPDDR SDRAM:
27+
- YY is the manufacturer ID (from MR5), 1 byte
28+
- ZZZZ is the revision ID (from MR6 and MR7), 2 bytes
29+
For DDR4 SDRAM with SPD, according to JEDEC SPD4.1.2.L-6:
30+
- YYYY is the manufacturer ID, 2 bytes, from bytes 320 and 321
31+
- AAAA... is the part number, 20 bytes (20 chars) from bytes 329 to 348
32+
without trailing spaces
33+
- ZZ is the revision ID, 1 byte, from byte 349
34+
The former form is useful when the SDRAM vendor and part number are
35+
known, for example, when memory is soldered on the board. The latter
36+
form is useful when SDRAM nodes are created at runtime by boot firmware
37+
that doesn't have access to static part number information.
38+
39+
reg:
40+
description:
41+
The rank number of this memory rank when used as a subnode to an memory
42+
channel.
43+
minimum: 0
44+
maximum: 3
45+
46+
revision-id:
47+
$ref: /schemas/types.yaml#/definitions/uint32-array
48+
description: |
49+
SDRAM revision ID:
50+
- LPDDR SDRAM, decoded from Mode Registers 6 and 7, always 2 bytes.
51+
- DDR4 SDRAM, decoded from the SPD from byte 349 according to
52+
JEDEC SPD4.1.2.L-6, always 1 byte.
53+
One byte per uint32 cell (e.g., <MR6 MR7>).
54+
maxItems: 2
55+
items:
56+
minimum: 0
57+
maximum: 255
58+
59+
density:
60+
$ref: /schemas/types.yaml#/definitions/uint32
61+
description: |
62+
Density of the SDRAM chip in megabits:
63+
- LPDDR SDRAM, decoded from Mode Register 8.
64+
- DDR4 SDRAM, decoded from the SPD from bits 3-0 of byte 4 according to
65+
JEDEC SPD4.1.2.L-6.
66+
enum:
67+
- 64
68+
- 128
69+
- 256
70+
- 512
71+
- 1024
72+
- 2048
73+
- 3072
74+
- 4096
75+
- 6144
76+
- 8192
77+
- 12288
78+
- 16384
79+
- 24576
80+
- 32768
81+
82+
io-width:
83+
$ref: /schemas/types.yaml#/definitions/uint32
84+
description: |
85+
I/O bus width in bits of the SDRAM chip:
86+
- LPDDR SDRAM, decoded from Mode Register 8.
87+
- DDR4 SDRAM, decoded from the SPD from bits 2-0 of byte 12 according to
88+
JEDEC SPD4.1.2.L-6.
89+
enum:
90+
- 8
91+
- 16
92+
- 32
93+
94+
additionalProperties: true

0 commit comments

Comments
 (0)