Re: [PATCH v3 2/5] dt-bindings: clocks: atmel,at91rm9200-pmc: convert to yaml

From: Claudiu.Beznea
Date: Fri May 12 2023 - 03:59:29 EST


On 11.05.2023 11:58, Conor Dooley wrote:
> On Thu, May 11, 2023 at 06:29:39AM +0000, Claudiu.Beznea@xxxxxxxxxxxxx wrote:
>> On 10.05.2023 13:12, Krzysztof Kozlowski wrote:
>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>>
>>> On 10/05/2023 10:31, Claudiu.Beznea@xxxxxxxxxxxxx wrote:
>>>> On 10.05.2023 10:58, Krzysztof Kozlowski wrote:
>>>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>>>>
>>>>> On 10/05/2023 09:14, Claudiu.Beznea@xxxxxxxxxxxxx wrote:
>>>>>> On 10.05.2023 10:06, Krzysztof Kozlowski wrote:
>>>>>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>>>>>>
>>>>>>> On 10/05/2023 09:00, Claudiu.Beznea@xxxxxxxxxxxxx wrote:
>>>>>>>> On 09.05.2023 09:25, Krzysztof Kozlowski wrote:
>>>>>>>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>>>>>>>>
>>>>>>>>> On 09/05/2023 07:27, Claudiu Beznea wrote:
>>>>>>>>>> Convert Atmel PMC documentation to yaml. Along with it clock names
>>>>>>>>>> were adapted according to the current available device trees as
>>>>>>>>>> different controller versions accept different clocks (some of them
>>>>>>>>>> have 3 clocks as input, some has 2 clocks as inputs and some with 2
>>>>>>>>>> input clocks uses different clock names).
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thank you for your patch. There is something to discuss/improve.
>>>>>>>>>
>>>>>>>>>> +title: Atmel Power Management Controller (PMC)
>>>>>>>>>> +
>>>>>>>>>> +maintainers:
>>>>>>>>>> + - Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx>
>>>>>>>>>> +
>>>>>>>>>> +description:
>>>>>>>>>> + The power management controller optimizes power consumption by controlling all
>>>>>>>>>> + system and user peripheral clocks. The PMC enables/disables the clock inputs
>>>>>>>>>> + to many of the peripherals and to the processor.
>>>>>>>>>> +
>>>>>>>>>> +properties:
>>>>>>>>>> + compatible:
>>>>>>>>>> + oneOf:
>>>>>>>>>> + - items:
>>>>>>>>>> + - enum:
>>>>>>>>>> + - atmel,at91sam9g15-pmc
>>>>>>>>>> + - atmel,at91sam9g20-pmc
>>>>>>>>>> + - atmel,at91sam9g25-pmc
>>>>>>>>>> + - atmel,at91sam9g35-pmc
>>>>>>>>>> + - atmel,at91sam9x25-pmc
>>>>>>>>>> + - atmel,at91sam9x35-pmc
>>>>>>>>>> + - enum:
>>>>>>>>>> + - atmel,at91sam9260-pmc
>>>>>>>>>> + - atmel,at91sam9x5-pmc
>>>>>>>>>
>>>>>>>>> I missed it last time - why you have two enums? We never talked about
>>>>>>>>> this. It's usually wrong... are you sure this is real hardware:
>>>>>>>>> atmel,at91sam9g20-pmc, atmel,at91sam9260-pmc
>>>>>>>>> ?
>>>>>>>>
>>>>>>>> I have 2 enums because there are some hardware covered by:
>>>>>>>> "vendor-name,hardware-v1-pmc", "syscon" and some covered by:
>>>>>>>> "vendor-name,hardware-v2-pmc", "vendor-name,hardware-v1-pmc", "syscon".
>>>>>>>
>>>>>>> The enum does not say this. At all.
>>>>>>>
>>>>>>> So again, answer, do not ignore:
>>>>>>> is this valid setup:
>>>>>>> atmel,at91sam9g20-pmc, atmel,at91sam9260-pmc
>>>>>>> ?
>>>>>>
>>>>>> Not w/o syscon. This is valid:
>>>>>
>>>>> Syscon is not important here, but indeed I missed it.
>>>>>
>>>>>>
>>>>>> compatible = "atmel,at91sam9g20-pmc", "atmel,at91sam9260-pmc", "syscon";
>>>>>>
>>>>>> available in arch/arm/boot/dts/at91sam9g20.dtsi +45
>>>>>
>>>>> Nice, so my random choice was actually correct. Ok, so another:
>>>>>
>>>>> atmel,at91sam9g15-pmc, atmel,at91sam9260-pmc, syscon
>>>>>
>>>>> Is it valid hardware?
>>>>
>>>> This one, no. So, I guess, the wrong here is that there could be
>>>> combinations that are not for actual hardware and yet considered valid by
>>>> changes in this patch?
>>>
>>> I just don't understand why you have two enums. This is not a pattern
>>> which is allowed anywhere. It might appear but only as exception or mistake.
>>
>> I'm not at all an YAML expert and this is how I've managed to make
>> dt_binding_check/dtbs_check happy.
>
> Picking one item at random, do the devicetrees contain stuff like:
> "atmel,at91sam9g35-pmc", "atmel,at91sam9260-pmc", "syscon"
> //AND//
> "atmel,at91sam9g35-pmc", "atmel,at91sam9x5-pmc", "syscon"
> ?
>
> If not, why do you not break it down to something like:
> - items:
> - enum:
> - atmel,compatible
> - atmel,with
> - atmel,sam9260's pmc
> - const: atmel,at91sam9260-pmc
> - const: syscon
>
> - items:
> - enum:
> - atmel,compatible
> - atmel,with
> - atmel,sam9x5's pmc
> - const: atmel,at91sam9x5-pmc
> - const: syscon
>

I'll check it out, thank you!

> Cheers,
> Conor.