From: Magnus Damm <magnus.damm@gmail.com>
To: Ian Molton <ian@mnementh.co.uk>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
pHilipp Zabel <philipp.zabel@gmail.com>,
Paul Mundt <lethal@linux-sh.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
linux-kernel@vger.kernel.org, Pierre Ossman <drzeus@drzeus.cx>
Subject: Re: MMC: Make the configuration memory resource optional
Date: Tue, 18 Aug 2009 17:40:03 +0900 [thread overview]
Message-ID: <aec7e5c30908180140n3d46c9c0i33560b2e09ad3f9d@mail.gmail.com> (raw)
In-Reply-To: <4A7A106B.2070809@mnementh.co.uk>
[-- Attachment #1: Type: text/plain, Size: 1983 bytes --]
Hi Ian!
On Thu, Aug 6, 2009 at 8:06 AM, Ian Molton<ian@mnementh.co.uk> wrote:
> Ok, so then your controller (unless it uses a different scheme altogether
> for the card clock divider) probably has a max card clock of 12MHz and a min
> of 24/512MHz.
Allright, I've now tested the tmio_mmc driver on a ms7724se board. In
the current configuration the tmio_mmc block is driven by a 83 Mhz
clock. We can change the frequency of this clock but it will affect
other hardware blocks as well so I'd rather not unless I really have
to.
> I'm fine with that. If someone who _has_ this hardware could get a 'scope on
> the card clock and see what frequencies actually appear out there, I'd
> _really_ appreciate it.
I've done some measurements with my Fluke 123 Scopemeter. It's limited
to 20 MHz so I didn't measure all combinations. I hooked it up to pin
5 of CN7 on the ms7724se board. In total I did 7 measurements, with
XSHIFT from 0 to 6. One line per measurement below. The number on the
far right is the value from the scope.
using clock 162760 (162760, 83333332) [162760] 0x0180 -> 162.7 kHz
using clock 325520 (162760, 83333332) [325520] 0x0140 -> 0.326 MHz
using clock 651040 (162760, 83333332) [651040] 0x0120 -> 0.651 MHz
using clock 1302080 (162760, 83333332) [1302080] 0x0110 -> 01.30 MHz
using clock 2604160 (162760, 83333332) [2604160] 0x0108 -> 02.61 MHz
using clock 5208320 (162760, 83333332) [5208320] 0x0104 -> 05.21 MHz
using clock 10416640 (162760, 83333332) [10416640] 0x0102 -> 10.42 MHz
Everything seems to work as expected what I can tell. The frequencies match.
I've attached a patch which shows details of the printouts. Hopefully
it includes all you need.
FYI, I needed to modify the tmio_mmc driver to change the
dev->num_resources check in probe from 3 to 2 to support the SuperH
hardware. Can you please roll in that change and send an updated
version of your "MMC / MFD / Clocks" patch whenever you have time?
Thanks for your help!
Cheers,
/ magnus
[-- Attachment #2: linux-2.6.32-pre-sh-se7724-tmio-measure-hack-20090818.patch --]
[-- Type: application/octet-stream, Size: 863 bytes --]
--- 0007/drivers/mmc/host/tmio_mmc.c
+++ work/drivers/mmc/host/tmio_mmc.c 2009-08-18 17:03:22.000000000 +0900
@@ -35,13 +35,16 @@
#include "tmio_mmc.h"
+#define XSHIFT 6
+#define XLIMIT (162760 << XSHIFT)
+
static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
{
u32 clk = 0, clock;
if (new_clock) {
for (clock = host->mmc->f_min, clk = 0x80000080;
- new_clock >= (clock<<1); clk >>= 1)
+ (clock < XLIMIT) && (new_clock >= (clock<<1)); clk >>= 1)
clock <<= 1;
clk |= 0x100;
}
@@ -49,6 +52,10 @@ static void tmio_mmc_set_clock(struct tm
if(host->set_no_clk_div)
host->set_no_clk_div(NULL, (clk>>22) & 1);
+ printk("using clock %d (%d, %d) [%d] 0x%04x\n",
+ clock, host->mmc->f_min, host->mmc->f_max, XLIMIT,
+ clk & 0x1ff);
+
sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk & 0x1ff);
}
next prev parent reply other threads:[~2009-08-18 8:40 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-17 11:10 Guennadi Liakhovetski
2009-07-17 14:19 ` Magnus Damm
2009-07-17 14:34 ` [PATCH] " Guennadi Liakhovetski
2009-07-17 17:38 ` Ian Molton
2009-07-23 10:29 ` Magnus Damm
2009-07-28 13:55 ` Ian Molton
2009-07-29 2:48 ` Magnus Damm
2009-07-29 10:24 ` Ian Molton
2009-07-29 11:58 ` Mark Brown
2009-07-29 12:27 ` Magnus Damm
2009-07-29 12:35 ` Paul Mundt
2009-07-29 12:42 ` Mark Brown
2009-07-29 12:51 ` Magnus Damm
2009-07-29 12:58 ` Ian Molton
2009-07-29 13:08 ` Magnus Damm
2009-07-29 13:51 ` Ian Molton
2009-07-29 20:17 ` Paul Mundt
2009-07-29 20:55 ` pHilipp Zabel
2009-07-29 21:03 ` Paul Mundt
2009-07-30 9:59 ` Ian Molton
2009-07-30 10:56 ` Guennadi Liakhovetski
2009-07-30 19:21 ` Ian Molton
2009-07-31 6:55 ` Guennadi Liakhovetski
2009-08-03 18:51 ` Ian Molton
2009-08-05 13:33 ` Guennadi Liakhovetski
2009-08-05 14:10 ` Ian Molton
2009-08-03 2:52 ` Magnus Damm
2009-08-04 18:21 ` Ian Molton
2009-08-05 2:08 ` Magnus Damm
2009-08-05 12:07 ` Ian Molton
2009-08-05 13:34 ` Ian Molton
2009-08-05 19:44 ` Guennadi Liakhovetski
2009-08-05 22:34 ` Ian Molton
2009-08-05 22:53 ` Guennadi Liakhovetski
2009-08-05 23:06 ` Ian Molton
2009-08-18 8:40 ` Magnus Damm [this message]
2009-08-09 19:10 ` MMC / MFD / Clocks Ian Molton
2009-08-10 3:48 ` Magnus Damm
2009-08-05 14:02 ` Example idea for how to solve the clock/cnf problem Ian Molton
2009-08-05 22:43 ` Ian Molton
2009-09-02 10:44 ` Magnus Damm
2009-07-30 19:33 ` MMC: Make the configuration memory resource optional Ian Molton
2009-07-29 13:11 ` Mark Brown
2009-07-29 12:59 ` Mark Brown
2009-07-29 12:37 ` Ian Molton
2009-07-29 7:31 ` Paul Mundt
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=aec7e5c30908180140n3d46c9c0i33560b2e09ad3f9d@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=drzeus@drzeus.cx \
--cc=g.liakhovetski@gmx.de \
--cc=ian@mnementh.co.uk \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=philipp.zabel@gmail.com \
/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
all inboxes | Powered by JetHome®