From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] mx6: clock: Do not enable sata and ipu clocks
Date: Tue, 17 Jun 2014 17:36:17 +0200 [thread overview]
Message-ID: <53A06071.9030802@denx.de> (raw)
In-Reply-To: <1402777782-15542-3-git-send-email-festevam@gmail.com>
Hi Fabio,
On 14/06/2014 22:29, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> mx6sx does not have sata nor ipu blocks, so do not handle such clocks.
>
We have already a check inside setup_sata():
if (!is_cpu_type(MXC_CPU_MX6Q) && !is_cpu_type(MXC_CPU_MX6D))
return 1;
enable_sata_clock() is called only for quad and dual. I think you do not
need at all to block enable_sata_clock(), it should be not called.
I would prefer we carry on with this approach: board are calling
functions to set up hardware, and each peripheral (setup_sata or the ipu
driver) makes the check at runtime for the running cpu.
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> arch/arm/cpu/armv7/mx6/clock.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
> index d31fbbd..51c964c 100644
> --- a/arch/arm/cpu/armv7/mx6/clock.c
> +++ b/arch/arm/cpu/armv7/mx6/clock.c
> @@ -437,6 +437,7 @@ static int enable_enet_pll(uint32_t en)
> return 0;
> }
>
> +#ifndef CONFIG_MX6SX
> static void ungate_sata_clock(void)
> {
> struct mxc_ccm_reg *const imx_ccm =
> @@ -445,6 +446,7 @@ static void ungate_sata_clock(void)
> /* Enable SATA clock. */
> setbits_le32(&imx_ccm->CCGR5, MXC_CCM_CCGR5_SATA_MASK);
> }
> +#endif
>
> static void ungate_pcie_clock(void)
> {
> @@ -455,11 +457,13 @@ static void ungate_pcie_clock(void)
> setbits_le32(&imx_ccm->CCGR4, MXC_CCM_CCGR4_PCIE_MASK);
> }
>
> +#ifndef CONFIG_MX6SX
> int enable_sata_clock(void)
> {
> ungate_sata_clock();
> return enable_enet_pll(BM_ANADIG_PLL_ENET_ENABLE_SATA);
> }
> +#endif
>
> int enable_pcie_clock(void)
> {
> @@ -491,7 +495,9 @@ int enable_pcie_clock(void)
> clrbits_le32(&ccm_regs->cbcmr, MXC_CCM_CBCMR_PCIE_AXI_CLK_SEL);
>
> /* Party time! Ungate the clock to the PCIe. */
> +#ifndef CONFIG_MX6SX
> ungate_sata_clock();
> +#endif
> ungate_pcie_clock();
>
> return enable_enet_pll(BM_ANADIG_PLL_ENET_ENABLE_SATA |
> @@ -573,6 +579,7 @@ int do_mx6_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> return 0;
> }
>
> +#ifndef CONFIG_MX6SX
> void enable_ipu_clock(void)
> {
> struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
> @@ -581,6 +588,7 @@ void enable_ipu_clock(void)
> reg |= MXC_CCM_CCGR3_IPU1_IPU_MASK;
> writel(reg, &mxc_ccm->CCGR3);
> }
> +#endif
> /***************************************************/
>
> U_BOOT_CMD(
>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
next prev parent reply other threads:[~2014-06-17 15:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-14 20:29 [U-Boot] [PATCH 1/4] mx6: Add support for the mx6solox variant Fabio Estevam
2014-06-14 20:29 ` [U-Boot] [PATCH 2/4] mx6sx: Add pin definitions Fabio Estevam
2014-06-17 15:40 ` Stefano Babic
2014-06-17 18:59 ` Eric Nelson
2014-06-20 18:58 ` Fabio Estevam
2014-06-24 12:39 ` Stefano Babic
2014-06-14 20:29 ` [U-Boot] [PATCH 3/4] mx6: clock: Do not enable sata and ipu clocks Fabio Estevam
2014-06-17 15:36 ` Stefano Babic [this message]
2014-06-20 18:56 ` Fabio Estevam
2014-06-24 12:37 ` Stefano Babic
2014-06-24 17:12 ` Fabio Estevam
2014-06-14 20:29 ` [U-Boot] [PATCH 4/4] mx6sx: Add initial support for mx6sxsabresd board Fabio Estevam
2014-06-17 15:26 ` [U-Boot] [PATCH 1/4] mx6: Add support for the mx6solox variant Stefano Babic
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=53A06071.9030802@denx.de \
--to=sbabic@denx.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.