All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mikhail Zhilkin <csharper2005@gmail.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: NOGUCHI Hiroshi <drvlabo@gmail.com>, Karim <Karimdplay@gmail.com>,
	M <x1@disroot.org>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: [PATCH v2 1/2] dt-bindings: mtd: partitions: Add binding for Sercomm parser
Date: Sat, 9 Apr 2022 15:26:25 +0300	[thread overview]
Message-ID: <57bebf2f-af4c-b2d9-10e5-19e5104946fb@gmail.com> (raw)
In-Reply-To: <8d0d8b27-35ff-3693-cf80-897b80c26b4e@linaro.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(+)

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
+++
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 <csharper2005@gmail.com>
+
+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>;
+            };
+        };
+
+        /* ... */
+
+    };
-- 

> Best regards,
> Krzysztof

Best regards,
Mikhail


WARNING: multiple messages have this Message-ID (diff)
From: Mikhail Zhilkin <csharper2005@gmail.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: NOGUCHI Hiroshi <drvlabo@gmail.com>, Karim <Karimdplay@gmail.com>,
	M <x1@disroot.org>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: [PATCH v2 1/2] dt-bindings: mtd: partitions: Add binding for Sercomm parser
Date: Sat, 9 Apr 2022 15:26:25 +0300	[thread overview]
Message-ID: <57bebf2f-af4c-b2d9-10e5-19e5104946fb@gmail.com> (raw)
In-Reply-To: <8d0d8b27-35ff-3693-cf80-897b80c26b4e@linaro.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(+)

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
+++
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 <csharper2005@gmail.com>
+
+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>;
+            };
+        };
+
+        /* ... */
+
+    };
-- 

> Best regards,
> Krzysztof

Best regards,
Mikhail


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2022-04-09 12:26 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 19:55 [PATCH v2 0/2] dt-bindings: mtd: partitions: Add binding for Sercomm parser Mikhail Zhilkin
2022-04-06 19:55 ` Mikhail Zhilkin
2022-04-06 19:59 ` [PATCH v2 1/2] " Mikhail Zhilkin
2022-04-06 19:59   ` Mikhail Zhilkin
2022-04-07  7:48   ` Krzysztof Kozlowski
2022-04-07  7:48     ` Krzysztof Kozlowski
2022-04-09 12:26     ` Mikhail Zhilkin [this message]
2022-04-09 12:26       ` Mikhail Zhilkin
2022-04-09 12:43       ` Krzysztof Kozlowski
2022-04-09 12:43         ` Krzysztof Kozlowski
2022-04-09 18:04         ` Mikhail Zhilkin
2022-04-09 18:04           ` Mikhail Zhilkin
2022-04-09 18:17           ` Mikhail Zhilkin
2022-04-09 18:17             ` Mikhail Zhilkin
2022-04-10  8:18             ` Krzysztof Kozlowski
2022-04-10  8:18               ` Krzysztof Kozlowski
2022-04-28 15:24               ` Mikhail Zhilkin
2022-04-28 15:24                 ` Mikhail Zhilkin
2022-04-29  6:46                 ` Krzysztof Kozlowski
2022-04-29  6:46                   ` Krzysztof Kozlowski
2022-04-29 15:26                   ` Mikhail Zhilkin
2022-04-29 15:26                     ` Mikhail Zhilkin
2022-04-29 20:22                     ` Krzysztof Kozlowski
2022-04-29 20:22                       ` Krzysztof Kozlowski
2022-04-30  8:04                       ` Mikhail Zhilkin
2022-04-30  8:04                         ` Mikhail Zhilkin
2022-04-30 14:35                         ` Krzysztof Kozlowski
2022-04-30 14:35                           ` Krzysztof Kozlowski
2022-04-30 18:54                           ` Mikhail Zhilkin
2022-04-30 18:54                             ` Mikhail Zhilkin
2022-05-01  8:17                             ` Krzysztof Kozlowski
2022-05-01  8:17                               ` Krzysztof Kozlowski
2022-05-01 14:51                               ` Mikhail Zhilkin
2022-05-01 14:51                                 ` Mikhail Zhilkin
2022-05-01 16:17                                 ` Krzysztof Kozlowski
2022-05-01 16:17                                   ` Krzysztof Kozlowski
2022-05-02  5:42                                   ` Mikhail Zhilkin
2022-05-02  5:42                                     ` Mikhail Zhilkin
2022-04-10  8:14           ` Krzysztof Kozlowski
2022-04-10  8:14             ` Krzysztof Kozlowski
2022-04-07 13:50   ` Rob Herring
2022-04-07 13:50     ` Rob Herring
2022-04-09 12:35     ` Mikhail Zhilkin
2022-04-09 12:35       ` Mikhail Zhilkin
2022-04-09 12:49       ` Krzysztof Kozlowski
2022-04-09 12:49         ` Krzysztof Kozlowski
2022-04-10  6:54         ` Mikhail Zhilkin
2022-04-10  6:54           ` Mikhail Zhilkin
2022-04-06 20:00 ` [PATCH v2 2/2] mtd: parsers: add support for Sercomm partitions Mikhail Zhilkin
2022-04-06 20:00   ` Mikhail Zhilkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57bebf2f-af4c-b2d9-10e5-19e5104946fb@gmail.com \
    --to=csharper2005@gmail.com \
    --cc=Karimdplay@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=drvlabo@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    --cc=vigneshr@ti.com \
    --cc=x1@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.