On 12.11.2021 23:18, Rob Herring wrote:
On Tue, Nov 2, 2021 at 10:22 AM Rafał Miłecki <zajec5@xxxxxxxxx> wrote:
From: Rafał Miłecki <rafal@xxxxxxxxxx>
During my work on MFD binding for Broadcom's TWD block I received
comment from Rob saying that "syscon-reboot" should use "reg" property.
I'm not sure if my understanding & implementation are correct so I'm
sending this RFC.
What bothers me is non-standard "reg" property usage. Treating it as a
simple (unsigned) integer number means different logic when it comes to
ranges.
It shouldn't be. The idea is that 'reg' works like normal. See below.
Consider this example:
timer@400 {
compatible = "simple-mfd", "syscon";
reg = <0x400 0x3c>;
ranges;
ranges = <0 0x400 0x100>; // Just guessing for size
#address-cells = <1>;
#size-cells = <1>;
reboot@434 {
reboot@34
Just reading 'reg' is fine, but really, Linux should be either getting
the translated address or have a function to get the offset from the
parent base. IOW, it should also work if you just changed 'reg' to
'<0x434 0x4>'.
Are you aware of anyone working on support for getting translated
address? Do you recall any efforts on implementing such a helper?
Thanks a lot for commenting on this concern explicitly.