diff mbox

[U-Boot,v2,7/9] am33xx: support ti814x mmc reference clock

Message ID 1362101393-5131-8-git-send-email-mporter@ti.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Matt Porter March 1, 2013, 1:29 a.m. UTC
TI814x has a 192MHz hsmmc reference clock. Select that clock rate
when building for TI814x.

Signed-off-by: Matt Porter <mporter@ti.com>

---
v2: no changes, new to the series
---
 arch/arm/include/asm/arch-am33xx/mmc_host_def.h |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Tom Rini March 1, 2013, 9:14 p.m. UTC | #1
On Thu, Feb 28, 2013 at 08:29:51PM -0500, Matt Porter wrote:

> TI814x has a 192MHz hsmmc reference clock. Select that clock rate
> when building for TI814x.
> 
> Signed-off-by: Matt Porter <mporter@ti.com>

Reviewed-by: Tom Rini <trini@ti.com>
Peter Korsgaard March 3, 2013, 10:34 p.m. UTC | #2
>>>>> "Matt" == Matt Porter <mporter@ti.com> writes:

 Matt> TI814x has a 192MHz hsmmc reference clock. Select that clock rate
 Matt> when building for TI814x.

 Matt> Signed-off-by: Matt Porter <mporter@ti.com>

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

Did you figure out why it was working for you with 96 MHz ref?

 Matt> ---
 Matt> v2: no changes, new to the series
 Matt> ---
 Matt>  arch/arm/include/asm/arch-am33xx/mmc_host_def.h |    4 ++++
 Matt>  1 file changed, 4 insertions(+)

 Matt> diff --git a/arch/arm/include/asm/arch-am33xx/mmc_host_def.h b/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
 Matt> index 1f597c0..e0a3b8b 100644
 Matt> --- a/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
 Matt> +++ b/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
 Matt> @@ -153,7 +153,11 @@ typedef struct hsmmc {
 Matt>  #define MMC_CMD0	(INDEX(0) | RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
 
 Matt>  /* Clock Configurations and Macros */
 Matt> +#ifdef CONFIG_AM33XX
 Matt>  #define MMC_CLOCK_REFERENCE	96 /* MHz */
 Matt> +#elif defined(CONFIG_TI814X)
 Matt> +#define MMC_CLOCK_REFERENCE	192 /* MHz */
 Matt> +#endif
 
 Matt>  #define mmc_reg_out(addr, mask, val)\
 Matt>  	writel((readl(addr) & (~(mask))) | ((val) & (mask)), (addr))
 Matt> -- 
 Matt> 1.7.9.5
Matt Porter March 4, 2013, 1:57 p.m. UTC | #3
On Sun, Mar 03, 2013 at 10:34:08PM +0000, Peter Korsgaard wrote:
> >>>>> "Matt" == Matt Porter <mporter@ti.com> writes:
> 
>  Matt> TI814x has a 192MHz hsmmc reference clock. Select that clock rate
>  Matt> when building for TI814x.
> 
>  Matt> Signed-off-by: Matt Porter <mporter@ti.com>
> 
> Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
> 
> Did you figure out why it was working for you with 96 MHz ref?

Unfortunately not at a root cause level. Unless I'm missing something I
would have expected the calculations from the supplied 96 MHz ref clock
to result in 2x the clock the SD card can handle due to the incorrect
divider. However, with the LA attached, I found that a 2-3 MHz SDCLK was
being generated after the capability probe occurs. Odd and incorrect,
but functional. After switching to 192MHz I was able to sample a
nominal 25MHz SDCLK as expected on a regular SD card advertising that as
its capability. I don't like it but I'm going to mark this down as
"something undocumented" as I only have PG1.0 silicon but can't find an
errata sheet for that version right now.

-Matt
Peter Korsgaard March 4, 2013, 2:04 p.m. UTC | #4
>>>>> "Matt" == Matt Porter <mporter@ti.com> writes:

Hi,

 >> Did you figure out why it was working for you with 96 MHz ref?

 Matt> Unfortunately not at a root cause level. Unless I'm missing
 Matt> something I would have expected the calculations from the
 Matt> supplied 96 MHz ref clock to result in 2x the clock the SD card
 Matt> can handle due to the incorrect divider. However, with the LA
 Matt> attached, I found that a 2-3 MHz SDCLK was being generated after
 Matt> the capability probe occurs. Odd and incorrect, but
 Matt> functional. After switching to 192MHz I was able to sample a
 Matt> nominal 25MHz SDCLK as expected on a regular SD card advertising
 Matt> that as its capability. I don't like it but I'm going to mark
 Matt> this down as "something undocumented" as I only have PG1.0
 Matt> silicon but can't find an errata sheet for that version right
 Matt> now.

Ok, thanks for the info.
diff mbox

Patch

diff --git a/arch/arm/include/asm/arch-am33xx/mmc_host_def.h b/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
index 1f597c0..e0a3b8b 100644
--- a/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
+++ b/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
@@ -153,7 +153,11 @@  typedef struct hsmmc {
 #define MMC_CMD0	(INDEX(0) | RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
 
 /* Clock Configurations and Macros */
+#ifdef CONFIG_AM33XX
 #define MMC_CLOCK_REFERENCE	96 /* MHz */
+#elif defined(CONFIG_TI814X)
+#define MMC_CLOCK_REFERENCE	192 /* MHz */
+#endif
 
 #define mmc_reg_out(addr, mask, val)\
 	writel((readl(addr) & (~(mask))) | ((val) & (mask)), (addr))