]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
ARM: at91: clock: add PMC_PLLICPR init function
authorWenyou Yang <wenyou.yang@atmel.com>
Tue, 2 Feb 2016 04:46:12 +0000 (12:46 +0800)
committerAndreas Bießmann <andreas.devel@googlemail.com>
Thu, 18 Feb 2016 20:34:41 +0000 (21:34 +0100)
To avoid the duplicated code, add the PMC_PLLICPR init function.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
arch/arm/mach-at91/clock.c
arch/arm/mach-at91/include/mach/at91_pmc.h
arch/arm/mach-at91/include/mach/clk.h

index 5300d683d2023f721974bc21f15cfc21b5af071b..06dcbbcbe8ead90a6dd71c2e03ddff823d9840bd 100644 (file)
@@ -112,3 +112,10 @@ void at91_usb_clk_init(u32 value)
 
        writel(value, &pmc->usb);
 }
+
+void at91_pllicpr_init(u32 icpr)
+{
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+       writel(icpr, &pmc->pllicpr);
+}
index eb401945e9d0b0db109b13918d7ac1546b6c8f0e..7684f09afcbb8fa649031077c702204855e5c61f 100644 (file)
@@ -246,4 +246,11 @@ typedef struct at91_pmc {
 #define                AT91_PMC_GCKRDY         (1 << 24)
 
 #define                AT91_PMC_PROTKEY        0x504d4301      /* Activation Code */
+
+/* PLL Charge Pump Current Register (PMC_PLLICPR) */
+#define AT91_PMC_ICP_PLLA(x)           (((x) & 0x3) << 0)
+#define AT91_PMC_IPLL_PLLA(x)          (((x) & 0x7) << 8)
+#define AT91_PMC_ICP_PLLU(x)           (((x) & 0x3) << 16)
+#define AT91_PMC_IVCO_PLLU(x)          (((x) & 0x3) << 24)
+
 #endif
index 64dec5223691f7efafbe042b77d19a4769fa5461..8577c74b47b74dfe7b694c222b3bb50bdb152952 100644 (file)
@@ -135,5 +135,6 @@ int at91_upll_clk_disable(void);
 void at91_usb_clk_init(u32 value);
 int at91_pllb_clk_enable(u32 pllbr);
 int at91_pllb_clk_disable(void);
+void at91_pllicpr_init(u32 icpr);
 
 #endif /* __ASM_ARM_ARCH_CLK_H__ */