]> git.sur5r.net Git - u-boot/commitdiff
imx6: clock: Enable External Memory Interface [EIM] clock (eim_slow_clock)
authorLukasz Majewski <l.majewski@majess.pl>
Mon, 28 Nov 2016 06:18:14 +0000 (07:18 +0100)
committerStefano Babic <sbabic@denx.de>
Wed, 30 Nov 2016 08:57:19 +0000 (09:57 +0100)
This patch extends the imx6 clock code to enable or disable the EIM
slow clock, which in necessary when one wants to use EIM interface t
o read/write from external memory (e.g. NOR).

Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
arch/arm/cpu/armv7/mx6/clock.c
arch/arm/include/asm/arch-mx6/clock.h

index 96fbd81d0814766bba5717b0c49dcca70f3ce41e..299562884add94b3f2e228827ba8b6d7374ba538 100644 (file)
@@ -1384,6 +1384,20 @@ void select_ldb_di_clock_source(enum ldb_di_clock clk)
 }
 #endif
 
+#ifndef CONFIG_SYS_NO_FLASH
+void enable_eim_clk(unsigned char enable)
+{
+       u32 reg;
+
+       reg = __raw_readl(&imx_ccm->CCGR6);
+       if (enable)
+               reg |= MXC_CCM_CCGR6_EMI_SLOW_MASK;
+       else
+               reg &= ~MXC_CCM_CCGR6_EMI_SLOW_MASK;
+       __raw_writel(reg, &imx_ccm->CCGR6);
+}
+#endif
+
 /***************************************************/
 
 U_BOOT_CMD(
index 82f9f92b83ddf925817489aa88cd7bed2932d426..ed1433ebc6839994b5653869c3e15dd978fd642b 100644 (file)
@@ -79,4 +79,5 @@ void enable_qspi_clk(int qspi_num);
 void enable_thermal_clk(void);
 void mxs_set_lcdclk(u32 base_addr, u32 freq);
 void select_ldb_di_clock_source(enum ldb_di_clock clk);
+void enable_eim_clk(unsigned char enable);
 #endif /* __ASM_ARCH_CLOCK_H */