From patchwork Fri Nov 4 16:38:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 15682 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp518005wru; Fri, 4 Nov 2022 09:47:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6+nolFZZQYG9ssAEAffq8jnpyEOtxzl428IG0sh8NaD7BdoVOfgJTvXEil/Rlmtgg8OXkY X-Received: by 2002:a17:907:8a1c:b0:7ae:1e64:aa5 with SMTP id sc28-20020a1709078a1c00b007ae1e640aa5mr8673595ejc.119.1667580462734; Fri, 04 Nov 2022 09:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667580462; cv=none; d=google.com; s=arc-20160816; b=sSElEH+g1GJrTl2Bh42PRicoQ/MRxxy1E1RUfXVWK6QZD0VFzs7aaNoeRWWmhnNYJp CKHx/v0eO5sVKeJoWIvOL3v8dft5wDZNFfHkNcCCMJHTkq+kj8JScEsvAo9x8PrseQ/3 Ha6j0fg9jQyHYQwTQ0hjA9BAaViPSt55wjwYjAU16z8nk2cTcWsjftx1+aIkt+5Rudvv Ss5b5xvJn4TT3cQ0PHXfLQhxUPNiL5a3TpssKQIvOSadOXQu6cAqOpouqz5BqU4OYydr KhDYgoA1w0Bg9lCKNratsyOsOFoax2UZ4IRrqNQkjO5aNW1EyQj2kYhCtnuWCOhSYDZP ttWQ== 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=qX2H0ur2OnCIgQeP/+gCTgWmky+YXYnfa5R62aawbFk=; b=MMh8KKEnQ5c+0aG3SwBgJwmH1DiUMpwahl6t6jD/E8jSy/lPnjCyzvP+pPYN06FvP5 m2ZLZzTI2Wm/BaS3HIH9BwXjRvtL/YZPt3yECqYLOWp2gJ7EoVw0NBrVHcYHvOfc5wEi GEbAjIHch9ghMzRYXdpc79lrSTN9CIzvfDVTF4OPyXIfrOXgf7iUZuaIqdAsXpTifofW bA8f8hVeyQ54WwUmbAwI0fDoHvKg94rD0vKRV2DdrukV9RIH+mbIqBz/qLzaci5n4k71 SHWsxM93lo1n23V9fwS4mCOP2yyth+Bfd7YwieOT/3R4xSWAES+dbZKblM7sVFtwDFix aXjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=itdUWKp0; 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 f26-20020a50fe1a000000b00457e6752422si1538392edt.189.2022.11.04.09.47.19; Fri, 04 Nov 2022 09:47:42 -0700 (PDT) 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=itdUWKp0; 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 S231795AbiKDQip (ORCPT + 99 others); Fri, 4 Nov 2022 12:38:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230127AbiKDQik (ORCPT ); Fri, 4 Nov 2022 12:38:40 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DE3D2E68D; Fri, 4 Nov 2022 09:38:38 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id BACF1C0007; Fri, 4 Nov 2022 16:38:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1667579917; 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=qX2H0ur2OnCIgQeP/+gCTgWmky+YXYnfa5R62aawbFk=; b=itdUWKp0OmmDnDJESvme0X3wZnc7hPuqS3zHyYW+2+mowPgKotWMs9TqhCdXNX0867vDSj AlDVLdR7YwdnvTMHWcBHP3HqhCpbFGD9P8/pDZLCOwYUCArMLneRHT4/aBnMCHqgIET3HU nAltOxSf2nXyu78KxUbEwHXGto/a27CoRB2MvdVtL01jryrnAotDVIbseMWxXN2xqSBcUX HCTTcCm9nwRDp1+2wXJmlabzelDqvGeE4lRILIIdldXHgRPJUQ7c3vd9d18I0rIrB3KsQm e+IOdAy7R3wqh120QlM5wKqxhhXJ/CBCmirCEeQZ3E7kGOLQLGWpmsUDkzNu3g== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Srinivas Kandagatla , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , , Bartosz Golaszewski , Christian Eggers , Cory Tusar , Miquel Raynal Subject: [PATCH v3 1/6] dt-bindings: nvmem: Fix example Date: Fri, 4 Nov 2022 17:38:28 +0100 Message-Id: <20221104163833.1289857-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221104163833.1289857-1-miquel.raynal@bootlin.com> References: <20221104163833.1289857-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, RCVD_IN_MSPIKE_H2,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?1748584851536188717?= X-GMAIL-MSGID: =?utf-8?q?1748584851536188717?= Despite not being listed nor required within the top level nvmem yaml file, the "compatible" property is mandatory and is actually enforced by all the nvmem provider bindings. Unfortunately, the lack of compatible in the nvmem.yaml to level description file lead to the example not matching anything and thus not being checked at all. Let's pick a compatible almost randomly (one which is already used with the qfprom label) to make the example at least valid on a semantic point of view and getting it checked. Signed-off-by: Miquel Raynal Acked-by: Rob Herring --- Documentation/devicetree/bindings/nvmem/nvmem.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml index 1eb22dba364c..0455506fc30f 100644 --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml @@ -67,6 +67,7 @@ examples: #include qfprom: eeprom@700000 { + compatible = "qcom,msm8974-qfprom", "qcom,qfprom"; #address-cells = <1>; #size-cells = <1>; reg = <0x00700000 0x100000>; From patchwork Fri Nov 4 16:38:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 15681 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp517910wru; Fri, 4 Nov 2022 09:47:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NCA4nnoVJFp0A0HilOysY1Bi89mt/L/dElrqn+BEj0/YQcQq5RnZXPUQU+dqxtzsQTSyC X-Received: by 2002:a63:2c4c:0:b0:434:e001:89fd with SMTP id s73-20020a632c4c000000b00434e00189fdmr31182014pgs.444.1667580448881; Fri, 04 Nov 2022 09:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667580448; cv=none; d=google.com; s=arc-20160816; b=NbnWDvkTWrfqpqWkapfZo5Fk3BL3fN/D79zp476cMnEJr1x/p+v+TQnysL0D+jkIV2 XRxbu+WXaQ31adf8Zp3euZNp6qp9XMssFtR5Y66wFawsVhNd27gutQhol6OrUFTA7Khh XdGuBLnrpRZWRV8oslWd04YqaXM3paRK7i0tVYxtp4xZJoguJmkVC2GKf07obI/remXM 5l6h8fU41CWetAE8iCpyH5tCVLcWnaMbK3mHRumidPmsF9ccfd0fA746mihPKF6oPeCL iSyYjPO18j0860wVrY7A2znlaXHIH7D9k5xjH35KQZXxV+mboSniWw8dWAMciwu0iw3A wO7A== 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=Y7ac4fOZHQ7SUo1nn2p1CG7GbIiygATMqWNoIUoS4RbpD8xtShPwS3CKXp2f9B9JHo EknV+iJoS9RiqXwQGIAFwDsifpf/1WbxQFwD/Gwpp0i84KJcaHDhEtsXi4FRcSWP3wl7 nVvUj5hB8Tcw6Fxj91b6EpMN/b0/3HgEUBjpVuRoPbONGEbN7RACk94E+HbNjCSiXyZ+ Wg1BmocNbXJxn97bBUYKnbM/hWiiQchUkqB6Lm8EbrbKn5i++nUFWb8w9XxBoK+eWTJ1 qD3mTRL1dbNpyKSP3ZPZQV43te9W87YoxbCiXtp7fE4ugSACbnFcoHg1OoLywVnMirIF urvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="DqU/oCr8"; 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 l15-20020a170903244f00b0018388edd187si6147317pls.56.2022.11.04.09.47.15; Fri, 04 Nov 2022 09:47:28 -0700 (PDT) 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="DqU/oCr8"; 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 S231848AbiKDQir (ORCPT + 99 others); Fri, 4 Nov 2022 12:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbiKDQik (ORCPT ); Fri, 4 Nov 2022 12:38:40 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 810E82EF5E; Fri, 4 Nov 2022 09:38:39 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 389D9C000D; Fri, 4 Nov 2022 16:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1667579918; 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=O4AM4lnV2gTii8655Tt65FHVrgfOcRYc0nYRGkNgVIU=; b=DqU/oCr8N0GTdjVft/L1DgvUTSld6b0y64b8fQwnjGFy4ty36q1VizpqfgH8oBFVCM9NwR GsrZSdlkvQ2faePej+qjegC+om6gU7PLqW1G6A5KTvMJ0d+/07IopJ7Z1Mh0tPJ89vVGMA Wbi28EL8rEVDAZslj4WTUlWB/DlN16zZmJXKmVJuMOe/avytQvVXqZceK/Z2YzRv9ptz6x 7Jc0YNHtAVbRYKpH1QRJKTYi3tA1EArKHtGFuub6K1I3Rz8eqI6mh7ywdPsT4ztzvlLX9D WnIVmCSbS+wRa1B5gQnPnz1uuMKDcSfjokG7XP8B155cS1WVbZewbkEiB3vKJw== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Srinivas Kandagatla , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , , Bartosz Golaszewski , Christian Eggers , Cory Tusar , Miquel Raynal Subject: [PATCH v3 2/6] dt-bindings: nvmem: Introduce the nvmem-layout container Date: Fri, 4 Nov 2022 17:38:29 +0100 Message-Id: <20221104163833.1289857-3-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221104163833.1289857-1-miquel.raynal@bootlin.com> References: <20221104163833.1289857-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, RCVD_IN_MSPIKE_H2,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?1748584837049454079?= X-GMAIL-MSGID: =?utf-8?q?1748584837049454079?= 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 --- .../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 Fri Nov 4 16:38:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 15684 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp518066wru; Fri, 4 Nov 2022 09:47:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7CZ8GIgoULuW9boDu6hC50GTxKsPy9bX874yZQZkaseElQzDjNjVRK2ypkOq/NOXzK8pSN X-Received: by 2002:a05:6402:528a:b0:454:8613:6560 with SMTP id en10-20020a056402528a00b0045486136560mr37717387edb.252.1667580474159; Fri, 04 Nov 2022 09:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667580474; cv=none; d=google.com; s=arc-20160816; b=y1uCsCIZc64pqcCWwH/0bWXruEKyfN+52zOmc4NGvKmnhynhw2aXsGt+VQuUsVFFyY qI3KqFc56t1XYDoqrTNxUYxx/FAVXNuswJalRV+UnN1AChGB8Vlhha4zreQeVTyaKrFv FkyVWR/1MhddJMtQMMO5RVF0AhvIkIsRo0Oo5zZ59stqK3bitgGQDW0oJE6rnuNIYChg GrvCJtcnErHeN91mJco6+i5YtEcJVv0VwHt5lR1YYyrY/aLGcmVYc4DSPkf6DEH0SQHq Dsq3BhpccNAhdtnpfMoYQOEsJJk3OpJrmRHBj6lcUo5rq1motpSlBZ+zz4QvfQobUemp 8yiw== 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=f9MHr3ZVLhQFUhLnDqkm+PvlKsWoLZOqfNvu0/+0Z4TyPeivnAvIs6TxkgUMezdaz2 kx6zQCBcT1r2zDgBtXB8IcykTgwbpwKhQ6IWWQ7uSO32MbuiZmSX1VPJazyHg0p8g9/U SXm1xFrlIGrnLN/YmVyLhu5jLJCj24kVI286aARI0Rl9v7v1B1IFPDgaek6VlEAvzZ19 AE49R9uW/ot/SLe6IHMyEHiJR2SmvxazHDXJTV8t4TwVDgsU6TKOUWCDvurSu6fCiQct jmFHD3S54U0/Kn2Vda30gG4VU5H578ZW+f9qT8Th0C9AfwSmJJc/jgpHmzp2ZPuDrUWH nbHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=n9oVsDaT; 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 sa30-20020a1709076d1e00b007ad812915c9si5658111ejc.581.2022.11.04.09.47.30; Fri, 04 Nov 2022 09:47:54 -0700 (PDT) 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=n9oVsDaT; 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 S231889AbiKDQjV (ORCPT + 99 others); Fri, 4 Nov 2022 12:39:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231752AbiKDQim (ORCPT ); Fri, 4 Nov 2022 12:38:42 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB17D25EA4; Fri, 4 Nov 2022 09:38:40 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 67D3BC0009; Fri, 4 Nov 2022 16:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1667579919; 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=/RuwsiKOoT3RSiv0ATWGMePKlt2FePql8/L/NJA2t6w=; b=n9oVsDaT4roOwYop7LYboPhnBKi8zEtj89MtGR9NiyT9IZ3gJZonBS3xoZfgIq1AKHJtC9 d7akW49OR4Tvgaaw0haHKSbNuuI+9IAOtL1v6WPfOuTB9DBHmyJeS8M8smfTNvPM6XbndT q6Hg/Dv/EwedvTSZxrtw2XNdjFflR93YyfHMlG/GnaTuotK8hXgsp4LauHF03M3R6gXxB1 ac3EqjkusVMfBJQhafOz4M9h6XstfGt8ZMQc0SK9Ev2tXVoj96Kxj3L9BDF46yCDhAtA5V HWlAZ/3Yj4GkjaUwZkPn64bEj/ooohClq8Bbdy/bLVLqaAcwxrpsT+UPXFAJpg== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Srinivas Kandagatla , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , , Bartosz Golaszewski , Christian Eggers , Cory Tusar , Miquel Raynal Subject: [PATCH v3 3/6] dt-bindings: eeprom: Inherit from nvmem.yaml Date: Fri, 4 Nov 2022 17:38:30 +0100 Message-Id: <20221104163833.1289857-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221104163833.1289857-1-miquel.raynal@bootlin.com> References: <20221104163833.1289857-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, RCVD_IN_MSPIKE_H2,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?1748584863267919384?= X-GMAIL-MSGID: =?utf-8?q?1748584863267919384?= 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 --- 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 Fri Nov 4 16:38:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 15683 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp518047wru; Fri, 4 Nov 2022 09:47:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Nu3ckxDPjm7LS4G93EdmtFDbMH7esdM8btSdkzbwKp4mgsZoo+myOOUBTP/9gyS/BZx4b X-Received: by 2002:a17:906:8442:b0:7ad:960b:ef61 with SMTP id e2-20020a170906844200b007ad960bef61mr36481176ejy.702.1667580470254; Fri, 04 Nov 2022 09:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667580470; cv=none; d=google.com; s=arc-20160816; b=DF3gtfLx6H1FWiBDLAFJ7R6D7B7V0/x3yLjl7Rh6GaMqkOetg3AI3i5sehjvuFIPfh xB3vP7yQ300qWaczKpKk30/bGMKbKU/XbzTVsr40mAXTT4K7hinfUG7Rb/Oa1BAQSFUL vy4rstlO9eITIr9/BwzNlCa03s8mTFckbzbFY8/JCX3lAtb93M7P6U+4XSbOoaW8PdM6 A5hXSkJq1UAdyGwt+iy5CxVnq8lAIu75/Vv+t0SuubnfG6BPpZLGjKziG24pFRMW+cbw cVV7YZkOoXV7X2xkCzIoN7p90JSG/G+AEeyVJT4WdXzntBCAUpvZbEVNHm42JC/UQHFB lL5A== 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=rtjRswIOq8noqd9T3XKP6UUSDNZ484aVeWXhWlQj5Cs=; b=Frzc7D13IVUzNtDDVrGhf8SOo1QLVxEmMLA3YA8Tiiq24OeUdOYwcjlDhjVSJXMq3z +Ay1EdVYsU3u9hPcy59ffMSn9+Ar0P9LaaO/0dc/va1pB/DRq4UuD518u5baH8JTNYg6 R06SxCt3O8AhBK0bCCth3MYFCbTUwrjZGXQl/A8e9Hbht8VCBWvydsLNgXhrlIDIGkvC GAmlU4YwbZbN9Uq3V2hVoZJwVBGDkPdyBrl+jFBU0buW3hy7ko0+WWb3+B1WgJAaf9Xq WVv9HcBwD5nWE17zipvpwQVk6MMKRd2NGzmHUN8xRF83BUQR63m2k6hSpDZzJT7Rwdk/ hg6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=p1J6hSqA; 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 u1-20020a1709064ac100b007adcee7d0d8si4488256ejt.406.2022.11.04.09.47.26; Fri, 04 Nov 2022 09:47:50 -0700 (PDT) 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=p1J6hSqA; 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 S231814AbiKDQjR (ORCPT + 99 others); Fri, 4 Nov 2022 12:39:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230182AbiKDQin (ORCPT ); Fri, 4 Nov 2022 12:38:43 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F274A2E68D; Fri, 4 Nov 2022 09:38:41 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id A56A1C000B; Fri, 4 Nov 2022 16:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1667579920; 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=rtjRswIOq8noqd9T3XKP6UUSDNZ484aVeWXhWlQj5Cs=; b=p1J6hSqAhkTv59g/d0BIgGxxVHpofbNs2lVIn2nCagcL/uWYUDqIO0eSmjU912RG2wgJAA mVAlBBZu9SlYZw6KbGVC8aMokv9TzDSGGR7SfRBMrQAQ4y16iX9I4wWhhCpwbrp/GVOwBL UcMMgMdZzfIKEGdVt4BiwHIPdTBCE8+pt7cv7G0u++8YH0/SCjr9mPUIRKWpZXkni6pcd7 Md9qw/f8VMxu/xPnFW/wJdHDgSotzeS28T4VwzhlPlTfadEbz2cWEXUggkTKADxegWHNM0 oyE71p0GFGYtWctGeaV3ynCiEtSFqaU8z2GmMJ1cMby5ZEYnz2HRhfyaxtJxjw== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Srinivas Kandagatla , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , , Bartosz Golaszewski , Christian Eggers , Cory Tusar , Miquel Raynal Subject: [PATCH v3 4/6] dt-bindings: nvmem: add YAML schema for the sl28 vpd layout Date: Fri, 4 Nov 2022 17:38:31 +0100 Message-Id: <20221104163833.1289857-5-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221104163833.1289857-1-miquel.raynal@bootlin.com> References: <20221104163833.1289857-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, RCVD_IN_MSPIKE_H2,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?1748584858670753936?= X-GMAIL-MSGID: =?utf-8?q?1748584858670753936?= 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 --- .../nvmem/layouts/kontron,sl28-vpd.yaml | 60 +++++++++++++++++++ .../bindings/nvmem/layouts/nvmem-layout.yaml | 3 + 2 files changed, 63 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..44088c8b4153 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/layouts/kontron,sl28-vpd.yaml @@ -0,0 +1,60 @@ +# 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. + +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 Fri Nov 4 16:38:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 15685 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp518091wru; Fri, 4 Nov 2022 09:47:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7InyPFDI9UNVW4TNH2VQC97wuOiDZ/LjastS7Y2FOGQKG5GhsRFeIVDtAnIJ7OGaRNhBZz X-Received: by 2002:a05:6402:50d4:b0:461:e349:56b2 with SMTP id h20-20020a05640250d400b00461e34956b2mr37256006edb.17.1667580478795; Fri, 04 Nov 2022 09:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667580478; cv=none; d=google.com; s=arc-20160816; b=JhkwatAckPPVjPgEr7cg49inkoanxuMmQ4WVq3Qyhxv+LeTt4Lv/OmWWKebg6YmJuY lLnS2G9lYMDFdwXNLXbJXVTzzBX9of4gf0zz5Oy09JBI3HPWAUhIU5Q38s0XzBdRO28h veJq5+C9hN3V2AbiwhcmvcO8OM+5Ye5z5C8qh8Qd2UD1YIvpm2ZJ/3VBiaav9pAXmST9 jmtsIkrDDHVyYFSVjAzJsxwa7Q0LT95tNaAxUPBf1/GIkWzcA5qIEQhT3wr293Q7Nt6R nN3fcjOT3FBuLvfsTEnOdSFGyyP1Jo/XyGg4yqhUdTnVf0dZphm2xPjZLNW1pvlpEhMd /C+Q== 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=jXE8Yd7CetSy7QOJHdmu79N0tlJs3DoFERx3MVN+JTBtqZ79MwbFYlhwfKDK3iB/gK t8PhV+L7Vb42oQPb5M9hhhBxDRmP5jAU755M4c9nRi7GIfwfL51+hyXPiBFZpmn3mz0m 217MgObMUxI3UzE8L0VztzTU9m8NrA4yA9t0MdWbPDnVW1zRZ9opLohaRfLNE0jEs5vM BsoKP5UVPa7C6dEksh5ubVhRyIaE4k1oaFspWomIQG+6kOxFtSmXSdA4fR1uVVgEPBlN +kRO+ZpBG1nLxgYF5A0etkiXflAeWwlefx6zejaPJv+f4WI06lEn5cFOYZw0/+aXXiVQ CRjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=SLh2eLlf; 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 o7-20020a056402038700b00457166171c6si235160edv.432.2022.11.04.09.47.35; Fri, 04 Nov 2022 09:47:58 -0700 (PDT) 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=SLh2eLlf; 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 S231929AbiKDQjZ (ORCPT + 99 others); Fri, 4 Nov 2022 12:39:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231820AbiKDQiq (ORCPT ); Fri, 4 Nov 2022 12:38:46 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CBCA31225; Fri, 4 Nov 2022 09:38:43 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id DB6B3C0011; Fri, 4 Nov 2022 16:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1667579922; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PH1TaWI18OK/TWX9eI82Zyj07sQxLoh1aLVV4ESIk3Q=; b=SLh2eLlfTwj2dq8weIWYhj9eufTMcwyCVjLoNGaJy0mY3UKlduSu6IfqCJABSeyVD/40Co Dn/v8MmHHvRigdRxEdWOMTv1myK7fp3FJB+8EcKQNY0CPzVHcECfV4HFuBaP68yCRURLdh ISSrMP2LYlfAakrpBdn2eGFfvmu+SRxqcEjw1+Re4H5NOTmqNUu3KZq4p5UXK/a+eyasYe iNQdFn2wRQBlsmGr++iKEFHeyMHQUi1qqf2ePQ45xlJdyn9yxTNOonlSDjCA1XidJa2Yg2 AQ2PyFoMIwgVzqCNrJXuwoSjtAZiHZdCQUQUuOl2tcYN+NiQSEgg8ydgBIud9w== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Srinivas Kandagatla , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , , Bartosz Golaszewski , Christian Eggers , Cory Tusar , Miquel Raynal , Rob Herring Subject: [PATCH v3 5/6] dt-bindings: vendor-prefixes: Add ONIE Date: Fri, 4 Nov 2022 17:38:32 +0100 Message-Id: <20221104163833.1289857-6-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221104163833.1289857-1-miquel.raynal@bootlin.com> References: <20221104163833.1289857-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, RCVD_IN_MSPIKE_H2,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?1748584868201323031?= X-GMAIL-MSGID: =?utf-8?q?1748584868201323031?= 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 Fri Nov 4 16:38:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 15687 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp518157wru; Fri, 4 Nov 2022 09:48:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NRebAUW46zquc8B85YGUkbfn4MVR2b4eY9IU2hSWPGtX3pz7jCBlLSnMZeSuendRbK8F8 X-Received: by 2002:a17:906:6990:b0:7ad:e20f:c405 with SMTP id i16-20020a170906699000b007ade20fc405mr23203085ejr.390.1667580487064; Fri, 04 Nov 2022 09:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667580487; cv=none; d=google.com; s=arc-20160816; b=E8jc6eJRFHYg5I0CD2SSXhBkHMatxbBsI5y6uCVVC91mP8e7D6RkDzJDTrtCZXuXCe r4GFSOWCg1Wu5T+L13r2u9AvXaPUIhJNIbLyLIPOa95iADzRFNT3TvIe9R3w7YTj1d5m P5ViHfvSSyL9fEkNa9De+Y2gkCCGjYVCxmqiwz09sQYLoJUUKKer3aau4bGmbEiLXvPg ts2cBzyeMDgQMdjnwd7y0YSlC7be+evg9VIyaAzsQqlhLb/GfHMuWQi696JVKm7ousGw H0OMjVRHrXzoIcBS9Fayw0pZD6JRXgQQ8ND9t3uBOyhhq/eyeMXvCg3+mbO+hpIyB8dc QEDg== 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=+IAKdycEjB3JSBVjZSTycHnanjluSD4CNhAulpC1qcM=; b=UGqqFPNCdaYH1mIyvggKge/lMmBMfpw7y/2XFJYeBoAlZA/C4ma6IBli6XhgZPcIS3 0xQ+NrijbDqCGGY8lxZC7HCMqAQ37ql51S7jFpSMu6H1Wvibsbliprh8Iii+kuAOnKLh dyUzqXt7feuinpd7ulXjfAst/aMNCQ2iYtwMYBASJthAjoZGO5nltWSvfKvF4/ddrTMB xh3dGlbW4Uji20Ak9s7wlJCtnqfmI0duy7ajj606TSwtpuja4L98y/f+poQgZtJ7FsIX QKoqTntgSGPGdvjLgLAd61eKPaNbdyRMT8ez+G4Kyp5WPDxl/7m5BBcCmAby2F1FtloH pCkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="li/4x+t9"; 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 p20-20020a1709060dd400b00782c6ab6f01si3984441eji.410.2022.11.04.09.47.42; Fri, 04 Nov 2022 09:48:07 -0700 (PDT) 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="li/4x+t9"; 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 S230474AbiKDQj1 (ORCPT + 99 others); Fri, 4 Nov 2022 12:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231844AbiKDQir (ORCPT ); Fri, 4 Nov 2022 12:38:47 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 958952E68D; Fri, 4 Nov 2022 09:38:44 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 3E999C000E; Fri, 4 Nov 2022 16:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1667579923; 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=+IAKdycEjB3JSBVjZSTycHnanjluSD4CNhAulpC1qcM=; b=li/4x+t9JqVt/eqjBbXqkyPTrk/zyd+3f2YWAKuTLw56hokHnO6zCEavs/7/GKTe2Tlwtu OwM8suBPNdfWZKU58reA1Q5ZBachcHcTtpQ5epx9AWNoRi/UfgzDnOvzorN1kxf8Vu7hsJ 9UBeGDkzybqSeESNV4DBZEjjMAz2GhI9S1G4NqneiOIqF5VLo90ZfRCjQxtAluNa5afj+5 W2HeJ7eZ5dp/BOF1nQ6EpXQ+1Ye6ODhuvqeCBeFbnW5zIaiRvBuBxniY3+yH6pVQ4Wfofp U9Epm0S7Z21HkSCd/fyiuOmKrtlTHmvVI1aQwIUx/VZKeg3Z2czZNYbnTkTKlw== From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Srinivas Kandagatla , , Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , , Bartosz Golaszewski , Christian Eggers , Cory Tusar , Miquel Raynal Subject: [PATCH v3 6/6] dt-bindings: nvmem: add YAML schema for the ONIE tlv layout Date: Fri, 4 Nov 2022 17:38:33 +0100 Message-Id: <20221104163833.1289857-7-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221104163833.1289857-1-miquel.raynal@bootlin.com> References: <20221104163833.1289857-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, RCVD_IN_MSPIKE_H2,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?1748584876381550317?= X-GMAIL-MSGID: =?utf-8?q?1748584876381550317?= Add a schema for the ONIE tlv NVMEM layout that can be found on any ONIE compatible networking device. Signed-off-by: Miquel Raynal --- .../bindings/nvmem/layouts/nvmem-layout.yaml | 1 + .../nvmem/layouts/onie,tlv-layout.yaml | 115 ++++++++++++++++++ 2 files changed, 116 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..1d91277324ac --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/layouts/onie,tlv-layout.yaml @@ -0,0 +1,115 @@ +# 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. + +properties: + compatible: + const: onie,tlv-layout + + product-name: true + + part-number: true + + serial-number: true + + 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: true + + device-version: true + + label-revision: true + + platforn-name: true + + onie-version: true + + num-macs: true + + manufacturer: true + + country-code: true + + vendor: true + + diag-version: true + + service-tag: true + + vendor-extension: true + +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>; + }; + }; + }; + }; + }; +...