From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 10/13] mci: align data for commands
Date: Fri, 22 Oct 2010 15:15:28 +0200 [thread overview]
Message-ID: <1287753331-7696-11-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1287753331-7696-1-git-send-email-s.hauer@pengutronix.de>
Some mci controllers cannot transfer data with their DMA engines
if the data is not sufficiently aligned. Normally this is a driver
problem, but hey, we have no problem aligning the data and keep
the burden from the drivers.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Juergen Beisert <jbe@pengutronix.de>
---
drivers/mci/mci-core.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 34c4f8c..6f31cca 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -347,7 +347,7 @@ static int mci_switch(struct device_d *mci_dev, unsigned set, unsigned index,
static int mmc_change_freq(struct device_d *mci_dev)
{
struct mci *mci = GET_MCI_DATA(mci_dev);
- char ext_csd[512];
+ char *ext_csd = sector_buf;
char cardtype;
int err;
@@ -439,8 +439,8 @@ static int sd_change_freq(struct device_d *mci_dev)
struct mci *mci = GET_MCI_DATA(mci_dev);
struct mci_cmd cmd;
struct mci_data data;
- uint32_t switch_status[16];
- uint scr[2];
+ uint32_t *switch_status = sector_buf;
+ uint32_t *scr = sector_buf;
int timeout;
int err;
@@ -461,7 +461,7 @@ static int sd_change_freq(struct device_d *mci_dev)
retry_scr:
pr_debug("Trying to read the SCR (try %d of %d)\n", 4 - timeout, 3);
- data.dest = (char *)&scr;
+ data.dest = (char *)scr;
data.blocksize = 8;
data.blocks = 1;
data.flags = MMC_DATA_READ;
@@ -502,7 +502,7 @@ retry_scr:
timeout = 4;
while (timeout--) {
err = sd_switch(mci_dev, SD_SWITCH_CHECK, 0, 1,
- (uint8_t*)&switch_status);
+ (uint8_t*)switch_status);
if (err) {
pr_debug("Checking SD transfer switch frequency feature failed: %d\n", err);
return err;
@@ -520,7 +520,7 @@ retry_scr:
if (!(__be32_to_cpu(switch_status[3]) & SD_HIGHSPEED_SUPPORTED))
return 0;
- err = sd_switch(mci_dev, SD_SWITCH_SWITCH, 0, 1, (uint8_t*)&switch_status);
+ err = sd_switch(mci_dev, SD_SWITCH_SWITCH, 0, 1, (uint8_t*)switch_status);
if (err) {
pr_debug("Switching SD transfer frequency failed: %d\n", err);
return err;
--
1.7.2.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2010-10-22 13:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-22 13:15 more patches for next Sascha Hauer
2010-10-22 13:15 ` [PATCH 01/13] ARM pca100: Use a flash bbt Sascha Hauer
2010-10-22 13:15 ` [PATCH 02/13] i.MX nand: optimize nand boot code for size Sascha Hauer
2010-10-22 13:15 ` [PATCH 03/13] mci-core: add multiple block support Sascha Hauer
2010-10-22 13:40 ` Juergen Beisert
2010-10-22 14:03 ` Juergen Beisert
2010-10-22 13:15 ` [PATCH 04/13] i.MX51: Fix mmcclk rate Sascha Hauer
2010-10-22 13:15 ` [PATCH 05/13] i.MX esdctl: Add register bits from redboot Sascha Hauer
2010-10-22 13:15 ` [PATCH 06/13] i.MX35 regs: Add watchdog base Sascha Hauer
2010-10-22 13:15 ` [PATCH 07/13] fb: i.MX IPU: remove unnecessary printf Sascha Hauer
2010-10-22 13:15 ` [PATCH 08/13] fb: i.MX IPU: move fb_info initialization to a single function Sascha Hauer
2010-10-22 13:15 ` [PATCH 09/13] fb: i.MX IPU: fold mx3fb_set_par into its only user Sascha Hauer
2010-10-22 13:15 ` Sascha Hauer [this message]
2010-10-22 13:41 ` [PATCH 10/13] mci: align data for commands Juergen Beisert
2010-10-22 13:15 ` [PATCH 11/13] ARM: Add Garz+Fricke Cupid board support Sascha Hauer
2010-10-22 13:15 ` [PATCH 12/13] defaultenv: fix mtdparts Sascha Hauer
2010-10-22 13:15 ` [PATCH 13/13] ARM: Add defconfig for Garz+Fricke cupid board Sascha Hauer
2010-10-26 9:20 ` more patches for next Juergen Beisert
2010-10-26 9:48 ` Marc Kleine-Budde
2010-10-26 18:58 ` Sascha Hauer
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=1287753331-7696-11-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox