R: [PATCH] mtd: parsers: ofpart: limit parsing of deprecated DT syntax

Rafał Miłecki rafal at milecki.pl
Tue Mar 2 20:27:17 GMT 2021


On 02.03.2021 21:23, Rafał Miłecki wrote:
> On 02.03.2021 20:38, ansuelsmth at gmail.com wrote:
>>> From: Rafał Miłecki <rafal at milecki.pl>
>>>
>>> For backward compatibility ofpart still supports the old syntax like:
>>> spi-flash at 0 {
>>>     compatible = "jedec,spi-nor";
>>>     reg = <0x0>;
>>>
>>>     partition at 0 {
>>>         label = "bootloader";
>>>         reg = <0x0 0x100000>;
>>>     };
>>> };
>>> (without "partitions" subnode).
>>>
>>> There is no reason however to support nested partitions without a clear
>>> "compatible" string like:
>>> partitions {
>>>     compatible = "fixed-partitions";
>>>     #address-cells = <1>;
>>>     #size-cells = <1>;
>>>
>>>     partition at 0 {
>>>         label = "bootloader";
>>>         reg = <0x0 0x100000>;
>>>
>>>         partition at 0 {
>>>             label = "config";
>>>             reg = <0x80000 0x80000>;
>>>         };
>>>     };
>>> };
>>> (we never officially supported or documented that).
>>>
>>> Make sure ofpart doesn't attempt to parse above.
>>>
>>
>> I have one question.
>>  From what I can see in the new code, in this example "something"
>> partition won't be parsed with the fixed-partition parser. Correct?
>>
>> partitions {
>>     compatible = "fixed-partitions";
>>     #address-cells = <1>;
>>     #size-cells = <1>;
>>
>>     partition at 0 {
>>         label = "bootloader";
>>         reg = <0x0 0x100000>;
>>         compatible = "random-parser";
>>
>>         partition at 0 {
>>             label = "something";
>>             reg = <0x0 0x100>;
>>         };
>>     };
>> };
> 
> Correct.
> 
> Both: "bootloader" and "something" partitions in your example will have
> master->parent set to their parents. Parser "ofpart" will NOT attempt to
> parse "bootloader" subnodes or "something" subnodes.

I even verified that with
CONFIG_MTD_PARTITIONED_MASTER=y

as well as with
# CONFIG_MTD_PARTITIONED_MASTER is not set

:)



More information about the linux-mtd mailing list