All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon@horms.net>
To: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org
Cc: Yusuke Goda <yusuke.goda.sx@renesas.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Chris Ball <cjb@laptop.org>, Paul Mundt <lethal@linux-sh.org>
Subject: Re: [PATCH 3/3] sh, mmc: Use defines when setting CE_CLK_CTRL
Date: Sat, 27 Nov 2010 09:01:10 +0900	[thread overview]
Message-ID: <20101127000109.GA29427@verge.net.au> (raw)
In-Reply-To: <1290812579-20410-3-git-send-email-horms@verge.net.au>

On Sat, Nov 27, 2010 at 08:02:59AM +0900, Simon Horman wrote:
> The 16-19th bits of CE_CLK_CTRL set the
> MMC clock frequency.
> 
> Cc: Yusuke Goda <yusuke.goda.sx@renesas.com>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>  include/linux/mmc/sh_mmcif.h |   19 +++++++++++--------
>  1 files changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
> index 519a2cd..adf9dba 100644
> --- a/include/linux/mmc/sh_mmcif.h
> +++ b/include/linux/mmc/sh_mmcif.h
> @@ -77,6 +77,9 @@ struct sh_mmcif_plat_data {
>  #define CLK_ENABLE		(1 << 24) /* 1: output mmc clock */
>  #define CLK_CLEAR		((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16))
>  #define CLK_SUP_PCLK		((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16))
> +#define CLKDIV_4		(1<<16) /* mmc clock frequency.
> +					 * n: bus clock/(2^(n+1)) */
> +#define CLKDIV_256		(7<<16) /* mmc clock frequency. (see above) */
>  #define SRSPTO_256		((1 << 13) | (0 << 12)) /* resp timeout */
>  #define SRBSYTO_29		((1 << 11) | (1 << 10) |	\
>  				 (1 << 9) | (1 << 8)) /* resp busy timeout */
> @@ -185,14 +188,10 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
>  	/* Set block size in MMCIF hardware */
>  	sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS);
>  
> -	/* Enable the clock, set it to Bus clock/256 (about 325Khz).
> -	 * It is unclear where 0x70000 comes from or if it is even needed.
> -	 * It is there for byte-compatibility with code that is known to
> -	 * work.
> -	 */
> +	/* Enable the clock, set it to Bus clock/256 (about 325Khz). */
>  	sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
> -			CLK_ENABLE | SRSPTO_256 | SRBSYTO_29 | SRWDTO_29 |
> -			SCCSTO_29 | 0x70000);
> +			CLK_ENABLE | CLKDIV_256 | SRSPTO_256 |
> +			SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
>  
>  	/* CMD0 */
>  	sh_mmcif_boot_cmd(base, 0x00000040, 0);
> @@ -216,8 +215,12 @@ static inline void sh_mmcif_boot_slurp(void __iomem *base,
>  {
>  	unsigned long tmp;
>  
> +	return;

Sorry, this line is bogus and crept in as part of some
other testing. I will repost this patch.

> +
>  	/* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */
> -	sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 0x01012fff);
> +	sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
> +			CLK_ENABLE | CLKDIV_4 | SRSPTO_256 |
> +			SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
>  
>  	/* CMD9 - Get CSD */
>  	sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000);
> -- 
> 1.7.2.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Simon Horman                                                simon@horms.net
Horms Solutions Ltd.                                          www.horms.net
1701 Emblem Court Akashicho, 6-13 Akashicho, Chuo-ku, Tokyo 104-0044, Japan
Phone: +81 3 6365 5977                                 Fax: +81 3 6673 4268


WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <simon@horms.net>
To: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org
Cc: Yusuke Goda <yusuke.goda.sx@renesas.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Chris Ball <cjb@laptop.org>, Paul Mundt <lethal@linux-sh.org>
Subject: Re: [PATCH 3/3] sh, mmc: Use defines when setting CE_CLK_CTRL
Date: Sat, 27 Nov 2010 00:01:10 +0000	[thread overview]
Message-ID: <20101127000109.GA29427@verge.net.au> (raw)
In-Reply-To: <1290812579-20410-3-git-send-email-horms@verge.net.au>

On Sat, Nov 27, 2010 at 08:02:59AM +0900, Simon Horman wrote:
> The 16-19th bits of CE_CLK_CTRL set the
> MMC clock frequency.
> 
> Cc: Yusuke Goda <yusuke.goda.sx@renesas.com>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>  include/linux/mmc/sh_mmcif.h |   19 +++++++++++--------
>  1 files changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
> index 519a2cd..adf9dba 100644
> --- a/include/linux/mmc/sh_mmcif.h
> +++ b/include/linux/mmc/sh_mmcif.h
> @@ -77,6 +77,9 @@ struct sh_mmcif_plat_data {
>  #define CLK_ENABLE		(1 << 24) /* 1: output mmc clock */
>  #define CLK_CLEAR		((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16))
>  #define CLK_SUP_PCLK		((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16))
> +#define CLKDIV_4		(1<<16) /* mmc clock frequency.
> +					 * n: bus clock/(2^(n+1)) */
> +#define CLKDIV_256		(7<<16) /* mmc clock frequency. (see above) */
>  #define SRSPTO_256		((1 << 13) | (0 << 12)) /* resp timeout */
>  #define SRBSYTO_29		((1 << 11) | (1 << 10) |	\
>  				 (1 << 9) | (1 << 8)) /* resp busy timeout */
> @@ -185,14 +188,10 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
>  	/* Set block size in MMCIF hardware */
>  	sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS);
>  
> -	/* Enable the clock, set it to Bus clock/256 (about 325Khz).
> -	 * It is unclear where 0x70000 comes from or if it is even needed.
> -	 * It is there for byte-compatibility with code that is known to
> -	 * work.
> -	 */
> +	/* Enable the clock, set it to Bus clock/256 (about 325Khz). */
>  	sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
> -			CLK_ENABLE | SRSPTO_256 | SRBSYTO_29 | SRWDTO_29 |
> -			SCCSTO_29 | 0x70000);
> +			CLK_ENABLE | CLKDIV_256 | SRSPTO_256 |
> +			SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
>  
>  	/* CMD0 */
>  	sh_mmcif_boot_cmd(base, 0x00000040, 0);
> @@ -216,8 +215,12 @@ static inline void sh_mmcif_boot_slurp(void __iomem *base,
>  {
>  	unsigned long tmp;
>  
> +	return;

Sorry, this line is bogus and crept in as part of some
other testing. I will repost this patch.

> +
>  	/* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */
> -	sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 0x01012fff);
> +	sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
> +			CLK_ENABLE | CLKDIV_4 | SRSPTO_256 |
> +			SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
>  
>  	/* CMD9 - Get CSD */
>  	sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000);
> -- 
> 1.7.2.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Simon Horman                                                simon@horms.net
Horms Solutions Ltd.                                          www.horms.net
1701 Emblem Court Akashicho, 6-13 Akashicho, Chuo-ku, Tokyo 104-0044, Japan
Phone: +81 3 6365 5977                                 Fax: +81 3 6673 4268


  reply	other threads:[~2010-11-27  0:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-26 23:02 [PATCH 1/3] sh, mmc: Make mmcif_update_progress static inline Simon Horman
2010-11-26 23:02 ` Simon Horman
2010-11-26 23:02 ` [PATCH 2/3] mmc, sh: Correct value for reset Simon Horman
2010-11-26 23:02   ` Simon Horman
2010-11-26 23:02 ` [PATCH 3/3] sh, mmc: Use defines when setting CE_CLK_CTRL Simon Horman
2010-11-26 23:02   ` Simon Horman
2010-11-27  0:01   ` Simon Horman [this message]
2010-11-27  0:01     ` Simon Horman
2010-11-27  0:11     ` [PATCH 3/3 v2] " Simon Horman
2010-11-27  0:11       ` Simon Horman
2010-11-27 11:54       ` Michał Mirosław
2010-11-27 11:54         ` Michał Mirosław
2010-11-27 21:17         ` Simon Horman
2010-11-27 21:17           ` Simon Horman
2010-11-29  3:55 ` [PATCH 1/3] sh, mmc: Make mmcif_update_progress static inline Paul Mundt
2010-11-29  3:55   ` 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=20101127000109.GA29427@verge.net.au \
    --to=simon@horms.net \
    --cc=cjb@laptop.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=yusuke.goda.sx@renesas.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 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.