Skip to content

Commit 5b303a0

Browse files
committed
Merge tag 'memory-controller-drv-6.20' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers
Memory controller drivers for v6.20 1. Mediatek SMI: Fix old struct device reference leaks during error paths and device unbinding. 2. Memory Devicetree bindings: refactor existing LPDDR bindings and add bindings for DDR4 SDRAM. These will be used for example in stm32mp257f-ev1 DTS. * tag 'memory-controller-drv-6.20' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: dt-bindings: memory: SDRAM channel: standardise node name dt-bindings: memory: add DDR4 channel compatible dt-bindings: memory: factorise LPDDR channel binding into SDRAM channel dt-bindings: memory: introduce DDR4 dt-bindings: memory: factorise LPDDR props into SDRAM props memory: mtk-smi: clean up device link creation memory: mtk-smi: fix device leak on larb probe memory: mtk-smi: fix device leaks on common probe Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 8536b26 + 9805f2c commit 5b303a0

9 files changed

Lines changed: 181 additions & 107 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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,ddr4.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: DDR4 SDRAM compliant to JEDEC JESD79-4D
8+
9+
maintainers:
10+
- Krzysztof Kozlowski <krzk@kernel.org>
11+
12+
allOf:
13+
- $ref: jedec,sdram-props.yaml#
14+
15+
properties:
16+
compatible:
17+
items:
18+
- pattern: "^ddr4-[0-9a-f]{4},[a-z]{1,20}-[0-9a-f]{2}$"
19+
- const: jedec,ddr4
20+
21+
required:
22+
- compatible
23+
- density
24+
- io-width
25+
26+
unevaluatedProperties: false
27+
28+
examples:
29+
- |
30+
ddr {
31+
compatible = "ddr4-00ff,azaz-ff", "jedec,ddr4";
32+
density = <8192>;
33+
io-width = <8>;
34+
};

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:

Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-channel.yaml renamed to Documentation/devicetree/bindings/memory-controllers/ddr/jedec,sdram-channel.yaml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
22
%YAML 1.2
33
---
4-
$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,lpddr-channel.yaml#
4+
$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,sdram-channel.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

7-
title: LPDDR channel with chip/rank topology description
7+
title: SDRAM channel with chip/rank topology description
88

99
description:
10-
An LPDDR channel is a completely independent set of LPDDR pins (DQ, CA, CS,
11-
CK, etc.) that connect one or more LPDDR chips to a host system. The main
12-
purpose of this node is to overall LPDDR topology of the system, including the
13-
amount of individual LPDDR chips and the ranks per chip.
10+
A memory channel of SDRAM memory like DDR SDRAM or LPDDR SDRAM is a completely
11+
independent set of pins (DQ, CA, CS, CK, etc.) that connect one or more memory
12+
chips to a host system. The main purpose of this node is to overall memory
13+
topology of the system, including the amount of individual memory chips and
14+
the ranks per chip.
1415

1516
maintainers:
1617
- Julius Werner <jwerner@chromium.org>
1718

1819
properties:
20+
$nodename:
21+
pattern: "sdram-channel-[0-9]+$"
22+
1923
compatible:
2024
enum:
25+
- jedec,ddr4-channel
2126
- jedec,lpddr2-channel
2227
- jedec,lpddr3-channel
2328
- jedec,lpddr4-channel
@@ -26,14 +31,14 @@ properties:
2631
io-width:
2732
description:
2833
The number of DQ pins in the channel. If this number is different
29-
from (a multiple of) the io-width of the LPDDR chip, that means that
34+
from (a multiple of) the io-width of the SDRAM chip, that means that
3035
multiple instances of that type of chip are wired in parallel on this
3136
channel (with the channel's DQ pins split up between the different
3237
chips, and the CA, CS, etc. pins of the different chips all shorted
3338
together). This means that the total physical memory controlled by a
3439
channel is equal to the sum of the densities of each rank on the
35-
connected LPDDR chip, times the io-width of the channel divided by
36-
the io-width of the LPDDR chip.
40+
connected SDRAM chip, times the io-width of the channel divided by
41+
the io-width of the SDRAM chip.
3742
enum:
3843
- 8
3944
- 16
@@ -51,15 +56,24 @@ patternProperties:
5156
"^rank@[0-9]+$":
5257
type: object
5358
description:
54-
Each physical LPDDR chip may have one or more ranks. Ranks are
55-
internal but fully independent sub-units of the chip. Each LPDDR bus
59+
Each physical SDRAM chip may have one or more ranks. Ranks are
60+
internal but fully independent sub-units of the chip. Each SDRAM bus
5661
transaction on the channel targets exactly one rank, based on the
5762
state of the CS pins. Different ranks may have different densities and
5863
timing requirements.
5964
required:
6065
- reg
6166

6267
allOf:
68+
- if:
69+
properties:
70+
compatible:
71+
contains:
72+
const: jedec,ddr4-channel
73+
then:
74+
patternProperties:
75+
"^rank@[0-9]+$":
76+
$ref: /schemas/memory-controllers/ddr/jedec,ddr4.yaml#
6377
- if:
6478
properties:
6579
compatible:
@@ -107,7 +121,7 @@ additionalProperties: false
107121

108122
examples:
109123
- |
110-
lpddr-channel0 {
124+
sdram-channel-0 {
111125
#address-cells = <1>;
112126
#size-cells = <0>;
113127
compatible = "jedec,lpddr3-channel";
@@ -122,7 +136,7 @@ examples:
122136
};
123137
};
124138
125-
lpddr-channel1 {
139+
sdram-channel-1 {
126140
#address-cells = <1>;
127141
#size-cells = <0>;
128142
compatible = "jedec,lpddr4-channel";
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)