From patchwork Wed Aug 31 01:33:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julius Werner X-Patchwork-Id: 1672105 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=JFl8XnRb; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MHRY02gMGz1ynh for ; Wed, 31 Aug 2022 11:34:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230479AbiHaBeK (ORCPT ); Tue, 30 Aug 2022 21:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230372AbiHaBeJ (ORCPT ); Tue, 30 Aug 2022 21:34:09 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B342EAFAE5 for ; Tue, 30 Aug 2022 18:34:07 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id m10-20020a17090a730a00b001fa986fd8eeso19691425pjk.0 for ; Tue, 30 Aug 2022 18:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=CHQeXnfRhV+Rl/DeGa69lUaZqdL0Qy5Wbepw7R/N8is=; b=JFl8XnRbLljUJynLreUl04vCtzctmfXmKsx6wlwtcEd5cdNQF8pPpjd0d8t8c3UYNc 6bJzNv6YeHMOutmI/UCsemxB8wZYi7kMiCd5zw8Ctse1yNBJk6WLCIFAWGBHLpFHLWAx QWZKzBmIpaLFVB42DEZwsyOo/dyW9goHB5QDY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=CHQeXnfRhV+Rl/DeGa69lUaZqdL0Qy5Wbepw7R/N8is=; b=HfSPAnpM1uCgkcZRGU3uuQtd6v1dI8ZrNvo1C55mfV62rIuMShsseBE1lXJBxPQ1Pb sqXmvFgFE4p5TFuaREyc9+1FD+sfERwydH5INz/dTSbqFGbBYZrc7A60LR8z8TjlQOZ+ Jh4xW2qMfc0+Ou3wQZkI2QNXvBv8FVSL81W2XloSyjV6yfeGwJoEBmuBXQU8LCaPuPSe /m3nU4Yd4X38z2JOvPfJyb9OI45Whq1y/a04tb1ffiK1Ju1O4hvRLNarv7I6lMs3IK5i Tk8gYbrqBr8Ofa86ZhUXEkDTbdn1MomsbfkHpnlJ2vtwNqmOrHMws+jMGgsoEXUzPa1s 8B6Q== X-Gm-Message-State: ACgBeo0+41upOdhZlmSnUyOMYE+KP9RPqj3gmBx7Vo4q9Xx/r3h3NiN7 Rg23ZOFl7Mja+ThKcnQw0fk+cRLN4WoQ1g== X-Google-Smtp-Source: AA6agR5taYArk1YOKro99OTHpX33r4AG9UeMtVVV+fib3gIKgXtUyF6plgJVOC6YsJ2fc3Ydlt3aAQ== X-Received: by 2002:a17:902:cec1:b0:172:e677:553b with SMTP id d1-20020a170902cec100b00172e677553bmr23672198plg.99.1661909647189; Tue, 30 Aug 2022 18:34:07 -0700 (PDT) Received: from jwerner-p920.mtv.corp.google.com ([2620:15c:202:201:2e75:b9a4:fb1:b1b8]) by smtp.gmail.com with ESMTPSA id t10-20020a170902e84a00b00174f4316c24sm4261382plg.245.2022.08.30.18.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 18:34:06 -0700 (PDT) From: Julius Werner To: Krzysztof Kozlowski Cc: Rob Herring , Dmitry Osipenko , Doug Anderson , Jian-Jia Su , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Julius Werner Subject: [PATCH 1/4] dt-bindings: memory: Factor out common properties of LPDDR bindings Date: Tue, 30 Aug 2022 18:33:56 -0700 Message-Id: <20220831013359.1807905-2-jwerner@chromium.org> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220831013359.1807905-1-jwerner@chromium.org> References: <20220831013359.1807905-1-jwerner@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The bindings for different LPDDR versions mostly use the same kinds of properties, so in order to reduce duplication when we're adding support for more versions, this patch creates a new lpddr-props subschema that can be referenced by the others to define these common parts. (This will consider a few smaller I/O width and density numbers "legal" for LPDDR3 that are usually not used there, but this should be harmless.) This also un-deprecates the manufacturer ID property for LPDDR3 (and introduces it to LPDDR2), since it was found that having this information available in a separate property can be useful in some cases. Signed-off-by: Julius Werner --- .../ddr/jedec,lpddr-props.yaml | 60 +++++++++++++++++++ .../memory-controllers/ddr/jedec,lpddr2.yaml | 40 ++----------- .../memory-controllers/ddr/jedec,lpddr3.yaml | 39 ++---------- 3 files changed, 68 insertions(+), 71 deletions(-) create mode 100644 Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.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 new file mode 100644 index 00000000000000..8b31c60ea2435b --- /dev/null +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,lpddr-props.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. + +maintainers: + - Krzysztof Kozlowski + +properties: + manufacturer-id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Manufacturer ID read from Mode Register 5. + minimum: 0 + maximum: 255 + + revision-id: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + Revision IDs read from Mode Register 6 and 7. One byte per uint32 cell (i.e. ). + minItems: 2 + 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 + - 4096 + - 8192 + - 16384 + - 32768 + + io-width: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + IO bus width in bits of SDRAM chip. Decoded from Mode Register 8. + enum: + - 32 + - 16 + - 8 + +additionalProperties: true diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml index 9d78f140609b6c..63c47235cb9896 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml @@ -6,6 +6,9 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: LPDDR2 SDRAM compliant to JEDEC JESD209-2 +allOf: + - $ref: "jedec,lpddr-props.yaml#" + maintainers: - Krzysztof Kozlowski @@ -41,41 +44,6 @@ properties: Property is deprecated, use revision-id instead. deprecated: true - revision-id: - $ref: /schemas/types.yaml#/definitions/uint32-array - description: | - Revision IDs read from Mode Register 6 and 7. One byte per uint32 cell (i.e. ). - minItems: 2 - maxItems: 2 - items: - minimum: 0 - maximum: 255 - - density: - $ref: /schemas/types.yaml#/definitions/uint32 - description: | - Density in megabits of SDRAM chip. Obtained from device datasheet. - enum: - - 64 - - 128 - - 256 - - 512 - - 1024 - - 2048 - - 4096 - - 8192 - - 16384 - - 32768 - - io-width: - $ref: /schemas/types.yaml#/definitions/uint32 - description: | - IO bus width in bits of SDRAM chip. Obtained from device datasheet. - enum: - - 32 - - 16 - - 8 - tRRD-min-tck: $ref: /schemas/types.yaml#/definitions/uint32 maximum: 16 @@ -168,7 +136,7 @@ required: - density - io-width -additionalProperties: false +unevaluatedProperties: false examples: - | diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml index 48908a19473c3f..5969166cdc9e0f 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml @@ -6,6 +6,9 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: LPDDR3 SDRAM compliant to JEDEC JESD209-3 +allOf: + - $ref: "jedec,lpddr-props.yaml#" + maintainers: - Krzysztof Kozlowski @@ -20,40 +23,6 @@ properties: const: 1 deprecated: true - density: - $ref: /schemas/types.yaml#/definitions/uint32 - description: | - Density in megabits of SDRAM chip. - enum: - - 4096 - - 8192 - - 16384 - - 32768 - - io-width: - $ref: /schemas/types.yaml#/definitions/uint32 - description: | - IO bus width in bits of SDRAM chip. - enum: - - 32 - - 16 - - manufacturer-id: - $ref: /schemas/types.yaml#/definitions/uint32 - description: | - Manufacturer ID value read from Mode Register 5. The property is - deprecated, manufacturer should be derived from the compatible. - deprecated: true - - revision-id: - $ref: /schemas/types.yaml#/definitions/uint32-array - minItems: 2 - maxItems: 2 - items: - maximum: 255 - description: | - Revision value of SDRAM chip read from Mode Registers 6 and 7. - '#size-cells': const: 0 deprecated: true @@ -206,7 +175,7 @@ required: - density - io-width -additionalProperties: false +unevaluatedProperties: false examples: - | From patchwork Wed Aug 31 01:33:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julius Werner X-Patchwork-Id: 1672106 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Ki8P1MpB; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MHRY216Tpz1ynZ for ; Wed, 31 Aug 2022 11:34:14 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231187AbiHaBeM (ORCPT ); Tue, 30 Aug 2022 21:34:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbiHaBeL (ORCPT ); Tue, 30 Aug 2022 21:34:11 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CCD69E886 for ; Tue, 30 Aug 2022 18:34:09 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id w2so12828730pld.0 for ; Tue, 30 Aug 2022 18:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=eIoCfjLB426DRP9MvovxxghsKJLwtNHROlQefu7G3lM=; b=Ki8P1MpBQRb9aIYA2fhBuAY5M6rpPD29NWh06tTHoMqGNXybFoWDxZJVo/FTX6/K99 XHP/ssC68TEdCm0IgQe0jv6o794TxNNnEimNr3d0oAXsH/ShNnoElbJtQGvgT86jGsyD VdpoXKDvfmwZexXkjzONrz6ncSuj++OMsES/c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=eIoCfjLB426DRP9MvovxxghsKJLwtNHROlQefu7G3lM=; b=bnY6TJ/KNzxxWK2RcasRqe6MZu2ZYwPTNzP99faZt0rD2jyZO+hjxo2KmpORfAnBsy tC1eBzsbScuJ/6iZT3FGc2omry9VTWrHnIOx449HcIPbUS+iZ2F6d/slP87XpeA3lQUY y0gR45NvsdX2fdZBGjyvLLVE7j6gbQZmpO+YZ/OA3qWbghb1MAl8nTPnXcbtoQd407WZ 6WeoAjHEs83L1SuVLQxbROQgCmTzVvYTyh29yo2eer7mDCRKUqICw2QQg1b1v9fxUrus mBfeq9WB+u0syvAOU58+1X8AXdGp9fwDJcGjQw3TWjlRaMxR4jq3MG3fGVWm4IjssZNY Wv2g== X-Gm-Message-State: ACgBeo1bvJRDquT/FeTqmr/3+PO5Vuh3CgIW7B0toQsvTY8sdjAeHf2D f/TQn/lTrRAqZDXdVxKwcPMbdg== X-Google-Smtp-Source: AA6agR4+UrfNtofcyCHtH47Ino/bD141jp1fwWjV2p16FoV1gDN1vRx63iCxCXogE/VBzdTJYsPapg== X-Received: by 2002:a17:902:bf06:b0:172:cf73:df43 with SMTP id bi6-20020a170902bf0600b00172cf73df43mr23869443plb.13.1661909648090; Tue, 30 Aug 2022 18:34:08 -0700 (PDT) Received: from jwerner-p920.mtv.corp.google.com ([2620:15c:202:201:2e75:b9a4:fb1:b1b8]) by smtp.gmail.com with ESMTPSA id t10-20020a170902e84a00b00174f4316c24sm4261382plg.245.2022.08.30.18.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 18:34:07 -0700 (PDT) From: Julius Werner To: Krzysztof Kozlowski Cc: Rob Herring , Dmitry Osipenko , Doug Anderson , Jian-Jia Su , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Julius Werner Subject: [PATCH 2/4] dt-bindings: memory: Add numeric LPDDR compatible string variant Date: Tue, 30 Aug 2022 18:33:57 -0700 Message-Id: <20220831013359.1807905-3-jwerner@chromium.org> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220831013359.1807905-1-jwerner@chromium.org> References: <20220831013359.1807905-1-jwerner@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch allows a new kind of compatible string for LPDDR parts in the device tree bindings, in addition to the existing hardcoded , strings. The new format contains manufacturer and part (revision) information in numerical form, such as lpddr3-ff,0201 for an LPDDR3 part with manufacturer ID ff and revision ID 0201. This helps cases where LPDDR parts are probed at runtime by boot firmware and cannot be matched to hardcoded part numbers. Signed-off-by: Julius Werner --- .../memory-controllers/ddr/jedec,lpddr-props.yaml | 10 ++++++++++ .../memory-controllers/ddr/jedec,lpddr2.yaml | 8 +++++--- .../memory-controllers/ddr/jedec,lpddr3.yaml | 12 ++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) 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 8b31c60ea2435b..0c7d2feafd77c8 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml @@ -15,6 +15,16 @@ maintainers: - Krzysztof Kozlowski properties: + compatible: + description: + Compatible strings can be either explicit vendor names and part numbers + (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 zeroes. + The latter form can be useful when LPDDR nodes are created at runtime by + boot firmware that doesn't have access to static part number information. + manufacturer-id: $ref: /schemas/types.yaml#/definitions/uint32 description: diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml index 63c47235cb9896..0eb7a66dfd08db 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml @@ -20,13 +20,15 @@ properties: - elpida,ECB240ABACN - elpida,B8132B2PB-6D-F - enum: - - jedec,lpddr2-s4 - - items: - - enum: + - jedec,lpddr2-nvm - jedec,lpddr2-s2 + - jedec,lpddr2-s4 - items: + - pattern: "^lpddr2-[0-9a-f]{2},[0-9a-f]{4}$" - enum: - jedec,lpddr2-nvm + - jedec,lpddr2-s2 + - jedec,lpddr2-s4 revision-id1: $ref: /schemas/types.yaml#/definitions/uint32 diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml index 5969166cdc9e0f..cd076a4fd91194 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml @@ -14,10 +14,14 @@ maintainers: properties: compatible: - items: - - enum: - - samsung,K3QF2F20DB - - const: jedec,lpddr3 + oneOf: + - items: + - enum: + - samsung,K3QF2F20DB + - const: jedec,lpddr3 + - items: + - pattern: "^lpddr3-[0-9a-f]{2},[0-9a-f]{4}$" + - const: jedec,lpddr3 '#address-cells': const: 1 From patchwork Wed Aug 31 01:33:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julius Werner X-Patchwork-Id: 1672107 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=cMSqVjK2; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MHRY93XQJz1ynZ for ; Wed, 31 Aug 2022 11:34:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231246AbiHaBeS (ORCPT ); Tue, 30 Aug 2022 21:34:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbiHaBeN (ORCPT ); Tue, 30 Aug 2022 21:34:13 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C182B0B20 for ; Tue, 30 Aug 2022 18:34:10 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id 69so10588045pgb.13 for ; Tue, 30 Aug 2022 18:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=vhZ3yILypvJYBsR07fkWNRnqx8C8Eemkyou0+SjZ/pw=; b=cMSqVjK2Zfuhis85tst7BCwfAKBK2t9NliW2wwptDc3jcSLvsk23IFXL1Ba9QZNbLC RX0DbKquu1UnUWoZqzpAPwmEa6sGt3eS9DJi7Xc77uohiNcPVNoo8RG8QDAcwwJoqAAx FtQyKE8TyoclIShBe/nRYQFQZL9ZI4ZVzGZpk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=vhZ3yILypvJYBsR07fkWNRnqx8C8Eemkyou0+SjZ/pw=; b=2lwyVO5f+egfAFOSbVq7kYBuHSV7lJjhDoF5E6hIVDiOGSXbYI/uX6zNMSCWXPQOc/ htpebdG/WMPcrpshXD/8j/JOBY5hSIiJui/Z3sGPfxWA1g7ZMp9V+NSlqrQoGAGgWfeZ zMm/8S+qUw+9ubahkIQdum+Ut0cVRKY/8ZLad32+h/cUPow6W/IaEuD93amIPcZBdUQk +UUU7aQeQODGiEuZrMq53We0LVdQnZEGFKJ3AnKILxTNFY9bPoR98/eibhM8Izey5wFb +eOYBxTc1asa+Nmu7Bssf9Ubme7mlygqDxccEchm55uA/6yvX3yANn2Krx3GIBOQxPbh T3Dw== X-Gm-Message-State: ACgBeo2w2bif8uYsZPeDDuxU23qTR7E64Tho3Lr8A5FJbER3stgA7C2d Dgrw9LEl5FsyPaxB+88jrg34+A== X-Google-Smtp-Source: AA6agR4ccLRkb7LZHm0w+AIKx+colMNa8gkGdaPzUYlDlj4c6fTm7pv6uev6zAoWSFIZgENYZSJ7nQ== X-Received: by 2002:a65:6b8e:0:b0:42a:162c:e3a0 with SMTP id d14-20020a656b8e000000b0042a162ce3a0mr20198378pgw.464.1661909648973; Tue, 30 Aug 2022 18:34:08 -0700 (PDT) Received: from jwerner-p920.mtv.corp.google.com ([2620:15c:202:201:2e75:b9a4:fb1:b1b8]) by smtp.gmail.com with ESMTPSA id t10-20020a170902e84a00b00174f4316c24sm4261382plg.245.2022.08.30.18.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 18:34:08 -0700 (PDT) From: Julius Werner To: Krzysztof Kozlowski Cc: Rob Herring , Dmitry Osipenko , Doug Anderson , Jian-Jia Su , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Julius Werner Subject: [PATCH 3/4] dt-bindings: memory: Add jedec,lpddr4 and jedec,lpddr5 bindings Date: Tue, 30 Aug 2022 18:33:58 -0700 Message-Id: <20220831013359.1807905-4-jwerner@chromium.org> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220831013359.1807905-1-jwerner@chromium.org> References: <20220831013359.1807905-1-jwerner@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 --- .../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 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#" + +maintainers: + - Krzysztof Kozlowski + +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 { + 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 + +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. ). + minItems: 8 + maxItems: 8 + items: + minimum: 0 + maximum: 255 + +required: + - compatible + - density + - io-width + +unevaluatedProperties: false + +examples: + - | + lpddr4 { + 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>; + }; From patchwork Wed Aug 31 01:33:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julius Werner X-Patchwork-Id: 1672108 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=c70eTEa2; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MHRY96krpz1ynh for ; Wed, 31 Aug 2022 11:34:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229806AbiHaBeU (ORCPT ); Tue, 30 Aug 2022 21:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231206AbiHaBeN (ORCPT ); Tue, 30 Aug 2022 21:34:13 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B6A8B0B3C for ; Tue, 30 Aug 2022 18:34:10 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id i5-20020a17090a2a0500b001fd8708ffdfso10477281pjd.2 for ; Tue, 30 Aug 2022 18:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=VgOynVEB9/HARKXu49Pt4j7dTWgCIFiaZm3ap+KRJWg=; b=c70eTEa27HMsGuutG1waBvqwXQVDKH7Hg3/FJbUjjzDxswerI78gq8Vj33qN2mQMp6 lSHjZ/6R6iAHHN8ymDYNCA9ZOW0LTIO6HtNK7Ihdjw43jzrzdsRDCf//2f0IluBpZR/U GI/rqAVYOjrKByBkOu0TqAuns+PoCPb0gHSzQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=VgOynVEB9/HARKXu49Pt4j7dTWgCIFiaZm3ap+KRJWg=; b=lzCfIE3JRRbM0GD8ExU1ov2U9eLwsb7R5NT7g01GVkEoXm9vUT/SDuuF3KZKX4LR2U pUgPbVe3LjgArVqYYuqAsyO3Vw3gewhO4/iRV8tsTL+sclBGJJ6QTeY/zN34jQWlWBc9 ZKpG9JUDoGR3vnWqIp/RQRG0zrFFrYKLViNfLlSxZ9JvV8PUXe21Jf8KvVkxfMjgbuln c40Yv7yfdoS5+VxQVi3Igkmzh0RCRZ1qWerXVkXRHsu8E53pdFD2qC6IUZ1QDsF09G2T KBZvYOBydpz/9LNKsLiXDmEScW/mcPRAxEBX9f2EeGayJLO01bZaGaupQqtkojz7Z/2k WMkg== X-Gm-Message-State: ACgBeo00DqGVUflVzxgBn3uCUUxV8cXU/lhQVVx7Eu36mG8oLnYNonQf OCqHgloPjKjQPaECyYBUAJjgKk1utCywMg== X-Google-Smtp-Source: AA6agR4SdgAm5wO3PwP06W6bWbscrdXBG/UoiheinSk2SivjRbf3Z0nwLXCW2WF/QON++1PTx1/fgw== X-Received: by 2002:a17:902:d486:b0:16f:15a1:6da3 with SMTP id c6-20020a170902d48600b0016f15a16da3mr24043762plg.134.1661909649860; Tue, 30 Aug 2022 18:34:09 -0700 (PDT) Received: from jwerner-p920.mtv.corp.google.com ([2620:15c:202:201:2e75:b9a4:fb1:b1b8]) by smtp.gmail.com with ESMTPSA id t10-20020a170902e84a00b00174f4316c24sm4261382plg.245.2022.08.30.18.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 18:34:09 -0700 (PDT) From: Julius Werner To: Krzysztof Kozlowski Cc: Rob Herring , Dmitry Osipenko , Doug Anderson , Jian-Jia Su , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Julius Werner Subject: [PATCH 4/4] dt-bindings: memory: Add jedec,lpddrX-channel binding Date: Tue, 30 Aug 2022 18:33:59 -0700 Message-Id: <20220831013359.1807905-5-jwerner@chromium.org> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220831013359.1807905-1-jwerner@chromium.org> References: <20220831013359.1807905-1-jwerner@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds a new device tree binding for an LPDDR channel to serve as a top-level organizing node for LPDDR part nodes nested below it. An LPDDR channel needs to have an "io-width" property to describe its width (this is important because this width does not always match the io-width of the part number, indicating that multiple parts are wired in parallel on the same channel), as well as one or more nested "rank@X" nodes. Those represent information about the individual ranks of each LPDDR part connected on that channel and should match the existing "jedec,lpddrX" bindings for individual LPDDR parts. New platforms should be using this node -- the existing practice of providing a raw, toplevel "jedec,lpddrX" node without indication of how many identical parts are in the system should be considered deprecated. Signed-off-by: Julius Werner --- .../ddr/jedec,lpddr-channel.yaml | 116 ++++++++++++++++++ .../ddr/jedec,lpddr-props.yaml | 10 +- 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-channel.yaml diff --git a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-channel.yaml b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-channel.yaml new file mode 100644 index 00000000000000..517e770d8e7133 --- /dev/null +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-channel.yaml @@ -0,0 +1,116 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/memory-controllers/ddr/jedec,lpddr-channel.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: LPDDR channel with chip/rank topology description + +description: + An LPDDR channel is a completely independent set of LPDDR pins (DQ, CA, CS, + CK, etc.) that connect one or more LPDDR chips to a host system. The main + purpose of this node is to overall LPDDR topology of the system, including the + amount of individual LPDDR chips and the ranks per chip. + +maintainers: + - Julius Werner + +properties: + compatible: + enum: + - jedec,lpddr2-channel + - jedec,lpddr3-channel + - jedec,lpddr4-channel + - jedec,lpddr5-channel + + io-width: + description: + The number of DQ pins in the channel. If this number is different + from (a multiple of) the io-width of the LPDDR chip, that means that + multiple instances of that type of chip are wired in parallel on this + channel (with the channel's DQ pins split up between the different + chips, and the CA, CS, etc. pins of the different chips all shorted + together). This means that the total physical memory controlled by a + channel is equal to the sum of the densities of each rank on the + connected LPDDR chip, times the io-width of the channel divided by + the io-width of the LPDDR chip. + enum: + - 8 + - 16 + - 32 + - 64 + - 128 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +patternProperties: + "^rank@[0-9]+$": + type: object + description: + Each physical LPDDR chip may have one or more ranks. Ranks are + internal but fully independent sub-units of the chip. Each LPDDR bus + transaction on the channel targets exactly one rank, based on the + state of the CS pins. Different ranks may have different densities and + timing requirements. + oneOf: + - $ref: /schemas/memory-controllers/ddr/jedec,lpddr2.yaml# + - $ref: /schemas/memory-controllers/ddr/jedec,lpddr3.yaml# + - $ref: /schemas/memory-controllers/ddr/jedec,lpddr4.yaml# + - $ref: /schemas/memory-controllers/ddr/jedec,lpddr5.yaml# + required: + - reg + +required: + - compatible + - io-width + - "#address-cells" + - "#size-cells" + +additionalProperties: false + +examples: + - | + lpddr-channel0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "jedec,lpddr4-channel"; + io-width = <32>; + + rank@0 { + compatible = "lpddr4-ff,0100", "jedec,lpddr4"; + reg = <0>; + density = <8192>; + io-width = <16>; + manufacturer-id = <255>; + revision-id = <1 0>; + }; + }; + + lpddr-channel1 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "jedec,lpddr4-channel"; + io-width = <32>; + + rank@0 { + compatible = "lpddr4-05,0301", "jedec,lpddr4"; + reg = <0>; + density = <4096>; + io-width = <32>; + manufacturer-id = <5>; + revision-id = <3 1>; + }; + + rank@1 { + compatible = "lpddr4-05,0301", "jedec,lpddr4"; + reg = <1>; + density = <2048>; + io-width = <32>; + manufacturer-id = <5>; + revision-id = <3 1>; + }; + }; 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 e1182e75ca1a3f..53a4836028cd25 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ddr/jedec,lpddr-props.yaml @@ -9,7 +9,8 @@ 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. + reused for each type. Nodes using this schema should generally be nested under + an LPDDR channel node. maintainers: - Krzysztof Kozlowski @@ -71,4 +72,11 @@ properties: - 16 - 8 + reg: + description: + The rank number of this LPDDR rank when used as a subnode to an LPDDR + channel. + minimum: 0 + maximum: 3 + additionalProperties: true