From: Sascha Hauer <s.hauer@pengutronix.de>
To: zhoubo.mr@foxmail.com
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/davicom: Add SOC to dm9000 to initialize SROM_BANK clock.
Date: Mon, 11 May 2020 08:25:42 +0200 [thread overview]
Message-ID: <20200511062542.GO5877@pengutronix.de> (raw)
In-Reply-To: <20200510110213.2432-1-zhoubo.mr@foxmail.com>
On Sun, May 10, 2020 at 07:02:13PM +0800, zhoubo.mr@foxmail.com wrote:
> From: To-run-away <zhoubo.mr@foxmail.com>
>
> Increase the use of dm9000 to initialize the SROM_BANK clock in the SOC,
> otherwise the chip will not work.
The dm9000 doesn't have anything called SROM in it. You have to
describe the clock input pin of the dm9000 here, not the pin of
your SoC where the clock is coming out.
> The device tree file can be increased like this:
> ethernet@88000000 {
> compatible = "davicom,dm9000";
> ....
> clocks = <&clocks CLK_SROMC>;
> clock-names = "sromc";
This must be documented in
Documentation/devicetree/bindings/net/davicom-dm9000.txt.
> + /* Enable clock if specified */
> + if (!of_property_read_string(dev->of_node, "clock-names", &clk_name)) {
> + struct clk *clk = devm_clk_get(dev, clk_name);
> + if (IS_ERR(clk)) {
> + dev_err(dev, "cannot get clock of %s\n", clk_name);
> + ret = PTR_ERR(clk);
> + goto out;
> + }
> + clk_prepare_enable(clk);
> + dev_info(dev, "enable clock '%s'\n", clk_name);
> + }
There's devm_clk_get_optional() which you should use here.
the "name" passed to devm_clk_get_optional() should match the name of
the clock, you must specify it according to the dm9000 datasheet. It
makes no sense to read the name from the device tree, instead pick a
name which you expect to be there.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
parent reply other threads:[~2020-05-11 6:25 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20200510110213.2432-1-zhoubo.mr@foxmail.com>]
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=20200511062542.GO5877@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=zhoubo.mr@foxmail.com \
/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
all inboxes | Powered by JetHome®