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>'. > compatible = "syscon-reboot"; > reg = <0x34 0x4>; > mask = <0x1>; > }; > }; > > I've reboot@434 node with reg 0x34. Also 0x4 is ignored but must be > present because of of MFD addressing. > > Please review this idea / binding / implementation. > > Rafał Miłecki (3): > dt-bindings: power: reset: syscon-reboot: use non-deprecated example > dt-bindings: power: reset: syscon-reboot: add "reg" property > power: reset: syscon-reboot: support "reg" property > > .../bindings/power/reset/syscon-reboot.yaml | 28 +++++++++++++------ > drivers/power/reset/syscon-reboot.c | 9 ++++-- > 2 files changed, 26 insertions(+), 11 deletions(-) > > -- > 2.31.1 >