From mboxrd@z Thu Jan 1 00:00:00 1970 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 51ABEC433FE for ; Thu, 10 Nov 2022 14:07: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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DXnGeH0guRYZJD9/cbFagq2qbIZ7VStRj1fdHwOYGqQ=; b=WPCWVHJ6m7xdLM wW/TZh7AYsnCL4NlmIAzFFDpo7JTCx8u6m5AhNd0v01aGw/B2RbcvfVF9wfr5SnPJRAqmYMrJGseZ apfV2UWZxwTAupZ3ewMdyCu1bCFlMCRQdjp1kbGF9k247uXaMHoGWwMMcw4+uooRHHew2n+LpFV0M 1nhFmMc61eDqmb9/mRuZCSiBedDza0lCpn3dRwrfGdeUt5K2SX5uDrIBxI0j8gqSonCQw185UNv2a Ueno5NHbErVz83TV++AGhzMj8XtJSv9+7z6u2GPXs9Jev5bHQjZa3wb3vPXrQJj5wARWutSflXtn8 k6qWwDdtGIVkc6+BjCZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ot8Bk-006FBZ-Er; Thu, 10 Nov 2022 14:05:52 +0000 Received: from mail-ot1-f46.google.com ([209.85.210.46]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ot8Bg-006F9O-IT for linux-arm-kernel@lists.infradead.org; Thu, 10 Nov 2022 14:05:50 +0000 Received: by mail-ot1-f46.google.com with SMTP id 94-20020a9d0067000000b0066c8d13a33dso1138988ota.12 for ; Thu, 10 Nov 2022 06:05:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=SOZURf1rNwc3a/P6g5eCp63zwBi6WOS8mU3DMBFslXc=; b=lvdO25zYxapLWgjS57wpMG054kQ62J0AR8TcPs1jss7u8hO5FVru5ooODG63vnASRz bBpxju7C44P7A9RXL4ghhMAT3fafsth9vwZKZW/9lAmDzNoOchIWIs7GOcAsx5kAT78B WE8j50sORAwd9Ak8OOW7wyL9jaetUVx7Th9zY/LryuqAVLIvq9RbB4DahbL1UEAnOXH5 KJzCgnHCnU50PcriOd7uc6ArzbgL2iF2dcIwBSfnVF5dqrVPAxU+KIG+lobaJC6DeXUj d+bbUiLY1IL16esYCrR0tFeXfVQyTJt17GHwQCQPk1BAy+z83SJOGgnLy/gp2utKuuRH onWg== X-Gm-Message-State: ACrzQf3txw1df86pKhI1tmZwfBaVdxAksUchxe4qC4Z/aXLsTVSogTxE A2aUYrN/7tlpviJme8OhNA== X-Google-Smtp-Source: AMsMyM7riFDmy8iAvwWMHq5A9Ozuew2LUgztFrHrpOF9ybb5AN+vyazkFQqfB5NU1iVCZF+AE+FCWg== X-Received: by 2002:a05:6830:4113:b0:66c:3b12:82ab with SMTP id w19-20020a056830411300b0066c3b1282abmr31196465ott.172.1668089144035; Thu, 10 Nov 2022 06:05:44 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id g81-20020a9d12d7000000b0066c44b4f2d6sm6534981otg.43.2022.11.10.06.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 06:05:43 -0800 (PST) Received: (nullmailer pid 240905 invoked by uid 1000); Thu, 10 Nov 2022 14:05:45 -0000 Date: Thu, 10 Nov 2022 08:05:45 -0600 From: Rob Herring To: Miquel Raynal Cc: Krzysztof Kozlowski , devicetree@vger.kernel.org, Srinivas Kandagatla , linux-kernel@vger.kernel.org, Robert Marko , Luka Perkov , Thomas Petazzoni , Michael Walle , linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski , Christian Eggers , Cory Tusar Subject: Re: [PATCH v3 6/6] dt-bindings: nvmem: add YAML schema for the ONIE tlv layout Message-ID: <20221110140545.GA221642-robh@kernel.org> References: <20221104163833.1289857-1-miquel.raynal@bootlin.com> <20221104163833.1289857-7-miquel.raynal@bootlin.com> <20221110040055.GA3436769-robh@kernel.org> <20221110095034.7a80163a@xps-13> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221110095034.7a80163a@xps-13> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221110_060548_635113_82DFCD9E X-CRM114-Status: GOOD ( 27.42 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 10, 2022 at 09:50:34AM +0100, Miquel Raynal wrote: > Hi Rob, > > robh@kernel.org wrote on Wed, 9 Nov 2022 22:00:55 -0600: > > > On Fri, Nov 04, 2022 at 05:38:33PM +0100, Miquel Raynal wrote: > > > 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 > > > > This is a node? If so, you need: > > > > type: object > > additionalProperties: false > > I thought referencing a schema under a property would be enough? > > Indeed in nvmem.yaml we create the property nvmem-layout and make it > reference nvmem-layout.yaml. Then, in nvmem-layout.yaml: > > oneOf: > - $ref: kontron,sl28-vpd.yaml > - $ref: onie,tlv-layout.yaml > > we reference the different layouts that may apply (very much like what > you proposed to list the mtd partition parsers, if I got it right). > > Isn't it enough? No. It is enough to allow the property, but nothing defines what it must be (a node) and what the node contains in the case of empty nodes. Try adding 'product-name = "foo";' and it won't warn. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel