mx6: clock: Introduce disable_ipu_clock()
authorFabio Estevam <festevam@gmail.com>
Fri, 12 Jul 2019 12:32:23 +0000 (09:32 -0300)
committerStefano Babic <sbabic@denx.de>
Sun, 3 Nov 2019 12:16:51 +0000 (13:16 +0100)
Introduce disable_ipu_clock(). This is done in preparation for
configuring the NoC registers on i.MX6QP in SPL.

Afer the NoC registers are set the IPU clocks can be disabled.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
arch/arm/include/asm/arch-mx6/clock.h
arch/arm/mach-imx/mx6/clock.c

index a9481a5feadb5472d11cf5fbf2235ca9994191cf..f7760541a4c1123108957b8e353348812e5a12ad 100644 (file)
@@ -71,6 +71,7 @@ int enable_pcie_clock(void);
 int enable_i2c_clk(unsigned char enable, unsigned i2c_num);
 int enable_spi_clk(unsigned char enable, unsigned spi_num);
 void enable_ipu_clock(void);
+void disable_ipu_clock(void);
 int enable_fec_anatop_clock(int fec_id, enum enet_freq freq);
 void enable_enet_clk(unsigned char enable);
 int enable_lcdif_clock(u32 base_addr, bool enable);
index 9d432b41049940f22f85f8a4b82cfe60ae897f2e..6a9e673ca2781be3019c1a1fba2a3bda0b9f38f0 100644 (file)
@@ -1287,6 +1287,18 @@ void enable_ipu_clock(void)
                setbits_le32(&mxc_ccm->CCGR3, MXC_CCM_CCGR3_IPU2_IPU_MASK);
        }
 }
+
+void disable_ipu_clock(void)
+{
+       struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+       clrbits_le32(&mxc_ccm->CCGR3, MXC_CCM_CCGR3_IPU1_IPU_MASK);
+
+       if (is_mx6dqp()) {
+               clrbits_le32(&mxc_ccm->CCGR6, MXC_CCM_CCGR6_PRG_CLK0_MASK);
+               clrbits_le32(&mxc_ccm->CCGR3, MXC_CCM_CCGR3_IPU2_IPU_MASK);
+       }
+}
 #endif
 
 #ifndef CONFIG_SPL_BUILD