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: 13032351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE322C433FE for ; Fri, 4 Nov 2022 16:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FCprAzc8hh5eNbvnHKdNc1xUsoDAZPlw7Pxf+xcZFxw=; b=xiKin9tOFEESSY k6iDQ3TM2Sb92w6kq18rcAEs9XnX0t4ooIgsA6i3dwzpFPC6Qsp1CBp7pRb2Du3WOX26iMUoDrWKL HDdGTyfvCEQ+5kRjfQQkuAOVH0f8Q4wzxPwpJ98Rm+ivnRvTW2ZsJcZvC/xG03MuV1rvTiVHA1KvT LEdVSiLuMofggXgJiG+mUFfcygWoJMNfWZUZQvZzHFuzqeNCkya6bQi+/awyJIg+/zJiCiKR1Kqqv W5OvEhlcjxXwOQ7l25bQoNs0d2wFKUK/TbIUsONYWn2s7DA7DZeKqkGfdEFv7tJ+3iB7wGrDtZ502 OFbQsQ6LkXgMG+JZoDMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqziO-004SCG-QF; Fri, 04 Nov 2022 16:38:44 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqziL-004S9M-QV for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2022 16:38:42 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221104_093842_031577_B26816B8 X-CRM114-Status: UNSURE ( 9.53 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13032354 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9067DC4332F for ; Fri, 4 Nov 2022 16:40:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gCGh4Kzi5nRns1CfM91Dn8DZoriDcNirTXynKt2oPAY=; b=S/FaK/woqnqWMT dTVCGZTBNOQShGSfDV/TkCugeynKnovGuiVd43EH7kxTtyVVziHUo+2Np0uQobg9hngF7oT+k4e0o ImnB5IxNpKSutIMc7nWWoGHZ7Tl46o7la7tqNz0FGhTvAWa6+dH7MYOkBMPn/TdvxxW10KX6uLJHO NTWdfWJ3xrATpkstui/WbBY/60DA0HI28eYR1esCZHoIiDiSApWwjZ/5XPTT2Sv2h82UQoq725CAb f9AJ/TPA1sWq+Ix1WhaJsI9VMGVGgsLquBq3kWK56SQn8VQ7tpW3Www+NIGQWpLPmSQvglzTBTY5z 8LuLQyGpczr34VCq5eFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqzio-004SKU-Fk; Fri, 04 Nov 2022 16:39:10 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqziM-004S9b-H8 for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2022 16:38:44 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221104_093842_875592_3EA48C41 X-CRM114-Status: GOOD ( 16.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13032352 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE3BBC4332F for ; Fri, 4 Nov 2022 16:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=a415vKvhLnK7vTKAOdjG60996I40l3jTPCO/RO2X9rM=; b=wsfC/If6Mnwwfk gPbjcbb0YkkrYhJy3cmmWE50NvgXeyEFHUw0lVqdGrVTGR/8g0k7WN9/KicEq4pY4UhfUVKe9GxH4 pvzfYfhfgcdFNGgRmykbK0GGPUSfZRg/QKDcsSmPSQjA3ubaIKiYuHVwrn3aIsulA7M7gkDaINwM4 0YgwaCm5pXYV1IRCCSmUYjZ8IzAgo2epIbFKw+wJggBch6ML3polw9VIP606j1BIGYauqZuz4VbkH Tazm/vYXH0VYfRQQeLjW3ZW0hQINBIm4hmliIKORyyQmNtnN/4LG4GWlZhFHSoMKYM7a31UXQTyot FV3gOgyxAWBNrbF97VLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqziX-004SFE-TB; Fri, 04 Nov 2022 16:38:54 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqziM-004S9n-FQ for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2022 16:38:43 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221104_093842_858611_B7A4ABA7 X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13032353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83900C4332F for ; Fri, 4 Nov 2022 16:40:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=isy1rBkJY547lrBOP6Q6AyPyAw8Q/1zjXL45wVeLsEs=; b=ZSkXVlIKZz48x2 bMWeqZ45a2SJbav348tazdVlRciyrmF1fOPnOOc7sZxflTgcRS/GNSzLZq6semBTmsSleXCu0QG9v R9PrmQSZPSD1tAa325SKqaE/X+rwvtYZBLdl0rmBa2mgZj8QEvnW0D/cf48F30jBzkqjENleXk3H3 DRSvW3k1OgyJtRiu5WGb5cMyta6HJYIYXVP8mVLhOOnaJb7uO+YTF7oCYO3B7qv8a23Cl6F54IVtd wEGqkkgbrnVQ7Y+ASnZ6Vl6h0+nWh954kI+wd2pcw/fqMkIh9mkdI052bIlyMknG0KV0PoumpVSHC eTBBd+TEV8tr7kTAcxnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqzig-004SHg-B4; Fri, 04 Nov 2022 16:39:02 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqziM-004S9r-3S for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2022 16:38:44 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221104_093842_436562_55CC6CF6 X-CRM114-Status: GOOD ( 15.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13032356 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AF132C433FE for ; Fri, 4 Nov 2022 16:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4tWS2uF1CHbHWAlvLEn545y/Yi6bGBKbLq5in4OgZTI=; b=GKRimR60EkOWxz l6IMJXxlouAwQeoJJreJCkQcPkzalmLpC7hQWS6QlVSIQSZuq7i45fftkJ+m799VEU+SvsWCzF4kH 4pQq748zwNEOKJBMLKgqxc33Kt/zBt00IMRt3NHGsRvHYGH1wTGR9LTAb+WhjTJYcz9wOI5atQzzt T46KYLfgAs4Hb/RVopevSavNHOcEK6EHemkS/ujcHXKAGfP1oa7tl+f2Afx9fzQGQI1crKSnBMKee r+/LdVzSB2qinXC/MBJwLNpt3jZ5y9TPubhIFj5ekBZqJ0nGn26L4nsaazOB6y4+o4LAJogP93eto GCJRSHCCmhThwZlRiIpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqzj9-004STE-4I; Fri, 04 Nov 2022 16:39:31 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqziN-004SAf-DN for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2022 16:38:49 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221104_093843_605266_D5E929A8 X-CRM114-Status: GOOD ( 10.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13032357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDFFAC4332F for ; Fri, 4 Nov 2022 16:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RpLXG4dkgkOIYozPRM8nOqbsTkkIaHoBpshH0GliVHI=; b=v4eflUs/SuRAYs iXqjx2bQ+UE1cFFnSYX6Y1Jfc5oVCxCGKkQJczWQMftRARjJZQfF++HcrP9pDrPswMgHpeHSRpIsu 5FNUB8w/HyV6u19b/IonWJIn+fWpvjrnt3ged4WcozlCC2qdP2DMHIUXsAuj2awK+iSKJk0bjGaIR U7c5VXcmKjaOymXE52Lg9BW/fF4oxo5ZUc59ru/4FyBBpXtdJY/ZXY+uxAZCsrBxNH4YulJe6XvGd KS1EG0ihGkcdl+pTued6QJytl3ZJ6RlnmWNwIAaBMx7Q+8igbw62CDFD/coUJwj4omNBehUwBRddP 3U0EQg2kxBAg5kZIelBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqzjM-004SZn-Gh; Fri, 04 Nov 2022 16:39:44 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqziQ-004SCL-Oe for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2022 16:38:52 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221104_093847_197495_1C9212BD X-CRM114-Status: GOOD ( 14.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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>; + }; + }; + }; + }; + }; +...