summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/at91/clock.c
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2014-10-31 08:31:04 +0100
committerTom Rini <trini@ti.com>2014-11-17 08:47:17 -0500
commit5abc00d02082056765a8029675e7b05ab6c35263 (patch)
tree381ca30258c8bcc82372e99ba2f903b9a74492c7 /arch/arm/cpu/armv7/at91/clock.c
parent667af36905157b65fd79493e7f821db606ebbd33 (diff)
downloadu-boot-imx-5abc00d02082056765a8029675e7b05ab6c35263.zip
u-boot-imx-5abc00d02082056765a8029675e7b05ab6c35263.tar.gz
u-boot-imx-5abc00d02082056765a8029675e7b05ab6c35263.tar.bz2
arm, spl, at91: add at91sam9260 and at91sam9g45 spl support
add support for using spl code on at91sam9260 and at91sam9g45 based boards. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Bo Shen <voice.shen@atmel.com> Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com> [adopt Bo's change in spl.c] Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Diffstat (limited to 'arch/arm/cpu/armv7/at91/clock.c')
-rw-r--r--arch/arm/cpu/armv7/at91/clock.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/at91/clock.c b/arch/arm/cpu/armv7/at91/clock.c
index 36ed4a6..2cdddb2 100644
--- a/arch/arm/cpu/armv7/at91/clock.c
+++ b/arch/arm/cpu/armv7/at91/clock.c
@@ -111,6 +111,35 @@ int at91_clock_init(unsigned long main_clock)
return 0;
}
+void at91_plla_init(u32 pllar)
+{
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+ writel(pllar, &pmc->pllar);
+ while (!(readl(&pmc->sr) & (AT91_PMC_LOCKA | AT91_PMC_MCKRDY)))
+ ;
+}
+
+void at91_mck_init(u32 mckr)
+{
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+ u32 tmp;
+
+ tmp = readl(&pmc->mckr);
+ tmp &= ~(AT91_PMC_MCKR_CSS_MASK |
+ AT91_PMC_MCKR_PRES_MASK |
+ AT91_PMC_MCKR_MDIV_MASK |
+ AT91_PMC_MCKR_PLLADIV_2);
+ tmp |= mckr & (AT91_PMC_MCKR_CSS_MASK |
+ AT91_PMC_MCKR_PRES_MASK |
+ AT91_PMC_MCKR_MDIV_MASK |
+ AT91_PMC_MCKR_PLLADIV_2);
+ writel(tmp, &pmc->mckr);
+
+ while (!(readl(&pmc->sr) & AT91_PMC_MCKRDY))
+ ;
+}
+
void at91_periph_clk_enable(int id)
{
struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;