diff mbox

U-boot: MMC: s5p_mmc.c: Resolved Interrupt Error druring mmc_init

Message ID 1300687062-18593-1-git-send-email-chander.kashyap@linaro.org
State Superseded
Headers show

Commit Message

Chander Kashyap March 21, 2011, 5:57 a.m. UTC
Blocksize was hardcoded to 512 Bytes.
	It is now calculated based upon the request by mmc subsystem.

Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
---
 drivers/mmc/s5p_mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Scott Bambrough March 21, 2011, 10:41 a.m. UTC | #1
On Mon, 2011-03-21 at 11:27 +0530, Chander Kashyap wrote:
> 	Blocksize was hardcoded to 512 Bytes.
> 	It is now calculated based upon the request by mmc subsystem.
> 
> Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
> ---
>  drivers/mmc/s5p_mmc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
> index 195b5be..0323800 100644
> --- a/drivers/mmc/s5p_mmc.c
> +++ b/drivers/mmc/s5p_mmc.c
> @@ -51,7 +51,7 @@ static void mmc_prepare_data(struct mmc_host *host, struct mmc_data *data)
>  	writeb(ctrl, &host->reg->hostctl);

>  
>  	/* We do not handle DMA boundaries, so set it to max (512 KiB) */
What about this comment?  It states the blocksize was set to 512, due to
not handling DMA boundaries.  Is the comment invalid, or have you set
things up for an odd failure mode later?

> -	writew((7 << 12) | (512 << 0), &host->reg->blksize);
> +	writew((7 << 12) | (data->blocksize & 0xFFF), &host->reg->blksize);
>  	writew(data->blocks, &host->reg->blkcnt);
>  }
>
Chander Kashyap March 21, 2011, 12:38 p.m. UTC | #2
Hi Scott, Comment is right.
512KiB boundary is set by (7 << 12).

regards,
Chander

On 21 March 2011 16:11, Scott Bambrough <scott.bambrough@linaro.org> wrote:

> On Mon, 2011-03-21 at 11:27 +0530, Chander Kashyap wrote:
> >       Blocksize was hardcoded to 512 Bytes.
> >       It is now calculated based upon the request by mmc subsystem.
> >
> > Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
> > ---
> >  drivers/mmc/s5p_mmc.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
> > index 195b5be..0323800 100644
> > --- a/drivers/mmc/s5p_mmc.c
> > +++ b/drivers/mmc/s5p_mmc.c
> > @@ -51,7 +51,7 @@ static void mmc_prepare_data(struct mmc_host *host,
> struct mmc_data *data)
> >       writeb(ctrl, &host->reg->hostctl);
>
> >
> >       /* We do not handle DMA boundaries, so set it to max (512 KiB) */
> What about this comment?  It states the blocksize was set to 512, due to
> not handling DMA boundaries.  Is the comment invalid, or have you set
> things up for an odd failure mode later?
>
> > -     writew((7 << 12) | (512 << 0), &host->reg->blksize);
> > +     writew((7 << 12) | (data->blocksize & 0xFFF), &host->reg->blksize);
> >       writew(data->blocks, &host->reg->blkcnt);
> >  }
> >
>
> --
> Scott Bambrough <scott.bambrough@linaro.org>
> Technical Director, Linaro Landing Teams
>
>
diff mbox

Patch

diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
index 195b5be..0323800 100644
--- a/drivers/mmc/s5p_mmc.c
+++ b/drivers/mmc/s5p_mmc.c
@@ -51,7 +51,7 @@  static void mmc_prepare_data(struct mmc_host *host, struct mmc_data *data)
 	writeb(ctrl, &host->reg->hostctl);
 
 	/* We do not handle DMA boundaries, so set it to max (512 KiB) */
-	writew((7 << 12) | (512 << 0), &host->reg->blksize);
+	writew((7 << 12) | (data->blocksize & 0xFFF), &host->reg->blksize);
 	writew(data->blocks, &host->reg->blkcnt);
 }