From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bo Shen Date: Thu, 29 Oct 2015 12:06:01 +0800 Subject: [U-Boot] [PATCH v2] arm: at91: clock: Add the generated clock support In-Reply-To: References: <1445830306-23945-1-git-send-email-wenyou.yang@atmel.com> <56303D6B.5000806@gmail.com> Message-ID: <56319B29.8070503@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Wenyou, On 10/28/2015 13:25 PM, Yang, Wenyou wrote: >>> @@ -173,3 +174,67 @@ void at91_periph_clk_disable(int id) >>> > > >>> > > writel(regval, &pmc->pcr); >>> > > } >>> > >+ >>> > >+void at91_enable_periph_generated_clk(u32 id) { >>> > >+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; >>> > >+ u32 regval, status; >>> > >+ u32 timeout = 1000; >>> > >+ >>> > >+ 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; >> > >> >You hard code the GCKCSS and GCKDIV. Would it be OK for all peripheral which >> >need this kind of clock? Can you make it as a parameter? > As you know, our use-case is not complex, it is only used for one or two peripherals for now, > So to make it simple, use hard-code. > > Maybe we will improve it in the future, but now it is enough. I think if this can be dealt now, that will be better. > Anyway, thank you for your advice. You are welcome. Best Regards, Bo Shen