mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Eric Bénard" <eric@eukrea.com>
To: s.hauer@pengutronix.de
Cc: barebox@lists.infradead.org
Subject: [PATCH 08/10] speed-imx35: add support for SDHC1
Date: Thu, 14 Oct 2010 16:05:30 +0200	[thread overview]
Message-ID: <1287065132-20372-8-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1287065132-20372-1-git-send-email-eric@eukrea.com>

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 arch/arm/mach-imx/speed-imx35.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/speed-imx35.c b/arch/arm/mach-imx/speed-imx35.c
index c5a31c7..324cc29 100644
--- a/arch/arm/mach-imx/speed-imx35.c
+++ b/arch/arm/mach-imx/speed-imx35.c
@@ -163,6 +163,17 @@ unsigned long imx_get_uartclk(void)
 		return imx_get_ppllclk() / div;
 }
 
+unsigned long imx_get_mmcclk(void)
+{
+	unsigned long pdr3 = readl(IMX_CCM_BASE + CCM_PDR3);
+	unsigned long div = get_3_3_div(pdr3);
+
+	if (pdr3 & (1 << 6))
+		return imx_get_armclk() / div;
+	else
+		return imx_get_ppllclk() / div;
+}
+
 ulong imx_get_fecclk(void)
 {
 	return imx_get_ipgclk();
@@ -183,6 +194,7 @@ void imx_dump_clocks(void)
 	printf("ipg:     %10d Hz\n", imx_get_ipgclk());
 	printf("ipg_per: %10d Hz\n", imx_get_ipg_perclk());
 	printf("uart:	 %10d Hz\n", imx_get_uartclk());
+	printf("sdhc1:   %10d Hz\n", imx_get_mmcclk());
 }
 
 /*
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2010-10-14 14:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 14:05 [PATCH 01/10] imx/clocksource: enable GPT1 before using it on CPUIMX25 Eric Bénard
2010-10-14 14:05 ` [PATCH 02/10] mx25: add MMC clock support Eric Bénard
2010-10-14 14:05 ` [PATCH 03/10] MX25: fix IOMUX for ESDHC1 pins Eric Bénard
2010-10-14 14:05 ` [PATCH 04/10] mci-core: add more tested SD Cards Eric Bénard
2010-10-14 14:05 ` [PATCH 05/10] epautoconf: fix compile error Eric Bénard
2010-10-14 14:05 ` [PATCH 06/10] eukrea_cpuimx25: update board support Eric Bénard
2010-10-16 19:01   ` Baruch Siach
2010-10-20 10:43     ` Eric Bénard
2010-10-14 14:05 ` [PATCH 07/10] imx35-regs: add defines for USB and SD Eric Bénard
2010-10-14 14:05 ` Eric Bénard [this message]
2010-10-14 14:05 ` [PATCH 09/10] iomux-mx35: fox IOMUX for SDHC1's pins Eric Bénard
2010-10-14 14:05 ` [PATCH 10/10] eukrea_cpuimx35: update board support Eric Bénard

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=1287065132-20372-8-git-send-email-eric@eukrea.com \
    --to=eric@eukrea.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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