[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a575ac76-89f1-cf62-37a4-9f8190682910@seco.com>
Date: Wed, 17 Aug 2022 16:20:21 -0400
From: Sean Anderson <sean.anderson@...o.com>
To: Michael Walle <michael@...le.cc>, biwen.li@....com
Cc: leoyang.li@....com, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, olteanv@...il.com,
shawnguo@...nel.org
Subject: Re: [PATCH v3 3/8] arm64: dts: ls1028a: add flextimer based pwm nodes
Hi Michael,
On 7/28/22 5:33 AM, Michael Walle wrote:
> Hi,
>
> sorry for digging up this old thread. But I've noticed some
> inconsistencies here while syncing the device tree with u-boot.
>
>>> On Wed, Apr 13, 2022 at 06:07:20PM +0000, Leo Li wrote:
>>> > > arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi:1210.21-1219.5:
>>> > > Warning
>>> > > (unique_unit_address): /soc/pwm@...0000: duplicate unit-address
>>> > > (also used in node /soc/timer@...0000)
>>> > > arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi:1221.21-1230.5:
>>> > > Warning
>>> > > (unique_unit_address): /soc/pwm@...0000: duplicate unit-address
>>> > > (also used in node /soc/timer@...0000)
>>> >
>>> > Well, this is similar situation as pcie. The flextimer controller can
>>> > be used as timer, PWM or alarm. We have separate drivers and bindings
>>> > for these modes which resulted in different nodes for the same
>>> > controller.
>>>
>>> I think the mfd framework can address the situation where multiple drivers,
>>> with multiple functionalities, want access to the same memory region?
>>
>> I know mfd is used for device providing multiple functions at the same
>> time. I'm not sure if it can help dealing with the one function at a time
>> scenario.
>
> Funnily enough, I had the same concern:
> https://lore.kernel.org/lkml/92eaa24876a823aa5833435f51095812@walle.cc/
(a bit late, but I didn't see this the first time around)
One alternate approach is to do something like commit bc1ce713a084 ("pwm:
Add support for Xilinx AXI Timer"). Both arch/microblaze/kernel/timer.c
and drivers/pwm/pwm-xilinx.c are drivers for the same device (and have
e.g. the same compatible string). They determine whether to bind based
on whether #pwm-cells is present or not. This avoids having two nodes
with the same address, since one node can be used, with an overlay (or
an included) used to specify the function. It would be better to defer
this to when userspace can have a say, but timers are probed very early
on, so we can't do that.
For the pcie device, perhaps you could use #address-cells?
--Sean
Powered by blists - more mailing lists