From nobody Fri Oct 3 00:53:40 2025 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BC0424DD0E; Tue, 9 Sep 2025 10:12:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757412751; cv=none; b=kZT2pTcXKQI/olReJXh3AS0K46kfVr9oNiP1L5lQU6iCaEXeIfYMIBvUll0KrxYRrnPCbVWoqca4N/zIuZ8neEIkExWQBgOs8n89dsOEBA8pOym5iiYEm5NNCqVP4LGmXuOGNooxQPYHZ9+P6rMaWK5q69buqD/T99t4ntFq2Dc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757412751; c=relaxed/simple; bh=h7CfD3CDSrZh73S0wyu/7Wpx6iuihvxQsf416mA0tUY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D/AJ3g8enxJAuhv6TX4DCzEfnpfpdJ+IPkLoG7Up/1ZKEr3qZorNj27da3QQTbfdOrcP5Xd5sKDNhE4FkTEklRczgW3e3mB1G1OKD47BNUwkiC6MVdft9/oWf4fHtgfV7sWW2WOwFuHRlBvBp6jnJnLSbhPXSHFl6oOrxyHNpmk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hRZB0UQx; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hRZB0UQx" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-45df09c7128so3888695e9.1; Tue, 09 Sep 2025 03:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757412748; x=1758017548; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=9rzBUT9ICHWzlwIHMQcs4/tydI/swcsStccU+8K0CR8=; b=hRZB0UQxnzgxv/SGMJqLssG1lvhXK49SqkFjmF8Euzwgm51VI6VPqIWzwxveZT0d4d DTnbLAZOlwNyI8jJEKOxoactEjeJ6g5Wy2wCJ3GJiBwgiIt7WYmy8RYqG/YblfJk9gnt E/fmU3lafsBvGzpxnFD2c0+Z/47xSzZhfmLXoclNm4VLJi8VEzbsCyfTFR4TCtSb/kSX WSYXovzCNp6SzcFfA8aVhG+c2b5vfmPIe47BGPreZMTl0we6DAr1p1Hh+Do86o04NoM4 BOP1QYV6P/2uWki9huz3xPuT7hMqQ6j0Ezvuvmk/UX1UHCejDvwLU+OgFWo21fXXJXtd dc5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757412748; x=1758017548; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9rzBUT9ICHWzlwIHMQcs4/tydI/swcsStccU+8K0CR8=; b=BhKEeQwfbi5FPjo4PoUcwgdGVz3FeANNfXVwao+HQoYtRPf4N11Af5sNFN96/6b12k EAm3gnqiFexDq+xlJdztmkYY3Ww4JUi8fZ+PKeLMWIes7zLcyQViBv3cPmni7l+Y9eX7 jdnhh4WBi/XjJudLlCOuOeusJmev0udRK2w3aCbEcOgTh4FspWmC1IO0LyvFivjUYGBq xKwXwukF36CeqRW/LttD+2P4u9pE3TlPeL/i3CR1zWGulZDDfeLMkDKGSLmZ/fzUaa0J 9n5TPQ5MW99nUDoJv19XRBQxMhChGDPOiNlq9a6sqDbYmACTWzrz9JdUCcKAjTOQDmWz vZrQ== X-Forwarded-Encrypted: i=1; AJvYcCUGakGdh24L8NnIrt2Cddqm0pQZCysXX3TfX6kETzepQnpG+ZheXHFK5fLAhWM9MAyuoSUTTaVudwvw@vger.kernel.org, AJvYcCULzcIYXz77F0oFi+FPLpR8I6Jccdyq2OdgGoWd/sat58FFgP/ggo20lWtiCcDtPlNd6s9gaALWJbci6wyB@vger.kernel.org, AJvYcCWPYCfkihxBQf8Iog+VHwh13u0Cckx951I238esNl71SiZpEa5avFOpiihZ9EG3obG6sGe7ftH/LOwjEOeX1U2RrA==@vger.kernel.org, AJvYcCXBNZA3CKOX20fqJIIwGE7WUZRvWZHyClqXkOADFX4TBr4F0YsAzLKfO0uRrj15A5Tu0uYJ6VfIvw3Q@vger.kernel.org, AJvYcCXstn44UugfnJVv5WtWNm7ZJ2dRsP7Rt3vhCn0Ub087UrhbKzFMASqvTIXyGKSvo9RhNotW0JSTbiwc@vger.kernel.org X-Gm-Message-State: AOJu0Yw776uzvItIUgv82GGsDk+bK7d9wF44IQl/GsptQb2ceWsnUY7E fohjFtBJIAI4lWqPLIWaF/oWfYALRYIEvVjqOGrWq09mM1GvdZeRvYzHk1M7F51o X-Gm-Gg: ASbGncu7vemTPFXCPBEv+P4YTn7+2Chi5JX+IoBdrTJqkbZ4SYXsJ+/6OThYvMvDwXu PRnZO6y1zshKpOCcK9UYZsB2PUCVQ9sURMiCQ2pK2E+g4omrX7ewhk6Ix55jJ7E6KofypUGcFKB Le6W43F/VXDa9iSG10H83Zfnh+Nkj4h62qRmUMaHvcZ+63qLRfk02l/nneZZd8xLuRLFGe7Nkxi fSzTEaoWiRroucZM4gciyQt7Q/2LGJPuUMJS3ax2UjTNCnhfZ1MXxVarE897kBtSLjvG3sRi7LE LGzoZ2pzJmnxyO0uhIR+mA1KW0ZHxJmSF+9324efzqRGl3OE1OzQueN3p4w40tAktFjYnOcO5Ow nVTbHysbQmkGPlvQf4nh/M1kH8vYOMkHfuyT1Muf7SCJUNR08BWs//q9AzzpQ2Hm0aFHy0jRahQ cv9zbbOQCTaoGrgAuHyxE+nerr7Q== X-Google-Smtp-Source: AGHT+IGZqx2QUgheu+yjuVonlkqq3Xh3AK915Stx+p0/dmJgrMwKfJ/6Cr1uQ4AXOA+wBy1y9wkXWg== X-Received: by 2002:a05:600c:c0c5:b0:45d:e531:99df with SMTP id 5b1f17b1804b1-45de64869d9mr49018035e9.3.1757412747273; Tue, 09 Sep 2025 03:12:27 -0700 (PDT) Received: from localhost (2a02-8440-7136-74e7-5ebf-4282-0e1a-b885.rev.sfr.net. [2a02:8440:7136:74e7:5ebf:4282:e1a:b885]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b9a6ecfafsm334758375e9.21.2025.09.09.03.12.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Sep 2025 03:12:26 -0700 (PDT) From: =?utf-8?q?Cl=C3=A9ment_Le_Goffic?= Date: Tue, 09 Sep 2025 12:12:12 +0200 Subject: [PATCH v6 05/20] dt-bindings: memory: factorise LPDDR props into SDRAM props Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250909-b4-ddrperfm-upstream-v6-5-ce082cc801b5@gmail.com> References: <20250909-b4-ddrperfm-upstream-v6-0-ce082cc801b5@gmail.com> In-Reply-To: <20250909-b4-ddrperfm-upstream-v6-0-ce082cc801b5@gmail.com> To: Gatien Chevallier , Maxime Coquelin , Alexandre Torgue , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Gabriel Fernandez , Krzysztof Kozlowski , Julius Werner , Will Deacon , Mark Rutland , Philipp Zabel , Jonathan Corbet Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-doc@vger.kernel.org, =?utf-8?q?Cl=C3=A9ment_Le_Goffic?= , =?utf-8?q?Cl=C3=A9ment_Le_Goffic?= X-Mailer: b4 0.15-dev-dfb17 From: Cl=C3=A9ment Le Goffic 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=C3=A9ment Le Goffic Signed-off-by: Cl=C3=A9ment Le Goffic --- .../memory-controllers/ddr/jedec,lpddr-props.yaml | 74 ----------------- .../memory-controllers/ddr/jedec,lpddr2.yaml | 2 +- .../memory-controllers/ddr/jedec,lpddr3.yaml | 2 +- .../memory-controllers/ddr/jedec,lpddr4.yaml | 2 +- .../memory-controllers/ddr/jedec,lpddr5.yaml | 2 +- .../memory-controllers/ddr/jedec,sdram-props.yaml | 94 ++++++++++++++++++= ++++ 6 files changed, 98 insertions(+), 78 deletions(-) diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec= ,lpddr-props.yaml b/Documentation/devicetree/bindings/memory-controllers/dd= r/jedec,lpddr-props.yaml deleted file mode 100644 index 30267ce70124..000000000000 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-= props.yaml +++ /dev/null @@ -1,74 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,lpddr-prop= s.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. Nodes using this schema should generally be nested= under - an LPDDR channel node. - -maintainers: - - Krzysztof Kozlowski - -properties: - compatible: - description: - Compatible strings can be either explicit vendor names and part numb= ers - (e.g. elpida,ECB240ABACN), or generated strings of the form - lpddrX-YY,ZZZZ where X is the LPDDR version, YY is the manufacturer = ID - (from MR5) and ZZZZ is the revision ID (from MR6 and MR7). Both IDs = are - formatted in lower case hexadecimal representation with leading zero= es. - The latter form can be useful when LPDDR nodes are created at runtim= e by - boot firmware that doesn't have access to static part number informa= tion. - - reg: - description: - The rank number of this LPDDR rank when used as a subnode to an LPDDR - channel. - minimum: 0 - maximum: 3 - - revision-id: - $ref: /schemas/types.yaml#/definitions/uint32-array - description: - Revision IDs read from Mode Register 6 and 7. One byte per uint32 ce= ll (i.e. ). - 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 - - 3072 - - 4096 - - 6144 - - 8192 - - 12288 - - 16384 - - 24576 - - 32768 - - io-width: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - IO bus width in bits of SDRAM chip. Decoded from Mode Register 8. - enum: - - 8 - - 16 - - 32 - -additionalProperties: true diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec= ,lpddr2.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jed= ec,lpddr2.yaml index a237bc259273..704bbc562528 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2= .yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2= .yaml @@ -10,7 +10,7 @@ maintainers: - Krzysztof Kozlowski =20 allOf: - - $ref: jedec,lpddr-props.yaml# + - $ref: jedec,sdram-props.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec= ,lpddr3.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jed= ec,lpddr3.yaml index e328a1195ba6..0d28df3d2bfa 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3= .yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3= .yaml @@ -10,7 +10,7 @@ maintainers: - Krzysztof Kozlowski =20 allOf: - - $ref: jedec,lpddr-props.yaml# + - $ref: jedec,sdram-props.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec= ,lpddr4.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jed= ec,lpddr4.yaml index a078892fecee..65aa07861453 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr4= .yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr4= .yaml @@ -10,7 +10,7 @@ maintainers: - Krzysztof Kozlowski =20 allOf: - - $ref: jedec,lpddr-props.yaml# + - $ref: jedec,sdram-props.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec= ,lpddr5.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jed= ec,lpddr5.yaml index e441dac5f154..cf5d5a8e94b3 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr5= .yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr5= .yaml @@ -10,7 +10,7 @@ maintainers: - Krzysztof Kozlowski =20 allOf: - - $ref: jedec,lpddr-props.yaml# + - $ref: jedec,sdram-props.yaml# =20 properties: compatible: diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec= ,sdram-props.yaml b/Documentation/devicetree/bindings/memory-controllers/dd= r/jedec,sdram-props.yaml new file mode 100644 index 000000000000..38472a3febc5 --- /dev/null +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,sdram-= props.yaml @@ -0,0 +1,94 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,sdram-prop= s.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Common properties for SDRAM types + +description: + Different SDRAM 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. Nodes using this schema should generally be nested= under + a SDRAM channel node. + +maintainers: + - Krzysztof Kozlowski + +properties: + compatible: + description: | + Compatible strings can be either explicit vendor names and part numb= ers + (e.g. elpida,ECB240ABACN), or generated strings of the form + lpddrX,YY,ZZZZ or ddrX-YYYY,AAAA...,ZZ where X, Y, and Z are in lower + case hexadecimal with leading zeroes and A is in lowercase ASCII. + For LPDDR and DDR SDRAM, X is the SDRAM version (2, 3, 4, etc.). + For LPDDR SDRAM: + - YY is the manufacturer ID (from MR5), 1 byte + - ZZZZ is the revision ID (from MR6 and MR7), 2 bytes + For DDR4 SDRAM with SPD, according to JEDEC SPD4.1.2.L-6 : + - YYYY is the manufacturer ID, 2 bytes, from bytes 320 and 321 + - AAAA... is the part number, 20 bytes (10 chars) from bytes 329 t= o 348 + without trailing spaces. + - ZZ is the revision ID, 1 byte, from byte 349 + The former form is useful when the SDRAM vendor and part number are + known, such as when the SDRAM is soldered on the board. + The latter form can be useful when SDRAM nodes are created at runtim= e by + boot firmware that doesn't have access to statis part number informa= tion. + + reg: + description: + The rank number of this memory rank when used as a subnode to an mem= ory + channel. + minimum: 0 + maximum: 3 + + revision-id: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: | + SDRAM revision ID: + - LPDDR SDRAM, decoded from Mode Register 6 and 7, always 2 bytes. + - DDR4 SDRAM, decoded from the SPD from byte 349 according to + JEDEC SPD4.1.2.L-6, always 1 byte. + One byte per uint32 cell (i.e. ). + maxItems: 2 + items: + minimum: 0 + maximum: 255 + + density: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Density of SDRAM chip in megabits: + - LPDDR SDRAM, decoded from Mode Register 8. + - DDR4 SDRAM, decoded from the SPD from bits 3~0 of byte 4 accordi= ng to + JEDEC SPD4.1.2.L-6. + enum: + - 64 + - 128 + - 256 + - 512 + - 1024 + - 2048 + - 3072 + - 4096 + - 6144 + - 8192 + - 12288 + - 16384 + - 24576 + - 32768 + + io-width: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + IO bus width in bits of SDRAM chip: + - LPDDR SDRAM, decoded from Mode Register 8. + - DDR4 SDRAM, decoded from the SPD from bits 2~0 of byte 12 accord= ing to + JEDEC SPD4.1.2.L-6. + enum: + - 8 + - 16 + - 32 + +additionalProperties: true --=20 2.43.0