ARM: atmel: spl: make css field configurable
authorBo Shen <voice.shen@atmel.com>
Fri, 24 Oct 2014 08:13:26 +0000 (16:13 +0800)
committerTom Rini <trini@ti.com>
Mon, 17 Nov 2014 13:47:16 +0000 (08:47 -0500)
The clock source for master clock can be slow clock, main clock,
plla clock or upll clock. So, make the clock source selection
field in mckr can be configured.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
arch/arm/cpu/at91-common/spl.c

index 57fb04106d9fee48b3a57a3016dea83a3d2a42a4..81f5f5380418cfc31079e38b05930d1a0145766d 100644 (file)
@@ -76,10 +76,12 @@ void at91_mck_init(u32 mckr)
        u32 tmp;
 
        tmp = readl(&pmc->mckr);
-       tmp &= ~(AT91_PMC_MCKR_PRES_MASK |
+       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_PRES_MASK |
+       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);