public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] mx35: Fix eSDHC clocks
Date: Thu, 27 Sep 2012 22:26:02 +0200 (CEST)	[thread overview]
Message-ID: <178389422.5372550.1348777562720.JavaMail.root@advansee.com> (raw)
In-Reply-To: <1257830147.2411446.1344976418653.JavaMail.root@advansee.com>

Each eSDHC instance has a dedicated clock.

gd->sdhc_clk must also be set accordingly. This is good for the case only a
single SDHC instance is used (initialization made with fsl_esdhc_mmc_init()). A
future patch will fix the multi-instance use case (initialization made directly
with fsl_esdhc_initialize()).

Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Eric B?nard <eric@eukrea.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
---
This patch supersedes http://patchwork.ozlabs.org/patch/177438/ .
Changes for v2:
 - Improve detailed description.
 - Make eSDHC1 the default for gd->sdhc_clk.

 .../arch/arm/cpu/arm1136/mx35/generic.c            |   14 ++++++++++++--
 .../arch/arm/include/asm/arch-mx35/clock.h         |    4 +++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git u-boot-imx-e1eb75b.orig/arch/arm/cpu/arm1136/mx35/generic.c u-boot-imx-e1eb75b/arch/arm/cpu/arm1136/mx35/generic.c
index ef65176..75c25d4 100644
--- u-boot-imx-e1eb75b.orig/arch/arm/cpu/arm1136/mx35/generic.c
+++ u-boot-imx-e1eb75b/arch/arm/cpu/arm1136/mx35/generic.c
@@ -360,8 +360,12 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
 		return get_ipg_per_clk();
 	case MXC_UART_CLK:
 		return imx_get_uartclk();
-	case MXC_ESDHC_CLK:
+	case MXC_ESDHC1_CLK:
 		return mxc_get_peri_clock(ESDHC1_CLK);
+	case MXC_ESDHC2_CLK:
+		return mxc_get_peri_clock(ESDHC2_CLK);
+	case MXC_ESDHC3_CLK:
+		return mxc_get_peri_clock(ESDHC3_CLK);
 	case MXC_USB_CLK:
 		return mxc_get_main_clock(USB_CLK);
 	case MXC_FEC_CLK:
@@ -471,7 +475,13 @@ int cpu_mmc_init(bd_t *bis)
 int get_clocks(void)
 {
 #ifdef CONFIG_FSL_ESDHC
-	gd->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
+#if CONFIG_SYS_FSL_ESDHC_ADDR == MMC_SDHC2_BASE_ADDR
+	gd->sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
+#elif CONFIG_SYS_FSL_ESDHC_ADDR == MMC_SDHC3_BASE_ADDR
+	gd->sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
+#else
+	gd->sdhc_clk = mxc_get_clock(MXC_ESDHC1_CLK);
+#endif
 #endif
 	return 0;
 }
diff --git u-boot-imx-e1eb75b.orig/arch/arm/include/asm/arch-mx35/clock.h u-boot-imx-e1eb75b/arch/arm/include/asm/arch-mx35/clock.h
index eb7458a..60285df 100644
--- u-boot-imx-e1eb75b.orig/arch/arm/include/asm/arch-mx35/clock.h
+++ u-boot-imx-e1eb75b/arch/arm/include/asm/arch-mx35/clock.h
@@ -44,7 +44,9 @@ enum mxc_clock {
 	MXC_IPG_CLK,
 	MXC_IPG_PERCLK,
 	MXC_UART_CLK,
-	MXC_ESDHC_CLK,
+	MXC_ESDHC1_CLK,
+	MXC_ESDHC2_CLK,
+	MXC_ESDHC3_CLK,
 	MXC_USB_CLK,
 	MXC_CSPI_CLK,
 	MXC_FEC_CLK,

  parent reply	other threads:[~2012-09-27 20:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 20:32 [U-Boot] [PATCH 1/7] mx35: Move clock enums to clock.h Benoît Thébaudeau
2012-08-14 20:32 ` [U-Boot] [PATCH 2/7] mx35: Remove declaration of non-existing function Benoît Thébaudeau
2012-08-20 11:56   ` Stefano Babic
2012-08-14 20:32 ` [U-Boot] [PATCH 3/7] mx35: Fix decode_pll Benoît Thébaudeau
2012-09-01  8:15   ` Stefano Babic
2012-09-02 13:01     ` stefano babic
2012-09-06  9:03   ` Stefano Babic
2012-08-14 20:33 ` [U-Boot] [PATCH 4/7] mx35: Add definitions for clock gate values Benoît Thébaudeau
2012-09-06  9:02   ` Stefano Babic
2012-08-14 20:33 ` [U-Boot] [PATCH 5/7] mx35: Fix clock dividers Benoît Thébaudeau
2012-09-01  9:15   ` Stefano Babic
2012-09-03 15:31     ` Benoît Thébaudeau
2012-09-03 15:55       ` Stefano Babic
2012-09-06  9:01         ` Stefano Babic
2012-09-06  9:03   ` Stefano Babic
2012-08-14 20:33 ` [U-Boot] [PATCH 6/7] mx35: Fix eSDHC clocks Benoît Thébaudeau
2012-08-20 12:07   ` Stefano Babic
2012-08-20 12:27     ` Benoît Thébaudeau
2012-08-20 12:34       ` Benoît Thébaudeau
2012-08-20 12:43         ` Stefano Babic
2012-08-20 12:55           ` Benoît Thébaudeau
2012-08-20 12:55             ` Stefano Babic
2012-08-20 13:12               ` Benoît Thébaudeau
2012-09-27 20:26   ` Benoît Thébaudeau [this message]
2012-10-10 11:27     ` [U-Boot] [PATCH v2] " Stefano Babic
2012-08-14 20:33 ` [U-Boot] [PATCH 7/7] mx35: Add cpu_mmc_init() Benoît Thébaudeau
2012-08-17 20:43   ` [U-Boot] [PATCH v2 " Benoît Thébaudeau
2012-08-17 21:18     ` Stefano Babic
2012-08-20  8:01     ` Stefano Babic
2012-08-20 11:50 ` [U-Boot] [PATCH 1/7] mx35: Move clock enums to clock.h Stefano Babic
2012-08-23  9:08 ` 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=178389422.5372550.1348777562720.JavaMail.root@advansee.com \
    --to=benoit.thebaudeau@advansee.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