public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vlad Zakharov <Vladislav.Zakharov@synopsys.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Accessing nested device tree nodes via phandle
Date: Tue, 20 Dec 2016 15:53:00 +0000	[thread overview]
Message-ID: <1482249180.5351.29.camel@synopsys.com> (raw)

Hi everybody,?

I am working on reorganization of device trees for ARC boards in U-Boot in order to create a common device tree blob for
both Linux and U-Boot.

And I've struggled with a kind of problem and need some help.

On AXS10x motherboard clocks for various peripherals are managed by one hardware block, so clock nodes in Linux device
tree are grouped into one "clocks" node like this:
---------------------------------->8------------------------------------
clocks {
????i2cclk: i2cclk {
????????compatible = "fixed-clock";
????????clock-frequency = <50000000>;
????????#clock-cells = <0>;
????};
?...
?...
?...
? ? uartclk: uartclk {
????????compatible = "fixed-clock";
????????clock-frequency = <33333333>;
????????#clock-cells = <0>;
????}; ?
};
---------------------------------->8------------------------------------
And then some of them a referenced via phandle from other nodes, e.g. &uartclk is referenced from uart node.

When I try to create such hierarchy in U-Boot I find that uart driver is not able to get clock via phandle and
corresponding uart doesn't work.?

As I understand that is because children clocks nodes, i.e. "uartclk" in my case, never got bound as it's parent node
"clocks" never got bound too.
So when I add "compatible" and "u-boot,dm-pre-reloc" properties to "clocks" parent node everything works fine, e.g.:
---------------------------------->8------------------------------------
clocks {
? ? compatible = "simple-bus";
? ? u-boot,dm-pre-reloc;
? ? uartclk: uartclk {
????????compatible = "fixed-clock";
?
???????clock-frequency = <33333333>;
????????#clock-cells = <0>;
????};?
?...
?...
?...
};
---------------------------------->8------------------------------------

Please correct me if I wrongly interpret such behavior.

I wonder if it the only approach to implement Linux-like hierarchy for ARC? Or I am mistaken and in fact can use pure
Linux device tree without adding properties, described above?

Thank you!

-- 
Best regards,
Vlad Zakharov <vzakhar@synopsys.com>

             reply	other threads:[~2016-12-20 15:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-20 15:53 Vlad Zakharov [this message]
2017-01-12  5:07 ` [U-Boot] Accessing nested device tree nodes via phandle Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1482249180.5351.29.camel@synopsys.com \
    --to=vladislav.zakharov@synopsys.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox