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, 30 Apr 2022 21:54:43 +0300 [thread overview]
Message-ID: <ee5f293a-e59a-03d8-d9e4-ef35d33b5383@gmail.com> (raw)
In-Reply-To: <2e51842a-d2c9-8953-13aa-02ad3abb3f14@linaro.org>
On 4/30/2022 5:35 PM, Krzysztof Kozlowski wrote:
>> diff --git
>> a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
>> b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
>> index ea4cace6a955..fa457d55559b 100644
>> --- a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
>> +++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
>> @@ -17,9 +17,29 @@ description: |
>> maintainers:
>> - Rafał Miłecki <rafal@milecki.pl>
>>
>> +select:
>> + properties:
>> + compatible:
>> + contains:
>> + enum:
>> + - fixed-partitions
>> +
>> + required:
>> + - compatible
> With your approach you do not need this entire select. I pointed out to
> you if you wanted to take the syscon approach.
>
>> +
>> properties:
>> compatible:
>> - const: fixed-partitions
>> + anyOf:
> oneOf
>
>> + - items:
>> + - enum:
>> + - sercomm,sc-partitions
>> +
>> + - const: fixed-partitions
>> +
>> + - contains:
>> + const: fixed-partitions
>> + minItems: 1
>> + maxItems: 2
> This is also not needed if you do no take the syscon approach.
I tried to take into account all of your comments:
diff --git
a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
index ea4cace6a955..45d6a3971514 100644
--- a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
+++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
@@ -19,7 +19,11 @@ maintainers:
properties:
compatible:
- const: fixed-partitions
+ oneOf:
+ - const: fixed-partitions
+ - items:
+ - const: sercomm,sc-partitions
+ - const: fixed-partitions
"#address-cells": true
@@ -27,7 +31,20 @@ properties:
patternProperties:
"@[0-9a-f]+$":
- $ref: "partition.yaml#"
+ allOf:
+ - $ref: "partition.yaml#"
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: sercomm,sc-partitions
+ then:
+ properties:
+ sercomm,scpart-id:
+ description: Partition id in Sercomm partition map. Parser
+ uses this id to get partition offset and size values from
+ dynamic partition map.
+ $ref: /schemas/types.yaml#/definitions/uint32
required:
- "#address-cells"
@@ -52,6 +69,7 @@ examples:
reg = <0x0100000 0x200000>;
};
};
+
- |
partitions {
compatible = "fixed-partitions";
@@ -64,6 +82,7 @@ examples:
reg = <0x00000000 0x1 0x00000000>;
};
};
+
- |
partitions {
compatible = "fixed-partitions";
@@ -82,6 +101,7 @@ examples:
reg = <0x2 0x00000000 0x1 0x00000000>;
};
};
+
- |
partitions {
compatible = "fixed-partitions";
@@ -119,3 +139,30 @@ examples:
};
};
};
+
+ - |
+ partitions {
+ compatible = "sercomm,sc-partitions", "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x100000>;
+ sercomm,scpart-id = <0>;
+ read-only;
+ };
+
+ partition@100000 {
+ label = "dynamic partition map";
+ reg = <0x100000 0x100000>;
+ sercomm,scpart-id = <1>;
+ };
+
+ partition@200000 {
+ label = "Factory";
+ reg = <0x200000 0x100000>;
+ sercomm,scpart-id = <2>;
+ read-only;
+ };
+ };
--
2.25.1
> "#address-cells": true
>
> @@ -27,7 +47,18 @@ properties:
>
> patternProperties:
> "@[0-9a-f]+$":
> - $ref: "partition.yaml#"
> + allOf:
> + - $ref: "partition.yaml#"
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: sercomm,sc-partitions
> + then:
> + properties:
> + sercomm,scpart-id:
> + description: Partition id in Sercomm partition map
> + $ref: /schemas/types.yaml#/definitions/uint32
> I think we still did not clarify why do you need this ID which in all
> your examples increments by one. The description basically is a copy of
> property name, so it does not explain anything.
I added more detailed description.
>
> required:
> - "#address-cells"
> @@ -119,3 +150,29 @@ examples:
> };
> };
> };
> Blank line.
Fixed. And I added blank lines between already existing examples.
>> + - |
>> + partitions {
>> + compatible = "sercomm,sc-partitions", "fixed-partitions";
>> + #address-cells = <1>;
>> + #size-cells = <1>;
>> +
>> + partition@0 {
>> + label = "u-boot";
>> + reg = <0x0 0x100000>;
>> + sercomm,scpart-id=<0>;
> Missing spaces around =.
Thanks. Fixed.
> Best regards,
> Krzysztof
--
Best regards,
Mikhail
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2022-04-30 18:55 UTC|newest]
Thread overview: 25+ 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:59 ` [PATCH v2 1/2] " Mikhail Zhilkin
2022-04-07 7:48 ` Krzysztof Kozlowski
2022-04-09 12:26 ` Mikhail Zhilkin
2022-04-09 12:43 ` Krzysztof Kozlowski
2022-04-09 18:04 ` Mikhail Zhilkin
2022-04-09 18:17 ` Mikhail Zhilkin
2022-04-10 8:18 ` Krzysztof Kozlowski
2022-04-28 15:24 ` Mikhail Zhilkin
2022-04-29 6:46 ` Krzysztof Kozlowski
2022-04-29 15:26 ` Mikhail Zhilkin
2022-04-29 20:22 ` Krzysztof Kozlowski
2022-04-30 8:04 ` Mikhail Zhilkin
2022-04-30 14:35 ` Krzysztof Kozlowski
2022-04-30 18:54 ` Mikhail Zhilkin [this message]
2022-05-01 8:17 ` Krzysztof Kozlowski
2022-05-01 14:51 ` Mikhail Zhilkin
2022-05-01 16:17 ` Krzysztof Kozlowski
2022-05-02 5:42 ` Mikhail Zhilkin
2022-04-10 8:14 ` Krzysztof Kozlowski
2022-04-07 13:50 ` Rob Herring
2022-04-09 12:35 ` Mikhail Zhilkin
2022-04-09 12:49 ` Krzysztof Kozlowski
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
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=ee5f293a-e59a-03d8-d9e4-ef35d33b5383@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).