From: Bo Shen <voice.shen@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: at91: clock: Add the generated clock support
Date: Sat, 12 Sep 2015 05:48:18 +0800 [thread overview]
Message-ID: <55F34C22.3070200@gmail.com> (raw)
In-Reply-To: <B256D81BAE5131468A838E5D7A243641C9FA3DF8@penmbx01>
Hi Wenyou,
On 09/11/2015 10:01 AM, Yang, Wenyou wrote:
>>> +
>>> > >+void at91_enable_periph_generated_clk(u32 id) {
>>> > >+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
>>> > >+ u32 regval;
>>> > >+
>>> > >+ if (id > AT91_PMC_PCR_PID_MASK)
>>> > >+ return;
>>> > >+
>>> > >+ writel(id, &pmc->pcr);
>>> > >+ regval = readl(&pmc->pcr);
>>> > >+ regval &= ~AT91_PMC_PCR_GCKCSS;
>>> > >+ regval &= ~AT91_PMC_PCR_GCKDIV;
>>> > >+ regval |= AT91_PMC_PCR_GCKCSS_PLLA_CLK |
>>> > >+ AT91_PMC_PCR_CMD_WRITE |
>>> > >+ AT91_PMC_PCR_GCKDIV_(1) |
>>> > >+ AT91_PMC_PCR_GCKEN;
>>> > >+
>>> > >+ writel(regval, &pmc->pcr);
>>> > >+
>>> > >+ while (!(readl(&pmc->sr) & AT91_PMC_GCKRDY))
>>> > >+ ;
>> >
>> >Here, do we need to hang the whole system?
> Do you mean, add the timeout to while()?
Yes, something like that.
> But we think if the clock can't reach to a stable state, the system must be in wrong condition.
> So, I don't think this timeout is necessary.
As no datasheet for this. According to the code, the clock is for the
peripheral which want to use the generated clock. So, it only affect
this peripheral while not whole system, am I right?
Best Regards,
Bo Shen
next prev parent reply other threads:[~2015-09-11 21:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 2:29 [U-Boot] [PATCH] arm: at91: clock: Add the generated clock support Wenyou Yang
2015-09-09 22:51 ` Bo Shen
2015-09-11 2:01 ` Yang, Wenyou
2015-09-11 21:48 ` Bo Shen [this message]
2015-09-12 11:20 ` Yang, Wenyou
2015-10-23 21:00 ` Andreas Bießmann
2015-10-26 3:44 ` Yang, Wenyou
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=55F34C22.3070200@gmail.com \
--to=voice.shen@gmail.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