From: Reinhard Meyer <u-boot@emk-elektronik.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH RFC]: mmc: Add multi-block support
Date: Fri, 15 Oct 2010 06:49:36 +0200 [thread overview]
Message-ID: <4CB7DD60.4010007@emk-elektronik.de> (raw)
In-Reply-To: <1287094363.7756.50.camel@quadra>
Dear Steve Sakoman,
> From: Alagu Sankar<alagusankar@embwise.com>
>
> This patch adds multi-block read support for generic MMC. It also modifies
> existing multi-block write to limit the maximum number of blocks per transfer.
> A new member is added in the mmc structure for the host controller to specify
> the maximum number of blocks it supports.
>
> Signed-off-by: Alagu Sankar<alagusankar@embwise.com>
> Acked-by: Steve Sakoman<steve.sakoman@linaro.org>
> Tested-by: Steve Sakoman<steve.sakoman@linaro.org>
> +static ulong
> +mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void *src)
> +{
> + int err;
> + int i;
> + struct mmc *mmc = find_mmc_device(dev_num);
> + uint b_max = mmc->b_max;
> +
> + if (!mmc)
> + return 0;
> +
> + for (i = blkcnt; i> 0; i -= b_max) {
> + uint blocks = (i> b_max) ? b_max : i;
I feel that all vars dealing with #blocks (b_max, i) should be lbaint_t too,
not a mixture of int, uint... (i -= b_max) would have to be rephrased, then.
That would apply to the parameters of the *_blocks functions as well...
Have a look at Lei Wen's patch of 2 days ago in this matter:
[PATCH V4] mmc: seperate block number into small parts for multi-write cmd
> + if (mmc->b_max == 0)
> + mmc->b_max = 1;
Currently some of the mmc low level drivers do not clear the structure,
so unfortunately this would fail. That should be corrected in the drivers,
of course.
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -274,6 +274,7 @@ struct mmc {
> struct mmc_cmd *cmd, struct mmc_data *data);
> void (*set_ios)(struct mmc *mmc);
> int (*init)(struct mmc *mmc);
> + uint b_max;
lbaint_t b_max ?
Best Regards,
Reinhard
next prev parent reply other threads:[~2010-10-15 4:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-14 22:12 [U-Boot] [PATCH RFC]: mmc: Add multi-block support Steve Sakoman
2010-10-15 4:49 ` Reinhard Meyer [this message]
2010-10-16 2:37 ` Lei Wen
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=4CB7DD60.4010007@emk-elektronik.de \
--to=u-boot@emk-elektronik.de \
--cc=u-boot@lists.denx.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