[PATCH v2 4/7] dt-bindings: clock: Add binding constants for BLZP1600

Nikolaos Pasaloukos nikolaos.pasaloukos at blaize.com
Thu Apr 25 00:18:56 PDT 2024


On 25/04/2024 07:56, Krzysztof Kozlowski wrote:
> On 24/04/2024 18:14, Nikolaos Pasaloukos wrote:
>>> No, they cannot be invalid. IDs start from 0 and are incremented by one.
>>> If you have holes, it is not a binding.
>>>
>>> Drop the header or use it properly, so as virtual IDs.
>>>
>>> Best regards,
>>> Krzysztof
>>>
>> My intention was to avoid using magic numbers on the DeviceTree. That's why I added them here.
>> Also, we have some custom drivers which we plan to upload and their schemas need those files.
>> The alternative would be to use magic numbers for our clocks and resets.
>>
>> In the commit message and on the header file I have mentioned that these are numbers matching
>> the hardware specification (1 to 1) of the chip not just enums.
>> Some IDs are invalid because of a hardware gap, some others are invalid because the SCMI
>> service will return an error that the number is invalid.
>>
>> Is there another way to prevent the magic numbers in the schemas and device-tree.
>>
>> Thank you very much for your fast and detailed review.
> Bindings describe the interface between DTS and drivers (OS or some sort
> of other software). The purpose of binding headers is to document the
> constants which are used by both, because they are part of that
> interface. Therefore constants are pure abstraction.
>
> Let me rephrase the question: Why you do not have headers for interrupt
> numbers? All addresses? GPIO pin numbers?
>
> Best regards,
> Krzysztof
>
Thank you very much for your feedback Krzysztof, I'll prepare a v3 with proper
threading this time, removing the dt-bindings for the clock & reset.

Best regards,
Niko




More information about the linux-arm-kernel mailing list