From: Markus Pietrek <markus.pietrek@emtrion.de>
To: linux-sh@vger.kernel.org
Subject: [PATCH] drivers/mfd/sh_mobile_sdhi.c: uses optimized block transfer
Date: Thu, 15 Jul 2010 12:50:59 +0000 [thread overview]
Message-ID: <4C3F0433.8010005@emtrion.de> (raw)
On the SH7723, these settings improve PIO reads from 4MB/s to 13MB/s and writes from 1MB/s to 4.1MB/s
Signed-off-by: Markus Pietrek <markus.pietrek@emtrion.de>
---
drivers/mfd/sh_mobile_sdhi.c | 9 +++++++++
drivers/mmc/host/tmio_mmc.c | 14 ++++++++++++++
include/linux/mfd/tmio.h | 9 +++++++++
3 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c
index cd16459..0bd80a3 100644
--- a/drivers/mfd/sh_mobile_sdhi.c
+++ b/drivers/mfd/sh_mobile_sdhi.c
@@ -107,6 +107,15 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
mmc_data->hclk = clk_get_rate(priv->clk);
mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
+
+ /* values are taken from the firmware based sh_sdhi.c driver */
+ mmc_data->max_hw_segs = 32;
+ mmc_data->max_phys_segs = 32;
+ mmc_data->max_blk_count = 65535; /* actually it's 65536, but the value 65536 is handled differently and we want to keep the code simple */
+ mmc_data->max_req_size = 131072;
+ mmc_data->max_seg_size = mmc_data->max_req_size;
+ mmc_data->max_blk_size = mmc_data->max_blk_size;
+
if (p) {
mmc_data->flags = p->tmio_flags;
mmc_data->ocr_mask = p->tmio_ocr_mask;
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index ee7d0a5..cdb3a6a 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -847,6 +847,20 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
mmc->caps |= pdata->capabilities;
mmc->f_max = pdata->hclk;
mmc->f_min = mmc->f_max / 512;
+
+ if (pdata->max_hw_segs)
+ mmc->max_hw_segs = pdata->max_hw_segs;
+ if (pdata->max_phys_segs)
+ mmc->max_phys_segs = pdata->max_phys_segs;
+ if (pdata->max_seg_size)
+ mmc->max_seg_size = pdata->max_seg_size;
+ if (pdata->max_req_size)
+ mmc->max_req_size = pdata->max_req_size;
+ if (pdata->max_blk_size)
+ mmc->max_blk_size = pdata->max_blk_size;
+ if (pdata->max_blk_count)
+ mmc->max_blk_count = pdata->max_blk_count;
+
if (pdata->ocr_mask)
mmc->ocr_avail = pdata->ocr_mask;
else
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index f07425b..4eb7358 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -71,6 +71,15 @@ struct tmio_mmc_data {
unsigned long capabilities;
unsigned long flags;
u32 ocr_mask; /* available voltages */
+
+ /* overrides for "struct mmc_host" variables */
+ unsigned int max_seg_size;
+ unsigned short max_hw_segs;
+ unsigned short max_phys_segs;
+ unsigned int max_req_size;
+ unsigned int max_blk_size;
+ unsigned int max_blk_count;
+
struct tmio_mmc_dma *dma;
void (*set_pwr)(struct platform_device *host, int state);
void (*set_clk_div)(struct platform_device *host, int state);
--
1.7.0.4
_____________________________________
Amtsgericht Mannheim
HRB 110 300
Geschäftsführer: Dieter Baur, Ramona Maurer
_____________________________________
Important Note:
- This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information.
- If you have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited.
- Please inform us immediately and destroy the original transmittal.
Thank you for your cooperation.
next reply other threads:[~2010-07-15 12:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-15 12:50 Markus Pietrek [this message]
2010-07-20 6:32 ` [PATCH] drivers/mfd/sh_mobile_sdhi.c: uses optimized block Yusuke Goda
2010-07-20 7:16 ` AW: " Pietrek, Markus
2010-07-20 8:46 ` Yusuke Goda
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=4C3F0433.8010005@emtrion.de \
--to=markus.pietrek@emtrion.de \
--cc=linux-sh@vger.kernel.org \
/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.