Re: [PATCH v8 3/3] dt-bindings: mtd: marvell-nand: Convert to YAML DT scheme
From: Krzysztof Kozlowski
Date: Tue Jun 06 2023 - 07:14:29 EST
On 06/06/2023 13:11, Krzysztof Kozlowski wrote:
>>> If yes, please ignore the series sent aside, I will work on it again
>>> and send a v2.
>>
>> Actually I already see a problem, let's the ingenic,nand.yaml example.
>> The goal, IIUC, is to do:
>>
>> patternProperties:
>> "^nand@[a-f0-9]$":
>> type: object
>> + $ref: nand-chip.yaml
>> properties:
>>
>> ...
>>
>> + unevaluatedProperties: false
>>
>> The example in this file uses a property, nand-on-flash-bbt, which is
>> described inside nand-controller.yaml instead of nand-chip.yaml.
>> Indeed, the former actually describes many properties which are a bit
>> more controller related than chip related. With the above description,
>> the example fails because nand-on-flash-bbt is not allowed (it is not
>> listed in nand-chip.yaml).
>>
>> How would you proceed in this case?
>>
>> Maybe I could move all the NAND chip properties which are somehow
>> related to NAND controllers (and defined in nand-controller.yaml) in a
>> dedicated file and reference it from nand-chip.yaml? Any other idea is
>> welcome.
>
> Yes, this would work and seems reasonable.
Actually, since nand-chip is used by both SPI and NAND, then I think
better would be to create separate file - nand-only-chip.yaml (name to
be discussed):
nand-controller.yaml:
"^nand@[a-f0-9]$":
$ref: nand-only-chip.yaml
nand-only-chip.yaml:
$ref: nand-chip.yaml
all nand-controller-chip properties follow
> Other way could be to add
> unevaluatedProperties:false on this level (so after ref:nand-chip.yaml)
> in nand-controller.yaml. This however would not allow any new properties
> to be defined in device bindings.
Best regards,
Krzysztof