From patchwork Sat Apr 9 12:26:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mikhail Zhilkin X-Patchwork-Id: 1615246 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=WOVQGXcq; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=l85U+/e7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbDs00tctz9sCq for ; Sat, 9 Apr 2022 22:27:16 +1000 (AEST) 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:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qaV/4uY5RqXl0KUYh+4uGeUohRqWTZ7sLnYXK1u3DWs=; b=WOVQGXcqqxukCX xXBrOnXzyCoscM0KAa3lvnKrSouYO41PrQoygflV8JdC4tQoJjRW3iAOAcGAHv3ZRzFCqTuSrfeAZ rRy4bqaHKMfFlP/ZEPX7TmkX8N8Jl79DzjK61DHQ1FAeVZKqDKysmsb3XNYwQv4HIPoiP91SKf8Um T81ayh7pNj/NajStN1S/A6EzxsrqsAFh2WKVBbxNlXCU5ShNlkAJBkVe/cpRfwfi9mtd6JFzDJLji Y0Hlmr5XbFTQd2Bn2G+JaQKiBxYaaVs/9tLgy9l+N0UdEaaAuoX31RD8Mkl4tirtjuIkDzMHR1Juj gR96NnHSAaLoV8bKWERA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndAAl-00365A-2q; Sat, 09 Apr 2022 12:26:35 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndAAi-00363y-9g for linux-mtd@lists.infradead.org; Sat, 09 Apr 2022 12:26:34 +0000 Received: by mail-ej1-x636.google.com with SMTP id n6so22027225ejc.13 for ; Sat, 09 Apr 2022 05:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=7lfQcIbfBOc571bYYHEBdw9+NesBxMLEAHBRpYUsHpM=; b=l85U+/e7//bKcpyGvLxrG1yhyKHxmr8w0SZGTNL3wt/aXsU+h+Fhpm9g9IMKCaHddY wD6KZlCzZNLezOg0axwRxV+qooDNxnYLncy3DrXj6o/Xu/2ap33MEq206G9/KRr3VFIT CofDszGEYpnaQaFCqS6XHFR5ODJyrYoHaTmXqWK5SvRCJkWXhda0LQCAFvtLy7mnjHI7 VyqzivHW8A6JGrVbdDHb1ahA39OpC/CcYqIM5nXqPSNE0SpKtRkgHm0SDquqopv/FgIL wnjmEjwZ40OJSEf3Xy5xNQzIfIxV4DjIKuQt7tXnnegW8rnzxliv2KIFqMcRZ1KHCGz4 DQ4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=7lfQcIbfBOc571bYYHEBdw9+NesBxMLEAHBRpYUsHpM=; b=SHZ7qPxJHn/3dOYoKyFHcmYML0d19NhlBNkVVmv8REVKwKbuAxuVKz+iqZ+7GdaUwG nUvE7ArES5moRGS0RxzKV5Y+TOReon6pBBKAFxTW3W6gncoumfnZUJDIGBNRrT7S1NkD RKwg8MZHmH5AcPlwj6InUpsDROu8R3NKfA17Ql7yTcBNdslAmCzifcku8nu2sgo4To2s +jbVaHVPqLEs+jo8BzycWaALUI2ylMsuBNd2E+MFFZmxvFvi90CeO/uV4BlVOdTU+Q4H BDCaZjFFnyv7z5ApUWHmX764W3aUQRWM2ITqpjREy140cTrBJCfl1mPIN2fgFJRSpxcW OoEA== X-Gm-Message-State: AOAM532LFUPDHUccRWJlpg6yu4oxIYiOWKgHCiRChQzK4xQJ/MrtRRtP pxJFSRzufZT90DyitfYbE5akP3Uy32uhKMfJ4i8= X-Google-Smtp-Source: ABdhPJxSTnOEszZHgvZHGQfO9wFH+eqKR2uXs4Rx7bKoPu19YS1mecM/8PT8N6e3NVhq+hel+fkK2g== X-Received: by 2002:a17:906:e28a:b0:6d6:e2e9:d39d with SMTP id gg10-20020a170906e28a00b006d6e2e9d39dmr22135072ejb.2.1649507186790; Sat, 09 Apr 2022 05:26:26 -0700 (PDT) Received: from ?IPV6:2001:470:9898:9eac:f1cb:6e16:4fc0:c830? ([2a09:bac0:87::815:6e3d]) by smtp.gmail.com with ESMTPSA id hs12-20020a1709073e8c00b006dfd8074d27sm9526982ejc.79.2022.04.09.05.26.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Apr 2022 05:26:26 -0700 (PDT) Message-ID: <57bebf2f-af4c-b2d9-10e5-19e5104946fb@gmail.com> Date: Sat, 9 Apr 2022 15:26:25 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: [PATCH v2 1/2] dt-bindings: mtd: partitions: Add binding for Sercomm parser Content-Language: en-US To: Krzysztof Kozlowski , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski Cc: NOGUCHI Hiroshi , Karim , M , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20220406195557.1956-1-csharper2005@gmail.com> <20220406195946.2019-1-csharper2005@gmail.com> <8d0d8b27-35ff-3693-cf80-897b80c26b4e@linaro.org> From: Mikhail Zhilkin In-Reply-To: <8d0d8b27-35ff-3693-cf80-897b80c26b4e@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220409_052632_365244_0DD97C4A X-CRM114-Status: GOOD ( 22.32 ) X-Spam-Score: 0.1 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello Krzysztof, On 4/7/2022 10:48 AM, Krzysztof Kozlowski wrote: (...) Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:636 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [csharper2005[at]gmail.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [csharper2005[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hello Krzysztof, On 4/7/2022 10:48 AM, Krzysztof Kozlowski wrote: (...) >> +properties: >> + compatible: >> + const: sercomm,sc-partitions >> + >> + scpart-id: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: Partition id in Sercomm partition map > Do you really need it? The reg should define the order, unless you > expect some incomplete partition list? > > In any case this requires vendor prefix. I'm not sure that "scpart-id" is necessary here. "sercomm,sc-partitions" is necessary. I'm going to add vendor prefix in a separate patch. Is this ok? ---  Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++  1 file changed, 2 insertions(+) +++ b/Documentation/devicetree/bindings/mtd/partitions/sercomm,sc-partitions.yaml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/partitions/sercomm,sc-partitions.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sercomm Partitions + +description: | +  Sercomm is one of hardware manufacturers providing SoCs used in home routers. +  The Sercomm partition map table contains information about non-standard +  partition offsets and sizes (depending on the bad blocks presence and their +  locations). Partition map is used by many Sercomm-based Ralink devices +  (e.g. Beeline, Netgear). + +maintainers: +  - Mikhail Zhilkin + +properties: +  compatible: +    const: sercomm,sc-partitions + +  "#address-cells": true + +  "#size-cells": true + +required: +  - "#address-cells" +  - "#size-cells" + +additionalProperties: true + +examples: +  - | +    partitions { +        compatible = "sercomm,sc-partitions"; +        #address-cells = <1>; +        #size-cells = <1>; + +        partition@0 { +            label = "u-boot"; +            reg = <0x0 0x100000>; +            scpart-id = <0>; +            read-only; +        }; + +        partition@100000 { +            label = "dynamic partition map"; +            reg = <0x100000 0x100000>; +            scpart-id = <1>; +        }; + +        factory: partition@200000 { +            label = "Factory"; +            reg = <0x200000 0x100000>; +            scpart-id = <2>; +            read-only; + +            compatible = "nvmem-cells"; +            #address-cells = <1>; +            #size-cells = <1>; + +            macaddr_factory_21000: macaddr@21000 { +                reg = <0x21000 0x6>; +            }; +        }; + +        /* ... */ + +    }; diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 01430973ecec..65ff22364fb3 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1082,6 +1082,8 @@ patternProperties:      description: Sensirion AG    "^sensortek,.*":      description: Sensortek Technology Corporation +  "^sercomm,.*": +    description: Sercomm (Suzhou) Corporation    "^sff,.*":      description: Small Form Factor Committee    "^sgd,.*": -- >> + >> +required: >> + - compatible > Missing reg. reg isn't required. Parser can read partition offsets and sizes from SC PART MAP table. Or do you mean something else?  All is ok without reg definition in "Example" (except the warns that reg property is missing). > Are you sure that you tested your bindings? You miss here address/size > cells and children, so you should have big fat warning. > > Plus your DTS example has error and does not compile... Whole dts, for the real device (not for example), was tested many times. Thank you for your feedback! I checked the another examples and there are no any warnings now. But I'm not yet sure that "properties" and "required" are correct. What do you think (or what else I have to read / check)? ---  .../mtd/partitions/sercomm,sc-partitions.yaml | 70 +++++++++++++++++++  1 file changed, 70 insertions(+)  create mode 100644 Documentation/devicetree/bindings/mtd/partitions/sercomm,sc-partitions.yaml diff --git a/Documentation/devicetree/bindings/mtd/partitions/sercomm,sc-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/sercomm,sc-partitions.yaml new file mode 100644 index 000000000000..cb171a0383aa --- /dev/null