[U-Boot] [PATCH 1/3] ARM: at91: clock: add PMC_PLLICPR init function
Wenyou Yang
wenyou.yang at atmel.com
Wed Dec 9 05:36:55 CET 2015
To avoid the duplicated code, add the PMC_PLLICPR init function.
Signed-off-by: Wenyou Yang <wenyou.yang at atmel.com>
---
arch/arm/mach-at91/armv7/clock.c | 7 +++++++
arch/arm/mach-at91/include/mach/at91_pmc.h | 7 +++++++
arch/arm/mach-at91/include/mach/clk.h | 1 +
3 files changed, 15 insertions(+)
diff --git a/arch/arm/mach-at91/armv7/clock.c b/arch/arm/mach-at91/armv7/clock.c
index 81e9f69..b8143c5 100644
--- a/arch/arm/mach-at91/armv7/clock.c
+++ b/arch/arm/mach-at91/armv7/clock.c
@@ -242,3 +242,10 @@ u32 at91_get_periph_generated_clk(u32 id)
return freq / div;
}
+
+void at91_pllicpr_init(u32 icpr)
+{
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+ writel(icpr, &pmc->pllicpr);
+}
diff --git a/arch/arm/mach-at91/include/mach/at91_pmc.h b/arch/arm/mach-at91/include/mach/at91_pmc.h
index eb40194..6955461 100644
--- a/arch/arm/mach-at91/include/mach/at91_pmc.h
+++ b/arch/arm/mach-at91/include/mach/at91_pmc.h
@@ -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) /* Charge Pump Current PLLA */
+#define AT91_PMC_IPLL_PLLA(x) (((x) & 0x7) << 8) /* Engineering Configuration PLLA */
+#define AT91_PMC_ICP_PLLU(x) (((x) & 0x3) << 16) /* Charge Pump Current PLL UTMI */
+#define AT91_PMC_IVCO_PLLU(x) (((x) & 0x3) << 24) /* Voltage Control Output Current PLL UTMI */
+
#endif
diff --git a/arch/arm/mach-at91/include/mach/clk.h b/arch/arm/mach-at91/include/mach/clk.h
index 64dec52..8577c74 100644
--- a/arch/arm/mach-at91/include/mach/clk.h
+++ b/arch/arm/mach-at91/include/mach/clk.h
@@ -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__ */
--
1.7.9.5
More information about the U-Boot
mailing list