public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@opensource.altera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot]  placement for new clock drivers
Date: Mon, 29 Feb 2016 10:56:48 -0600	[thread overview]
Message-ID: <56D47850.4060702@opensource.altera.com> (raw)

Hi,

I have a few questions regarding the UCLASS_CLK driver. I need to
implement a clock driver for a new-ish platform, an ARMv7 based SoCFPGA
Arria10.

I think going forward, it would make sense to place the driver to be of
UCLASS_CLK and would go into drivers/clk/, instead of under
arch/arm/mach-socfpga directory, Am I correct in assuming that?

My 2nd question is regarding the usage of uclass_get_device(UCLASS_CLK).
If I have a DTS that is from:
arch/arm/dts/socfpga.dtsi

Fragment of the clock portion from the DTS here:

clkmgr at ffd04000 {
	compatible = "altr,clk-mgr";
	reg = <0xffd04000 0x1000>;

	clocks {
		#address-cells = <1>;
		#size-cells = <0>;

		osc1: osc1 {
			#clock-cells = <0>;
			compatible = "fixed-clock";
			clock-frequency = <25000000>;
			
		};

		osc2: osc2 {
 			#clock-cells = <0>;
			compatible = "fixed-clock";
		};

		f2s_periph_ref_clk: f2s_periph_ref_clk {
			#clock-cells = <0>;
			compatible = "fixed-clock";
		};

		f2s_sdram_ref_clk: f2s_sdram_ref_clk {
			#clock-cells = <0>;
			compatible = "fixed-clock";
		};
};

I tried calling uclass_get_device(UCLASS_CLK, 0, dev), thinking that it
would return the "fixed-clock" clocks, then I can get the frequencies
and move forward with calculating the rest of the clocks. But
uclass_get_device() is returning an error for me. I'm sure I might have
missed understood how the clock framework is supposed to work somewhere.
Can you please point me in the right direction?

Thanks,
Dinh

             reply	other threads:[~2016-02-29 16:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 16:56 Dinh Nguyen [this message]
2016-03-01  2:03 ` [U-Boot] placement for new clock drivers Simon Glass
2016-03-01 22:16   ` Dinh Nguyen
2016-03-02  4:25     ` 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=56D47850.4060702@opensource.altera.com \
    --to=dinguyen@opensource.altera.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