public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] mx6: clock: Introduce disable_ipu_clock()
Date: Fri, 12 Jul 2019 09:32:23 -0300	[thread overview]
Message-ID: <20190712123224.30152-3-festevam@gmail.com> (raw)
In-Reply-To: <20190712123224.30152-1-festevam@gmail.com>

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>
---
 arch/arm/include/asm/arch-mx6/clock.h |  1 +
 arch/arm/mach-imx/mx6/clock.c         | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/arch/arm/include/asm/arch-mx6/clock.h b/arch/arm/include/asm/arch-mx6/clock.h
index a9481a5fea..f7760541a4 100644
--- a/arch/arm/include/asm/arch-mx6/clock.h
+++ b/arch/arm/include/asm/arch-mx6/clock.h
@@ -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);
diff --git a/arch/arm/mach-imx/mx6/clock.c b/arch/arm/mach-imx/mx6/clock.c
index 9951f79106..e1e21e37a8 100644
--- a/arch/arm/mach-imx/mx6/clock.c
+++ b/arch/arm/mach-imx/mx6/clock.c
@@ -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
-- 
2.17.1

  parent reply	other threads:[~2019-07-12 12:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12 12:32 [U-Boot] [PATCH 1/4] mx6: clock: Allow enable_ipu_clock() to be built for SPL code Fabio Estevam
2019-07-12 12:32 ` [U-Boot] [PATCH 2/4] mx6: clock: Use setbits_le32() Fabio Estevam
2019-07-16  2:07   ` Peng Fan
2019-07-12 12:32 ` Fabio Estevam [this message]
2019-07-16  2:07   ` [U-Boot] [PATCH 3/4] mx6: clock: Introduce disable_ipu_clock() Peng Fan
2019-07-12 12:32 ` [U-Boot] [PATCH 4/4] mx6: Allow configuring the NoC registers on i.MX6QP Fabio Estevam
2019-07-15  1:55   ` Peng Fan
2019-07-15 11:37     ` Fabio Estevam
2019-07-16  2:07   ` Peng Fan
2019-10-24 13:47   ` Fabio Estevam
2019-11-03 12:17     ` Stefano Babic
2019-11-03 16:06       ` Stefano Babic
2019-11-04 12:45         ` Fabio Estevam
2019-07-16  2:07 ` [U-Boot] [PATCH 1/4] mx6: clock: Allow enable_ipu_clock() to be built for SPL code Peng Fan
2019-09-17 17:04 ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190712123224.30152-3-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox