在2024年6月22日六月 下午7:12,Krzysztof Kozlowski写道: > On 21/06/2024 17:51, Jiaxun Yang wrote: >> >> >> 在2024年6月20日六月 上午7:40,Krzysztof Kozlowski写道: >> [...] >>>> >>>> Hi Krzysztof, >>>> >>>> I believe U-Boot's implementation is correct. As per simple-mfd binding: >>>> >>>> ``` >>>> simple-mfd" - this signifies that the operating system should >>>> consider all subnodes of the MFD device as separate devices akin to how >>>> "simple-bus" indicates when to see subnodes as children for a simple >>>> memory-mapped bus. >>>> ``` >>>> >>>> This reads to me as "if you want sub nodes to be populated as devices >>>> you need this." >>>> >>>> In our case there are "clock" and "reset" node sub nodes which should be >>>> probed as regular device, so it's true for us. >>> >>> No, you already got comment from Rob. >>> >>> Your children depend on parent to provide IO address, so this is not >>> simple-mfd. Rule for simple-mfd is that children do not rely on parent >>> at all. >>> >> Hi Krzysztof, >> >> Sorry but can I ask for clarification on "depend on parent to provide IO >> address", do you mind explaining it a little bit? Does it mean children >> should get regmap node from a phandle property, not the parent node? Or there >> should be a reg property for child node to tell register offset etc? >> >> There are way too much usage that children "depends" on parents somehow >> in tree, so I want to confirm my understanding. > > > Your driver relies on parent IO address to be provided - what's more to > explain here? If parent does not provide syscon, does the child work? > No. Therefore it is not suited for simple-mfd. > I can name too much "simple-mfd" devices that depending on parent to get it's syscon, in fact it's true for almost all "simple-mfd" users now. I greped RISC-V's DTS, and all two users have child nodes depends on parent node to get "IO address". For "canaan,k210-sysctl" it's both "canaan,k210-clk" and "canaan,k210-rst", for "starfive,jh7110-sys-syscon" that's "starfive,jh7110-pll". If that's something prohibited, then we may need a generic driver in kernel to catch all those syscon devices lost eligibility to "simple-mfd" to get their childs populated. We also need to think about how to handle "syscon-reboot-mode" and "syscon-reboot". "syscon-reboot-mode" is explicitly relying on parent IO address, for "syscon-reboot" the ability of not relying on parent node (regmap property) is deprecated as well. I think we need to make those rules explicit, I'm happy to write a document or update Devicetree specification about that, but I need to make it crystal clear to myself first. Thanks [...] > > Best regards, > Krzysztof -- - Jiaxun