From patchwork Mon Nov 14 08:56:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 19599 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2041323wru; Mon, 14 Nov 2022 01:01:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf7j7ZkmabsBeehkJfH0SqNG7eaOpqSENYrAdYFjIf5o4+UIICstgb2pup1T+w+RbKh8cqss X-Received: by 2002:a17:906:d1d0:b0:7ad:88f8:6a53 with SMTP id bs16-20020a170906d1d000b007ad88f86a53mr9846125ejb.61.1668416460845; Mon, 14 Nov 2022 01:01:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668416460; cv=none; d=google.com; s=arc-20160816; b=iNMtBdhOW9bHFJr93SLokJmM8NJKkkagy+i+r9yKyo0h2hMmaumNz92tOMTIeDz7bE ApAXd8BRGn64XcB+QQg2fhSE+fH9wdIXiz76Xwu+2x93iyB1ibU25/U0BrO1STkkBLUq HOfF/oNtStomPApYhkibTRhSLVZCAFeqPIpcH+gZgDmYpgmdecDuiCAn99NjRdv++yR1 aVDFPlrG1uzvJkRaQgSZPU/enK6+D1WGuU+gjyK4tA7Q1Zo5P64Jp+ZzUM7y+7cbytv3 RZogV9MHWDoZBGCG01bNZlIPyyk4y2oN0f5ibhnIsishVl/V+ss/Qh3NVYm2RnMmIvH0 G+Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O4AM4lnV2gTii8655Tt65FHVrgfOcRYc0nYRGkNgVIU=; b=a9YblDZIrIT131GR1EVUn7IcTO25Rnm9of3Qf3f4uAsAA4Wz+REgWms/CeRUMRfnLB CDrXFxJSY1agXYsEDlP+i/c8CYPeMnOJL8sma9lNMQ0mKsNtfOdlQo5G2C1P9KxlP2A1 LmxIZ/7d66X8K0tIilVsnD8ZhANDD7giSXzBcAOYo4FAnTaN2lHKPcQB5gnr0Lwyzxpw zle7zecYrTSoXRgHy+njAR5nrqLKAbEgzicFsEOcpa/JmVn0TbHd+A28FNm2tjwmYWo/ hzQ1Trd9E2FWZOkfiF4DVUdHmGyVn4Mq3gOFi1oj8+eUxfxOYfvqE7pH1KxiLdZC/MAz Y2SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cE42Y4nL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a05640242c700b0045d523bee48si9448433edc.178.2022.11.14.01.00.33; Mon, 14 Nov 2022 01:01:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cE42Y4nL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235126AbiKNI5Y (ORCPT + 99 others); Mon, 14 Nov 2022 03:57:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236633AbiKNI5M (ORCPT ); Mon, 14 Nov 2022 03:57:12 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 214321CFD0; Mon, 14 Nov 2022 00:57:07 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id A3BD7100015; Mon, 14 Nov 2022 08:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668416226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O4AM4lnV2gTii8655Tt65FHVrgfOcRYc0nYRGkNgVIU=; b=cE42Y4nL5ZWwM04jmHinoEw182ECDCWr8074fPKIbaA9nslQ+lOlU4kVFfUBvxJgDRCArk Zsdc2lDWeh+91dWuH8MK5G7BusFAhaYO172IEE82WtMRnYw9/gwi//waUxhqxvfqOvoLRL h2PsW3ToZODKnqfE17qgxFEuexMH2I99bCGYS9RYerYuLnhlPmJxOmmn3Wk8HqGToZJAze IVIJbxT1fiXJaSD58Lv3gQ4accNTXVkvZmqryvdQys4TYR1RuFthpW+wTkutjz2P9RpBiB qLdRuQFqcv5uV+D3WLru1wo+K97fcpGN2hkZtZhVlicu/ZZBqJV91dlSGrSgPw== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Bartosz Golaszewski , Srinivas Kandagatla , , Miquel Raynal Subject: [PATCH v4 1/5] dt-bindings: nvmem: Introduce the nvmem-layout container Date: Mon, 14 Nov 2022 09:56:55 +0100 Message-Id: <20221114085659.847611-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221114085659.847611-1-miquel.raynal@bootlin.com> References: <20221114085659.847611-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS 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: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749461458826842435?= X-GMAIL-MSGID: =?utf-8?q?1749461458826842435?= The nvmem devices description works like this: * Most cases (EEPROM & co): eeprom@x { compatible = ""; ... }; * MTD case: flash@y { compatible = ""; ... otp { compatible = "user-otp"; /* or "factory-otp" */ ... }; }; In the former case, the nvmem device is "eeprom@x", while in the latter case the nvmem device is "otp". Nvmem devices can produce nvmem cells. The current way to describe nvmem cells is to locate them by providing their static byte and bit offset and length. These information are stored in subnodes of the nvmem device. It is now a fact that such description does not fit more advanced use cases where the location or the size of the cells may vary. There are currently three known situations which require being described differently: Kontron's SL28 VPD, ONIE's TLV table and U-Boot's environment variables. Hence, we need a way to describe the parsers that must be used in order to make the dynamic discovery of the nvmem cells. This new description must fit both use cases (the generic situation and the MTD case). Let's create in both cases a container node named nvmem-layout whose content will depend on the parser. Right now nvmem-layout.yaml is "empty", but references to additional layout parser bindings will be inserted in the near future. The final goal being something that looks like: * Most cases (EEPROM & co): eeprom@x { compatible = ""; ... nvmem-layout { compatible = ""; ... }; }; * MTD case: flash@y { compatible = ""; ... otp { compatible = "user-otp"; /* or "factory-otp" */ ... nvmem-layout { compatible = ""; ... }; }; }; Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring --- .../bindings/nvmem/layouts/nvmem-layout.yaml | 30 +++++++++++++++++++ .../devicetree/bindings/nvmem/nvmem.yaml | 7 +++++ 2 files changed, 37 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml diff --git a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml new file mode 100644 index 000000000000..ecc7c37cbc1f --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/layouts/nvmem-layout.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVMEM (Non Volatile Memory) layouts + +maintainers: + - Srinivas Kandagatla + - Michael Walle + - Miquel Raynal + +description: | + Most NVMEM layouts are static and thus do not require additional description + besides the bytes/bits offset and length. Other layouts can be less statically + define and might require dynamic reading of the NVMEM device in order to + perform their parsing. The nvmem-layout container is here to describe these. + +properties: + compatible: true + + '#address-cells': false + + '#size-cells': false + +required: + - compatible + +unevaluatedProperties: false diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml index 0455506fc30f..75bb93dda9df 100644 --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml @@ -39,6 +39,13 @@ properties: when it's driven low (logical '0') to allow writing. maxItems: 1 + nvmem-layout: + $ref: /schemas/nvmem/layouts/nvmem-layout.yaml + description: + Alternative to the statically defined nvmem cells, this + container may reference more advanced (dynamic) layout + parsers. + patternProperties: "@[0-9a-f]+(,[0-7])?$": type: object From patchwork Mon Nov 14 08:56:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 19598 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2041302wru; Mon, 14 Nov 2022 01:00:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf5nDRVyPTCtC3NguBjv7vkgq0l1Z8VD2CygzxANnKuzecNvY3sj9j1wGCIseqi/CLRK2j2B X-Received: by 2002:a17:906:dc1:b0:7ae:6d3e:a02e with SMTP id p1-20020a1709060dc100b007ae6d3ea02emr9252055eji.626.1668416458364; Mon, 14 Nov 2022 01:00:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668416458; cv=none; d=google.com; s=arc-20160816; b=XzwgzhESw/d0eDEd2zEzcEzxGQfZZdzbJ2TRAVvPeWb6c0ZWy+IAESBZJu0nCOUVyz AB3BerU+dimihaJmJQNf6x+wpSxISP3PggZzKnOYLaN04gkW7/RmyLZnXhN6zGY7I+6t ad8RK1xAg0RD0qt3xXeRnJU2/E1z5ttLHlYr2HPPVRJItDkU49BtT8QqVEYTeyrrKS9B ykXQiHSjqWcsGj2TwjmWCe1S+vMufgygEwUXd65ZWEzS0cy6QrYKZi70ukRBMPAHB1Jp bmsveh24D/APqmeAz+0b7GsUR/by/TbueT4v9CzLYbm/QvQtAug2SFRlZoi8LemoqfdD 8Jjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/RuwsiKOoT3RSiv0ATWGMePKlt2FePql8/L/NJA2t6w=; b=Qx47CRiLt7OsrXgKVlt5e51IcKDJQBcGO7slMe2k1HrAt1fJOL+RfDZ/dB2Gn6s3Nq vU2oK86xrn9OYvZsqB4/Qok1g9S7iFwF2eROiJ1eIYyydYgUsXpG3ccwNO/YpaafiZIT c6/Qvo4Uqz07SoCIcwacazUPPxC0CA+EYRyyqm8q8yXXOJr/jOmlIUdyLtyI9bOTI/3p D3wf0zLGdFVt4hgzO14D8MqvTMZZnVqbLxuBc8zK4tguzEcp1184g1E/nTzPy+0XL160 iU8TUQYJFRq16GovYOYYzd8BW+r9EgVBG157T4c0Dq/oKz/ntbgxBGAhio83GCCzN6Ww TO7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=drBSkcHi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020aa7d0c5000000b0044eae9b2c48si8069270edo.273.2022.11.14.01.00.34; Mon, 14 Nov 2022 01:00:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=drBSkcHi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235956AbiKNI5b (ORCPT + 99 others); Mon, 14 Nov 2022 03:57:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236081AbiKNI5M (ORCPT ); Mon, 14 Nov 2022 03:57:12 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDB801C401; Mon, 14 Nov 2022 00:57:09 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 8F3E410000B; Mon, 14 Nov 2022 08:57:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668416228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/RuwsiKOoT3RSiv0ATWGMePKlt2FePql8/L/NJA2t6w=; b=drBSkcHiGiZIoU8VLro96xlsTfAl0dgPYa0+Cv2zh2EBC5K124WsKrQdPmfcQOFl0KPpH9 kk7VpvjLl56WgiMO2s+9X5RZXZ9UR/W6prHjQzSMtYwzA8KiCwQitzldAmX9ix4xGJpNBt RwOl9o359I8aEN0wYn/OOdNsIExx2lxZRGboJEEwZqtS/yq0B8H1IGvTAuZhWvIvKjtHfp roS++IRFlm58JFSDVQX/IXx8PyHpJJ0WbxrkQ/bHbR+lTUtOB4H7FgXtx7P1N64VgAL7k0 6JXj+bA3XwjwvPIlN6s5/0Wn571UgTE4KL00ISuTF9L2TmmoEto6bOzuZB4ZYQ== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Bartosz Golaszewski , Srinivas Kandagatla , , Miquel Raynal Subject: [PATCH v4 2/5] dt-bindings: eeprom: Inherit from nvmem.yaml Date: Mon, 14 Nov 2022 09:56:56 +0100 Message-Id: <20221114085659.847611-3-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221114085659.847611-1-miquel.raynal@bootlin.com> References: <20221114085659.847611-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS 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: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749461456268906984?= X-GMAIL-MSGID: =?utf-8?q?1749461456268906984?= EEPROMs can be nvmem providers. Let's make all EEPROM bindings reference nvmem.yaml as they should, so that nvmem cells and layout parsers can be safely described within the EEPROM nodes. Signed-off-by: Miquel Raynal Acked-by: Bartosz Golaszewski Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/eeprom/at24.yaml | 5 ++++- Documentation/devicetree/bindings/eeprom/at25.yaml | 1 + .../devicetree/bindings/eeprom/microchip,93lc46b.yaml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/eeprom/at24.yaml b/Documentation/devicetree/bindings/eeprom/at24.yaml index d14e0accbda8..84af0d5f52aa 100644 --- a/Documentation/devicetree/bindings/eeprom/at24.yaml +++ b/Documentation/devicetree/bindings/eeprom/at24.yaml @@ -10,6 +10,9 @@ title: I2C EEPROMs compatible with Atmel's AT24 maintainers: - Bartosz Golaszewski +allOf: + - $ref: /schemas/nvmem/nvmem.yaml + select: properties: compatible: @@ -183,7 +186,7 @@ required: - compatible - reg -additionalProperties: false +unevaluatedProperties: false examples: - | diff --git a/Documentation/devicetree/bindings/eeprom/at25.yaml b/Documentation/devicetree/bindings/eeprom/at25.yaml index 8b1c997caac1..0f5a8ef996d3 100644 --- a/Documentation/devicetree/bindings/eeprom/at25.yaml +++ b/Documentation/devicetree/bindings/eeprom/at25.yaml @@ -104,6 +104,7 @@ required: allOf: - $ref: /schemas/spi/spi-peripheral-props.yaml# + - $ref: /schemas/nvmem/nvmem.yaml - if: properties: compatible: diff --git a/Documentation/devicetree/bindings/eeprom/microchip,93lc46b.yaml b/Documentation/devicetree/bindings/eeprom/microchip,93lc46b.yaml index 0c2f5ddb79c5..64cfd971c9c5 100644 --- a/Documentation/devicetree/bindings/eeprom/microchip,93lc46b.yaml +++ b/Documentation/devicetree/bindings/eeprom/microchip,93lc46b.yaml @@ -47,6 +47,7 @@ required: allOf: - $ref: /schemas/spi/spi-peripheral-props.yaml# + - $ref: /schemas/nvmem/nvmem.yaml unevaluatedProperties: false From patchwork Mon Nov 14 08:56:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 19600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2041341wru; Mon, 14 Nov 2022 01:01:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf6qj1hqmX8B/W0krBnoXj3VpzaV+HgjUZ4mBIcu7zl6KDjOBBc/pZy6RXNmC42+lTh+Dlaw X-Received: by 2002:a50:9503:0:b0:457:1edb:996c with SMTP id u3-20020a509503000000b004571edb996cmr10308218eda.363.1668416462756; Mon, 14 Nov 2022 01:01:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668416462; cv=none; d=google.com; s=arc-20160816; b=MvRMlJCd2V92mk8VeVe8UFncnYu7EV1oG8CKU57J7Brh8orpTRWGv0ZdlwmYJ1zTUN muG712WcncFV/QEpAWv+QYUnKq/RfDzmWhjEPWf1W6YjuUTRYIKYRaVA5FeyKKoYzFan Trt0HgpnJXdjjWfh3af29aPlz35kE711BD7bWmCiLTFGpZ24U3FAXGExvWpCWMxmkkOo vaXsiYEVJMp3yfKd773yi7yGXQfr1APWUIWMfvL9ZhU4F4baGlgi1tLHQ5movoPiblUv gmqryhhtzazPKaZODKCAXncIsLkJ5gAK+bPamQJ+H/ssqywlvQeeaiKEFOFCkdh6wBW7 Os4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BikeLvIio/JhCmemxXGK6Tb6BR276xdjdIvpKahReNo=; b=X+oemaARDzDPreEWVvJPYz6vISNP1GTvYSf2rDU1YdW7iApclL/li7NB0Rbme1++JU lu5/OMdwfeSfcgYvAZdAiBr3FxTlLghbmTgvVgs3ZRu0fZa8uFIh071ETLON9NLJUNFQ /gSJHmanmP10XOaPtWYL1OgHm/2hDgDTC72MpSZHSjkMtq9XuMwCjC72cRdlUErryYvh WSFjIrcbuWKsUiP0KtfktfZJ3Q7a4TjeX+9BTHdAHrQ1Fd1s7EO4RnrpsFUayCEXEN+l Lt5AG6xNYXtsf2+CYEVShD4I5uWQyRgtmrtRhnr//ap+BZ+TwrzoVQSrS13rL8jyXK3C yqnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YgayJyWy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr18-20020a170907721200b0078db3ce1e59si2704383ejc.38.2022.11.14.01.00.38; Mon, 14 Nov 2022 01:01:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YgayJyWy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236680AbiKNI5f (ORCPT + 99 others); Mon, 14 Nov 2022 03:57:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236625AbiKNI5O (ORCPT ); Mon, 14 Nov 2022 03:57:14 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A4671CB0A; Mon, 14 Nov 2022 00:57:11 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 940C010000C; Mon, 14 Nov 2022 08:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668416229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BikeLvIio/JhCmemxXGK6Tb6BR276xdjdIvpKahReNo=; b=YgayJyWyPZfnFptl1bLMKNITwUQ25vhC/3TGcCwAe0psbOYG5CFVBeATP2+0RMaTRlZKLF DO7aYXY1gguBDzioOOMQNXgXubUsLA7GpfehuEvb7jQr9TGbT7QsJuz580UzSpC9cPYygJ EJtjZozHNpvGkY/kB77Hk2D4UxZJVnY/0JdJ+EIygIZvzDyoAUrTQvNvps79wHlQ/F432C dsG1Q1AegM4+zo4ZS1yZmccdeEyEhuc2DPXjb+GE45D3uaXsyOKWpVp6qewgSXaynEv75d n7i7NzrlL/7XQIuk72Gkhs0gZ6P/go8nksf2tzDpTv/BHwgE+jiM5/rq+fKOSw== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Bartosz Golaszewski , Srinivas Kandagatla , , Miquel Raynal Subject: [PATCH v4 3/5] dt-bindings: nvmem: add YAML schema for the sl28 vpd layout Date: Mon, 14 Nov 2022 09:56:57 +0100 Message-Id: <20221114085659.847611-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221114085659.847611-1-miquel.raynal@bootlin.com> References: <20221114085659.847611-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS 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: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749461460668173750?= X-GMAIL-MSGID: =?utf-8?q?1749461460668173750?= From: Michael Walle Add a schema for the NVMEM layout on Kontron's sl28 boards. Signed-off-by: Michael Walle Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring --- .../nvmem/layouts/kontron,sl28-vpd.yaml | 62 +++++++++++++++++++ .../bindings/nvmem/layouts/nvmem-layout.yaml | 3 + 2 files changed, 65 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/layouts/kontron,sl28-vpd.yaml diff --git a/Documentation/devicetree/bindings/nvmem/layouts/kontron,sl28-vpd.yaml b/Documentation/devicetree/bindings/nvmem/layouts/kontron,sl28-vpd.yaml new file mode 100644 index 000000000000..fef795e79c36 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/layouts/kontron,sl28-vpd.yaml @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/layouts/kontron,sl28-vpd.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVMEM layout of the Kontron SMARC-sAL28 vital product data + +maintainers: + - Michael Walle + +description: + The vital product data (VPD) of the sl28 boards contains a serial + number and a base MAC address. The actual MAC addresses for the + on-board ethernet devices are derived from this base MAC address by + adding an offset. + +select: false + +properties: + compatible: + const: kontron,sl28-vpd + + serial-number: + type: object + description: The board's serial number + + base-mac-address: + type: object + description: + Base MAC address for all on-module network interfaces. The first + argument of the phandle will be treated as an offset. + + properties: + "#nvmem-cell-cells": + const: 1 + + additionalProperties: false + +required: + - compatible + +additionalProperties: false + +examples: + - | + otp-1 { + compatible = "user-otp"; + + nvmem-layout { + compatible = "kontron,sl28-vpd"; + + serial_number: serial-number { + }; + + base_mac_address: base-mac-address { + #nvmem-cell-cells = <1>; + }; + }; + }; + +... diff --git a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml index ecc7c37cbc1f..f64ea2fa362d 100644 --- a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml +++ b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml @@ -17,6 +17,9 @@ description: | define and might require dynamic reading of the NVMEM device in order to perform their parsing. The nvmem-layout container is here to describe these. +oneOf: + - $ref: kontron,sl28-vpd.yaml + properties: compatible: true From patchwork Mon Nov 14 08:56:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 19601 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2041429wru; Mon, 14 Nov 2022 01:01:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf4GwpdOA9tVTbmIyyCngewE9gc1ktU4LPdJubaD6pgiU3uSp7RSrysiwrSTOX68yx4haxIB X-Received: by 2002:a17:906:13c6:b0:78d:b5be:e5f with SMTP id g6-20020a17090613c600b0078db5be0e5fmr9500947ejc.601.1668416475617; Mon, 14 Nov 2022 01:01:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668416475; cv=none; d=google.com; s=arc-20160816; b=DTMKtJtDJjTe8v8gUuwtBsVRft7/3kBTKpna4vj8xlUexrACwZCLoXqOQZWdU7olUr KHUDOmzan2pd7A0KDVQSfziJJGhRymNO2BVm3WNaJsf+exv/oseaKbo8HUb/7FXBnltg NysW4kXbLnuBkxp3wc1K/4Hy9MRZq8pm4Yh0nzezVd0kQJGkINn29MFJmBlXaeKGtk/r 0BnY/HYDnNk1IYwk9bEAtXZFcmraRdhBWbCwW6X4kNQ0LaVmAgfcAEK+NLWQIfUFmqGp SvKgCtkqKV/Zy61noreIz2UlvKNcXFk80pRSi6qy+UejBwJ57c7CLYC1DON+eqnH47dr Wa3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PH1TaWI18OK/TWX9eI82Zyj07sQxLoh1aLVV4ESIk3Q=; b=Tt/FiIHqZcFn9KTcnYcuuS3tF/INJ8tDkmNwoPE1sOLbcUujq+i8V9AnrZEbUdW/Qt bS6D1XBvc8wj4czJuUFzcyV1ddTF8w7rsD8k0gLWeHGIVwIx6sDOacEPiTiTsTB5p+2y 6xLeLbPThqhL5GdTLweBoe4R9F4sLsRUFSlRt+ybBQs+BTHeV8d2QvzBdsrgv2yzl7fN IKsLtbGZZcsKyjSuuRr3BaQIO7NrJdH07m/wYzzR7Mjvy0JLDE5/A+CcLBEybZqi64WS ltZDr7Sy5Ya4/lx2oikABUg+tc+HL84HlTzD3Ecvjn7ZeyIfFIYctK6JxmxZI3GfUr3M dZxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=FV57343R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ka17-20020a170907991100b007a1e33462c1si6208974ejc.268.2022.11.14.01.00.51; Mon, 14 Nov 2022 01:01:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=FV57343R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236629AbiKNI5r (ORCPT + 99 others); Mon, 14 Nov 2022 03:57:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236649AbiKNI5P (ORCPT ); Mon, 14 Nov 2022 03:57:15 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 157B21CFE7; Mon, 14 Nov 2022 00:57:12 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 145B910000A; Mon, 14 Nov 2022 08:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668416231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PH1TaWI18OK/TWX9eI82Zyj07sQxLoh1aLVV4ESIk3Q=; b=FV57343RzuyqV9ECyUhRuzb68q4wvUf5r1ZryMT9Dt7M4PUKQkEeIDh+jygW8G/vs+L7QC /MCMF3ryQ7SkLtfi8WU3GFEUiuF+ttd2DiNkzcZnaJe1rr64eopFLMmcNqgrT0Mh4M8Fsl sxeJPEAKqUIR7zy6xKBzvnvLz02BlBH83RwK5zZS/6WDD4As/SWh5pRpU/tr00/4bt2kVw 68POKZpO+svRrphqzjVmvslf+x0vdIyw1VxZoFKBji+LzKIw8thflRaroEmPJpncQo7Vdf YAUVytnUYt2sC6gMmmNt7ywjJNBrl5Gr839gQOyFgp11F2Kbj0wnmobsB7BChA== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Bartosz Golaszewski , Srinivas Kandagatla , , Miquel Raynal , Rob Herring Subject: [PATCH v4 4/5] dt-bindings: vendor-prefixes: Add ONIE Date: Mon, 14 Nov 2022 09:56:58 +0100 Message-Id: <20221114085659.847611-5-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221114085659.847611-1-miquel.raynal@bootlin.com> References: <20221114085659.847611-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS 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: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749461474231513878?= X-GMAIL-MSGID: =?utf-8?q?1749461474231513878?= As described on their website (see link below), "The Open Network Install Environment (ONIE) is an open source initiative that defines an open “install environment” for modern networking hardware." It is not a proper corporation per-se but rather more a group which tries to spread the use of open source standards in the networking hardware world. Link: https://opencomputeproject.github.io/onie/ Signed-off-by: Miquel Raynal Acked-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 6e323a380294..65a74026cf2b 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -927,6 +927,8 @@ patternProperties: description: One Laptop Per Child "^oneplus,.*": description: OnePlus Technology (Shenzhen) Co., Ltd. + "^onie,.*": + description: Open Network Install Environment group "^onion,.*": description: Onion Corporation "^onnn,.*": From patchwork Mon Nov 14 08:56:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 19602 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2041691wru; Mon, 14 Nov 2022 01:01:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf4GTqYB3TXUvU/IHmmZ0zpaVSc48V/R2lCs8J3TtwES+E5ESe3PAnC4HQoQ2izncFShAtpd X-Received: by 2002:aa7:d907:0:b0:460:f0c0:f9c8 with SMTP id a7-20020aa7d907000000b00460f0c0f9c8mr10527832edr.181.1668416506845; Mon, 14 Nov 2022 01:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668416506; cv=none; d=google.com; s=arc-20160816; b=piV74X017eDb8C8rOJ3wIZKwb89lOvGs7m4/Gok3sv7KzblKTSzOAXl3oGDyarasZU Mpys0O8sN0YmvaQaExMifY3joGs7eJLnQQs5lvnbYArDJCidZQve0Nt31kBAC3P1gadt 1YnmBASOm9HqM1J1USjI4AT0Gxdo6xhj5mkCeh4lSzuS4w2QoGm0MKcHhVB94zD/ryrv wwmDNKfCBYPUsDbXoKnFEwTfwtcr8Oq1RdhUrtqP5kDyZmNW4sDPmldhajKMiej9D9w4 cjcf0VE7wgLrkVBSyaKsWVJiapA3uuc+gI9sxntsPdlvll9IKppbBjzCseabLurh+J/h 5xzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4HG/iT/mzETZVhKM6zL2vs6fGxz+0PlYq2xmoenZCzQ=; b=g6nCFu0EmJtRSauPb/cwJxD+WrVODSc3IPnroX3b0lGYrZOTULN+kvj3g9w60Gx89y qQQzXtwEq6I423tdkTfRBXQXeyCAvHaz9wAjoMUSlwMTmodp4iHFWCTQMuWho673rpdr Za1t1DMoK5iLbOUQlKn96enJm3pD3TCq4QULqQm/gaxp7NEe+A/HQtQAF5QPLVLvtotd gHDQmxUhUducRfag1JWlieMyW9/FVz7JbxfMRk/R5h9GtcSbDOC1No8ZWzmcUieE3ZIM zNnEumXGaOqtj/HBkYJvqUXn/JzwwKXBOkKsKiwRw+ZYPEYoz3TDm6ksTUXylO/QJC6Q /c/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=EE2EyoU2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ss17-20020a170907c01100b007ac9a51342asi7230838ejc.188.2022.11.14.01.01.23; Mon, 14 Nov 2022 01:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=EE2EyoU2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236665AbiKNI5u (ORCPT + 99 others); Mon, 14 Nov 2022 03:57:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236662AbiKNI5X (ORCPT ); Mon, 14 Nov 2022 03:57:23 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FED91CFF9; Mon, 14 Nov 2022 00:57:15 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id DEABA100008; Mon, 14 Nov 2022 08:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668416233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4HG/iT/mzETZVhKM6zL2vs6fGxz+0PlYq2xmoenZCzQ=; b=EE2EyoU2XiXxfqcb5iTj6B8Fx0GBBnzPeUpEidTGTu0cRaS/hm3IBaTeoocAa8NCp+tJOp hwsBz3GcxksSXT2WgC2hqrQ76AGhDIUF5ArdknTdPPqlbgdp6J2+IA25OZPy4uC00ax/VS AmQUHbrQjuxCImRZNjYbJVgyJuFQCKXK0Us6x3RBNK6yb/lA4Rz7IA2BeoUrAg1Mst/vf0 X6tf6pRAkCXVIbp/48/CVk+CaMiNbny6ZyCE5FrGtbX6m5lik8/SkN+3KDn24MZjHV+7pY L4SkKDj+3wG7oOHt+xjSfXwuV3CF7LFul1CgI7vVhzONJ2FYN+wkDUBZ8RXtsQ== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , Bartosz Golaszewski , Srinivas Kandagatla , , Miquel Raynal Subject: [PATCH v4 5/5] dt-bindings: nvmem: add YAML schema for the ONIE tlv layout Date: Mon, 14 Nov 2022 09:56:59 +0100 Message-Id: <20221114085659.847611-6-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221114085659.847611-1-miquel.raynal@bootlin.com> References: <20221114085659.847611-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS 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: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749461506776019644?= X-GMAIL-MSGID: =?utf-8?q?1749461506776019644?= Add a schema for the ONIE tlv NVMEM layout that can be found on any ONIE compatible networking device. Describe all the possible NVMEM cells that can be produced by this layout parser. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring --- .../bindings/nvmem/layouts/nvmem-layout.yaml | 1 + .../nvmem/layouts/onie,tlv-layout.yaml | 147 ++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/layouts/onie,tlv-layout.yaml diff --git a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml index f64ea2fa362d..8512ee538c4c 100644 --- a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml +++ b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml @@ -19,6 +19,7 @@ description: | oneOf: - $ref: kontron,sl28-vpd.yaml + - $ref: onie,tlv-layout.yaml properties: compatible: true diff --git a/Documentation/devicetree/bindings/nvmem/layouts/onie,tlv-layout.yaml b/Documentation/devicetree/bindings/nvmem/layouts/onie,tlv-layout.yaml new file mode 100644 index 000000000000..5a0e7671aa3f --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/layouts/onie,tlv-layout.yaml @@ -0,0 +1,147 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/layouts/onie,tlv-layout.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVMEM layout of the ONIE tlv table + +maintainers: + - Miquel Raynal + +description: + Modern networking hardware implementing the Open Compute Project ONIE + infrastructure shall provide a non-volatile memory with a table whose the + content is well specified and gives many information about the manufacturer + (name, country of manufacture, etc) as well as device caracteristics (serial + number, hardware version, mac addresses, etc). The underlaying device type + (flash, EEPROM,...) is not specified. The exact location of each value is also + dynamic and should be discovered at run time because it depends on the + parameters the manufacturer decided to embed. + +select: false + +properties: + compatible: + const: onie,tlv-layout + + product-name: + type: object + additionalProperties: false + + part-number: + type: object + additionalProperties: false + + serial-number: + type: object + additionalProperties: false + + mac-address: + type: object + description: + Base MAC address for all on-module network interfaces. The first + argument of the phandle will be treated as an offset. + + properties: + "#nvmem-cell-cells": + const: 1 + + additionalProperties: false + + manufacture-date: + type: object + additionalProperties: false + + device-version: + type: object + additionalProperties: false + + label-revision: + type: object + additionalProperties: false + + platforn-name: + type: object + additionalProperties: false + + onie-version: + type: object + additionalProperties: false + + num-macs: + type: object + additionalProperties: false + + manufacturer: + type: object + additionalProperties: false + + country-code: + type: object + additionalProperties: false + + vendor: + type: object + additionalProperties: false + + diag-version: + type: object + additionalProperties: false + + service-tag: + type: object + additionalProperties: false + + vendor-extension: + type: object + additionalProperties: false + +required: + - compatible + +additionalProperties: false + +examples: + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + eeprom@56 { + compatible = "atmel,24c64"; + read-only; + reg = <0x56>; + + nvmem-layout { + compatible = "onie,tlv-layout"; + + serial-number { + }; + }; + }; + }; + + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + flash@0 { + compatible = "m25p80", "jedec,spi-nor"; + reg = <0>; + + otp { + compatible = "user-otp"; + + nvmem-layout { + compatible = "onie,tlv-layout"; + + mac-address { + #nvmem-cell-cells = <1>; + }; + }; + }; + }; + }; +...