summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-01-15 15:18:04 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-01-15 15:18:04 +0100
commitbf46e7d8d134521301ff02b6d97e8998aa10a83d (patch)
tree2c92b6fb6dc329695dc703293b6ea260263cca70 /arch/arm/cpu/armv7
parent6ba2bc8fa9be4bd09ec43e39cb8e666480ef010c (diff)
parent3a21773129f6ef218f1978d05a1a5d5cf6801ab6 (diff)
downloadu-boot-imx-bf46e7d8d134521301ff02b6d97e8998aa10a83d.zip
u-boot-imx-bf46e7d8d134521301ff02b6d97e8998aa10a83d.tar.gz
u-boot-imx-bf46e7d8d134521301ff02b6d97e8998aa10a83d.tar.bz2
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
Diffstat (limited to 'arch/arm/cpu/armv7')
-rw-r--r--arch/arm/cpu/armv7/mx6/clock.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index f12bba2..5617a41 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -323,7 +323,7 @@ static u32 get_mmdc_ch0_clk(void)
#endif
#ifdef CONFIG_FEC_MXC
-int enable_fec_anatop_clock(void)
+int enable_fec_anatop_clock(enum enet_freq freq)
{
u32 reg = 0;
s32 timeout = 100000;
@@ -331,7 +331,13 @@ int enable_fec_anatop_clock(void)
struct anatop_regs __iomem *anatop =
(struct anatop_regs __iomem *)ANATOP_BASE_ADDR;
+ if (freq < ENET_25MHz || freq > ENET_125MHz)
+ return -EINVAL;
+
reg = readl(&anatop->pll_enet);
+ reg &= ~BM_ANADIG_PLL_ENET_DIV_SELECT;
+ reg |= freq;
+
if ((reg & BM_ANADIG_PLL_ENET_POWERDOWN) ||
(!(reg & BM_ANADIG_PLL_ENET_LOCK))) {
reg &= ~BM_ANADIG_PLL_ENET_POWERDOWN;