linux-mtd.lists.infradead.org archive mirror
 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: Mon, 2 May 2022 08:42:24 +0300	[thread overview]
Message-ID: <abf8fb56-2ad0-8128-ccd4-105055af9226@gmail.com> (raw)
In-Reply-To: <11fbbafd-e7ce-f921-2073-146e96f01f6b@linaro.org>

On 5/1/2022 7:17 PM, Krzysztof Kozlowski wrote:

> On 01/05/2022 16:51, Mikhail Zhilkin wrote:
>> On 5/1/2022 11:17 AM, Krzysztof Kozlowski wrote:
>>
>>> On 30/04/2022 20:54, Mikhail Zhilkin wrote:
>>>>  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.
>>> Partition offset and size values are not derived from scpart-id. I am
>>> sorry but after all these questions - it's the third time now - you
>>> never answer why do you need this property and what is it used for. From
>>> all the examples it could be simply removed and the partition map will
>>> be exactly the same.
>> scpart-id is necessary to get (using mtd parser) partition offset and
>> size from dynamic partition map (NOT from the reg property):
>>
>> ❯ xxd -e -c 12 -s $((0x800)) -l $((0x78)) mtd1
>> 00000800: 00000000 00000000 00100000  ............
>> 0000080c: 00000001 00100000 00100000  ............
>> 00000818: 00000002 00200000 00100000  ...... .....
>> 00000824: 00000003 00300000 00100000  ......0.....
>> 00000830: 00000004 00400000 00600000  ......@...`.
>> 0000083c: 00000005 00a00000 00600000  ..........`.
>> 00000848: 00000006 01000000 02000000  ............
>> 00000854: 00000007 03000000 02000000  ............
>> 00000860: 00000008 05000000 01400000  ..........@.
>> 0000086c: 00000009 06400000 01b80000  ......@.....
>>           scpart-id  offset      size
>>
>> With sercomm,sc-partitions the reg property will be ignored (offset =
>> 0x200000, size = 0x100000) and the values will be taken from partition map.
>>
>> For example we have this is dts:
>>
>> partition@200000 {
>>             label = "Factory";
>>             reg = <0x200000 0x100000>;
>>             sercomm,scpart-id = <2>;
>>             read-only;
>>         };
>>
>> Dynamic partition map:
>>
>> scpart-id = 2; offset = 0x00200000; size = 0x00100000
>>
>> 00000002 00200000 00100000  ...... .....
>>
>> In this example the offset and size are the same in reg and dynamic
>> partition map. If device have bad blocks on NAND the values will be a
>> little different. And we have to take partition offsets from partition
>> map to avoid boot loops, wrong eeprom location and other bad things.
>>
>> Is there anything that needs to be explained in more detail?
> Thanks a lot, this clarifies the topic. Looks good. Maybe you could put
> parts of this into the scpart-id field description?

Thank you for you support! I updated the scpart-id description and hope
this should be clear enough. If so, I'll prepare PATCH v3.

 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. Mtd
+                parser uses this id to find a record in the partiton map
+                containing offset and size of the current partition. The
+                values from partition map overrides partition offset and
+                size defined in reg property of the dts. Frequently these
+                values are the same, but may differ if device has bad
+                eraseblocks on a flash.
+              $ref: /schemas/types.yaml#/definitions/uint32

> Best regards,
> Krzysztof

-- 
Best regards,
Mikhail


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

  reply	other threads:[~2022-05-02  5:43 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
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 [this message]
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=abf8fb56-2ad0-8128-ccd4-105055af9226@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).