[PATCH v1 1/2] clk: socfpga: Read the clock parent's register base in probe function
marex at denx.de
Wed Mar 11 12:54:58 CET 2020
On 3/11/20 12:50 PM, Simon Glass wrote:
> On Mon, 9 Mar 2020 at 02:22, <chee.hong.ang at intel.com> wrote:
>> From: Chee Hong Ang <chee.hong.ang at intel.com>
>> This commit (82de42fa14682d408da935adfb0f935354c5008f) calls child's
>> ofdata_to_platdata() method before the parent is probed in dm core.
>> This has caused the driver no longer able to get the correct parent
>> clock's register base in the ofdata_to_platdata() method because the
>> parent clocks will only be probed after the child's ofdata_to_platdata().
>> To resolve this, the clock parent's register base will only be retrieved
>> by the child in probe() method instead of ofdata_to_platdata().
> I think one thing that is going on here is that DM allows ofdata to be
> read for a device before its parent devices have been read, but it
> requires that parent devices be probed before their children.
This seems wrong. The clock driver should be able to instantiate devices
and read their ofdata without probing them. That is one of the core
design principles of the DM.
> The idea is that it should be possible to read the ofdata for a node
> without needing to have done so for parents. But perhaps this
> assumption is too brave?
Why is it brave ? That's how it always was, the DT is already there, so
why wouldn't you be able to read it.
> I suspect we could change this, so that device_ofdata_to_platdata()
> first calls itself on its parent.
> I can think of various reasons why this change might be desirable.
I think this is how it worked before already.
More information about the U-Boot