From: Wenyou Yang Date: Mon, 11 Apr 2016 08:41:31 +0000 (+0800) Subject: ARM: at91: clock: fix the GCK's clock source X-Git-Tag: v2016.07-rc1~176^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4adf6a715796de4f0e858e0246c3abf5e3c118f3;p=platform%2Fkernel%2Fu-boot.git ARM: at91: clock: fix the GCK's clock source Before enabling a generated clock whose source is from the UPLL clock, check and enable the UPLL clock. Signed-off-by: Wenyou Yang Reviewed-by: Andreas Bießmann --- diff --git a/arch/arm/mach-at91/armv7/clock.c b/arch/arm/mach-at91/armv7/clock.c index 81e9f69..27372b3 100644 --- a/arch/arm/mach-at91/armv7/clock.c +++ b/arch/arm/mach-at91/armv7/clock.c @@ -162,6 +162,11 @@ int at91_enable_periph_generated_clk(u32 id, u32 clk_source, u32 div) if (div > 0xff) return -EINVAL; + if (clk_source == GCK_CSS_UPLL_CLK) { + if (at91_upll_clk_enable()) + return -ENODEV; + } + writel(id, &pmc->pcr); regval = readl(&pmc->pcr); regval &= ~AT91_PMC_PCR_GCKCSS;