From patchwork Fri Oct 28 09:23:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 12174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp718737wru; Fri, 28 Oct 2022 02:26:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4aUIudawDvIABvdIyAqkRy8P5a0HidoTMiKk82LAkodSWMzM1nHDAGSqGsX6R4NJzIJsIw X-Received: by 2002:a63:1923:0:b0:441:2c12:f704 with SMTP id z35-20020a631923000000b004412c12f704mr47009414pgl.398.1666949208185; Fri, 28 Oct 2022 02:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666949208; cv=none; d=google.com; s=arc-20160816; b=rYT8CSqOOTNNGMIMoxU7sMWdpGco2vtW8pyabVDRNKsMYtawmPhhA9cijqW3mkGoq9 5H4mDSj/+mMVhoBJt99HN2OgaWW6sa1ZsAwu+vJ3awiANvMqSOCiwbro38HldDV6Cyx/ ASyutIOmbi/2fErdtkWrMwQ1xvyGWZMmgyQH2coPYjkNLHEDXbUZp5/sXLY+I+R3yNk6 elafjyMY4c6QbTlnPsD0uDAfTrUiCOOqZRdvIA9h55in7ocnNNibiIcrWE6pIxfkDkwQ +HsHtsI9ZxYZ8VaA8MfcnIorXS8zJjT07273AqXOJwebIGK7xqY3IN65gFeRKt/z1dyA C6JA== 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=MZ/yZgTa81hnw0HFvxGrTGClMz2ZbHdXcriFnwHnOiY=; b=aOKR6H0JKHMaKXO9R65ikmEBdU3zJPddzMlgI9MmCQTv45yen3KKqHBjzuu65cYUlf l2LTfl6RHg6KS9Y14vGGTEveIc7k4b6vnnz0mI+L3UBthAX0db07KpyDxN7SdICEUz5u HehBkfyttbMnHgu7yv4ndE3G92jRpLQZTvwV87Q5V5onypt85cZHJWKs3IacEBdlxfz1 oCH60hIYISDGpm7+O6isndiORkn4+2ytxMT8k7TDZNsvHsNUbtC172zfEmM/zC+TxdQE fotOXW2LzShbeR9YJxwhOQjDlCxjCXKayFeoQjprxAFqKYZt2zGepV3Ey69pGCM3KiXq lfCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=i7ZnyCOs; 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 g14-20020a63fa4e000000b0046004f18c6csi5170520pgk.456.2022.10.28.02.26.35; Fri, 28 Oct 2022 02:26:48 -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=i7ZnyCOs; 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 S229980AbiJ1JXw (ORCPT + 99 others); Fri, 28 Oct 2022 05:23:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbiJ1JXq (ORCPT ); Fri, 28 Oct 2022 05:23:46 -0400 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ECBF1C5A44; Fri, 28 Oct 2022 02:23:45 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 74CD610000F; Fri, 28 Oct 2022 09:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1666949024; 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=MZ/yZgTa81hnw0HFvxGrTGClMz2ZbHdXcriFnwHnOiY=; b=i7ZnyCOsiLCqD552SFIgCXU24QxcRIL4DmvTxIl6B/HkA02h0XOVyxFfcPBq/APLZfoUEz Wbk6GJ5S5jGHO3UcOiPn+o1V2OLbeSrc52eJdlCeaOTdU3wWlRFwDqINCy0g8Xdt/Gn80B IC8RfqRL//NKLDfBQc537fZGIoTd2G4beS64yzSpstN+qekRe4FXnyES01qmeNw1dBZz8i iCTrkTKt6+jHVhbNg5XF+fNgB4CRBK1ujxPDr4lVI2Xx5ffCQESPqyDQBn2ovUPylDor09 HxTk4LNhiwaaaGM9+aI8pf+WDPuJsDZbAWgI8M/jnv2qjbiZuIVwrzLfU9Zigw== From: Miquel Raynal To: Srinivas Kandagatla , , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Marcin Wojtas , Russell King , Maxime Chevallier , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org, Robert Marko , Thomas Petazzoni , Michael Walle , Miquel Raynal Subject: [PATCH 2/5] dt-bindings: nvmem: add YAML schema for the ONIE tlv layout Date: Fri, 28 Oct 2022 11:23:34 +0200 Message-Id: <20221028092337.822840-3-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221028092337.822840-1-miquel.raynal@bootlin.com> References: <20221028092337.822840-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?1747922933037327282?= X-GMAIL-MSGID: =?utf-8?q?1747922933037327282?= Add a schema for the ONIE tlv NVMEM layout that can be found on any ONIE compatible networking device. Signed-off-by: Miquel Raynal --- .../nvmem/layouts/onie,tlv-layout.yaml | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/layouts/onie,tlv-layout.yaml 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..388547d46646 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/layouts/onie,tlv-layout.yaml @@ -0,0 +1,96 @@ +# 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. + +allOf: + - $ref: "../nvmem.yaml#" + +select: + properties: + compatible: + contains: + const: onie,tlv-layout + required: + - compatible + +properties: + compatible: true + + 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: + - | + onie { + compatible = "onie,tlv-layout", "vendor,device"; + + serial_number: serial-number { + }; + + mac_address: mac-address { + #nvmem-cell-cells = <1>; + }; + }; + +...