[U-Boot] [PATCH v2 3/3] dts: sunxi: add PWM node for sun50i

Andre Przywara andre.przywara at arm.com
Fri Sep 22 07:49:58 UTC 2017


Hi Vasily,

On 22/09/17 05:45, Vasily Khoruzhick wrote:
> On Thu, Sep 21, 2017 at 12:27 AM, Maxime Ripard
> <maxime.ripard at free-electrons.com> wrote:
>> On Thu, Sep 21, 2017 at 06:07:04AM +0000, Vasily Khoruzhick wrote:
>>> Add PWM definition to sun50i-a64.dtsi - it's compatible with PWM found on H3
>>>
>>> Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
>>> ---
>>> v2: - drop 'sun50i-a64-pwm' compatible string and use 'sun8i-h3-pwm' instead,
>>>       since A64 PWM is compatible with one on H3
>>>
>>>  arch/arm/dts/sun50i-a64.dtsi | 8 ++++++++
>>>  1 file changed, 8 insertions(+)
>>>
>>> diff --git a/arch/arm/dts/sun50i-a64.dtsi b/arch/arm/dts/sun50i-a64.dtsi
>>> index 65a344d9ce..00132855ff 100644
>>> --- a/arch/arm/dts/sun50i-a64.dtsi
>>> +++ b/arch/arm/dts/sun50i-a64.dtsi
>>> @@ -319,6 +319,14 @@
>>>                       };
>>>               };
>>>
>>> +             pwm: pwm at 01c21400 {
>>> +                     compatible = "allwinner,sun8i-h3-pwm";
>>
>> You'd need both compatible. The A64 you used to have, plus that one.
> 
> Why? Hardware seems to be identical and I see a number of non-A64
> compatibles in sun50i-a64.dtsi.
> What's rationale behind adding a new string?

Two reasons:
1) The DT should say what it is, namely the PWM controller in the A64 SoC.
2) We don't know *for sure* that's really identical. It seems to be from
*our* driver's perspective, but there might be bugs in this particular
implementation or some specialities. Should we discover this (in the
future), we can add the special handling to the driver and bind it to
this compatible string. But the DT does not need any change. Which is
good, because it's supposed to live in the firmware.

So it should read:
			compatible = "allwinner,sun50i-a64-pwm",
				     "allwinner,sun8i-h3-pwm";

The DT parsing code won't find a match for the first string, but then
fall back on trying the second (or third, ...).

The only thing that would need to be done is to add this new string to
the binding documentation, mainly to reserve the name.

Cheers,
Andre.


More information about the U-Boot mailing list