[U-Boot] [PATCH] arm: at91: clock: Add the generated clock support

Yang, Wenyou
2015-09-12T11:20:38Z

Hi Bo Shen,

> -----Original Message-----
> From: Bo Shen [mailto:voice.shen at gmail.com]
> Sent: 2015?9?12? 5:48
> To: Yang, Wenyou; U-Boot Mailing List
> Subject: Re: [U-Boot] [PATCH] arm: at91: clock: Add the generated clock support
>
> 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?
Yes, you are right.

It is introduced by D2. Because it is not formally launch now, its datasheet can't be available outside, it should be available soon.

Thank.

Best Regards,
Wenyou Yang