[U-Boot] [PATCH v2 1/1] ARM: kirkwood: mvebu_mmc: Speed up access time

Review delays and timeouts. Get around 20 x faster access on Sheevaplug tests.
Changes in v2: - increase number of loops - remove initial delay
Changes in v1: - review all loops, delays and timeouts
Signed-off-by: Gérald Kerma drEagle@doukki.net --- drivers/mmc/mvebu_mmc.c | 66 +++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 27 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 9f98c3f..b636be6 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -23,6 +23,10 @@ DECLARE_GLOBAL_DATA_PTR;
#define MVEBU_TARGET_DRAM 0
+#define TIMEOUT_LOOP 1000000000000000000 /* maximum loops */ +#define TIMEOUT_WAIT 100 /* wait 100 us */ +#define TIMEOUT_START 100 /* wait 100 us */ + static void mvebu_mmc_write(u32 offs, u32 val) { writel(val, CONFIG_SYS_MMC_BASE + (offs)); @@ -63,7 +67,7 @@ static int mvebu_mmc_setup_data(struct mmc_data *data) static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) { - int timeout = 10; + u64 timeout = TIMEOUT_LOOP; ushort waittype = 0; ushort resptype = 0; ushort xfertype = 0; @@ -72,27 +76,32 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, debug("cmdidx [0x%x] resp_type[0x%x] cmdarg[0x%x]\n", cmd->cmdidx, cmd->resp_type, cmd->cmdarg);
- udelay(10*1000); - debug("%s: cmd %d (hw state 0x%04x)\n", DRIVER_NAME, cmd->cmdidx, mvebu_mmc_read(SDIO_HW_STATE));
+ /* Clear status */ + mvebu_mmc_write(SDIO_NOR_INTR_STATUS, SDIO_POLL_MASK); + mvebu_mmc_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK); + /* Checking if card is busy */ while ((mvebu_mmc_read(SDIO_HW_STATE) & CARD_BUSY)) { + timeout--; + udelay(TIMEOUT_START); if (timeout == 0) { printf("%s: card busy!\n", DRIVER_NAME); return -1; } - timeout--; - udelay(1000); }
/* Set up for a data transfer if we have one */ if (data) { int err = mvebu_mmc_setup_data(data);
- if (err) + if (err){ + debug("%s: command DATA error :%x\n", + DRIVER_NAME, err); return err; + } }
resptype = SDIO_CMD_INDEX(cmd->cmdidx); @@ -148,7 +157,7 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, mvebu_mmc_write(SDIO_ERR_INTR_EN, SDIO_POLL_MASK);
/* Waiting for completion */ - timeout = 1000000; + timeout = TIMEOUT_LOOP;
while (!((mvebu_mmc_read(SDIO_NOR_INTR_STATUS)) & waittype)) { if (mvebu_mmc_read(SDIO_NOR_INTR_STATUS) & SDIO_NOR_ERROR) { @@ -156,21 +165,22 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, DRIVER_NAME, cmd->cmdidx, mvebu_mmc_read(SDIO_ERR_INTR_STATUS)); if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) & - (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) + (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)){ + debug("%s: command READ timed out\n", + DRIVER_NAME); return TIMEOUT; + } + debug("%s: command READ error\n", DRIVER_NAME); return COMM_ERR; }
timeout--; - udelay(1); - if (timeout <= 0) { - printf("%s: command timed out\n", DRIVER_NAME); + udelay(TIMEOUT_WAIT); + if (timeout == 0) { + debug("%s: command timed out\n", DRIVER_NAME); return TIMEOUT; } } - if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) & - (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) - return TIMEOUT;
/* Handling response */ if (cmd->resp_type & MMC_RSP_136) { @@ -213,6 +223,11 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, debug("[0x%x] ", cmd->response[3]); debug("\n");
+ if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) & SDIO_ERR_CMD_TIMEOUT){ + debug("%s: command STATUS timed out\n", DRIVER_NAME); + return TIMEOUT; + } + return 0; }
@@ -236,33 +251,30 @@ static void mvebu_mmc_power_up(void) /* enable interrupts status */ mvebu_mmc_write(SDIO_NOR_INTR_STATUS, SDIO_POLL_MASK); mvebu_mmc_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK); + + udelay(10*1000); }
static void mvebu_mmc_set_clk(unsigned int clock) { - unsigned int m; - if (clock == 0) { debug("%s: clock off\n", DRIVER_NAME); mvebu_mmc_write(SDIO_XFER_MODE, SDIO_XFER_MODE_STOP_CLK); mvebu_mmc_write(SDIO_CLK_DIV, MVEBU_MMC_BASE_DIV_MAX); } else { - m = MVEBU_MMC_BASE_FAST_CLOCK/(2*clock) - 1; + u32 m = DIV_ROUND_UP(MVEBU_MMC_BASE_FAST_CLOCK, + (2 * clock)) - 1; if (m > MVEBU_MMC_BASE_DIV_MAX) m = MVEBU_MMC_BASE_DIV_MAX; - mvebu_mmc_write(SDIO_CLK_DIV, m & MVEBU_MMC_BASE_DIV_MAX); + mvebu_mmc_write(SDIO_CLK_DIV, m); + debug("%s: clock (%d) div : %d\n", DRIVER_NAME, clock, m); } - - udelay(10*1000); }
static void mvebu_mmc_set_bus(unsigned int bus) { u32 ctrl_reg = 0;
- ctrl_reg = mvebu_mmc_read(SDIO_HOST_CTRL); - ctrl_reg &= ~SDIO_HOST_CTRL_DATA_WIDTH_4_BITS; - switch (bus) { case 4: ctrl_reg |= SDIO_HOST_CTRL_DATA_WIDTH_4_BITS; @@ -277,7 +289,7 @@ static void mvebu_mmc_set_bus(unsigned int bus) ctrl_reg &= ~SDIO_HOST_CTRL_LSB_FIRST;
/* default to maximum timeout */ - ctrl_reg |= SDIO_HOST_CTRL_TMOUT(SDIO_HOST_CTRL_TMOUT_MAX); + ctrl_reg |= SDIO_HOST_CTRL_TMOUT_MAX; ctrl_reg |= SDIO_HOST_CTRL_TMOUT_EN;
ctrl_reg |= SDIO_HOST_CTRL_PUSH_PULL_EN; @@ -293,7 +305,6 @@ static void mvebu_mmc_set_bus(unsigned int bus) "high-speed" : "");
mvebu_mmc_write(SDIO_HOST_CTRL, ctrl_reg); - udelay(10*1000); }
static void mvebu_mmc_set_ios(struct mmc *mmc) @@ -355,7 +366,7 @@ static void mvebu_window_setup(void)
static int mvebu_mmc_initialize(struct mmc *mmc) { - debug("%s: mvebu_mmc_initialize", DRIVER_NAME); + debug("%s: mvebu_mmc_initialize\n", DRIVER_NAME);
/* * Setting host parameters @@ -398,7 +409,8 @@ static const struct mmc_ops mvebu_mmc_ops = { static struct mmc_config mvebu_mmc_cfg = { .name = DRIVER_NAME, .ops = &mvebu_mmc_ops, - .f_min = MVEBU_MMC_BASE_FAST_CLOCK / MVEBU_MMC_BASE_DIV_MAX, + .f_min = DIV_ROUND_UP(MVEBU_MMC_BASE_FAST_CLOCK, + MVEBU_MMC_BASE_DIV_MAX), .f_max = MVEBU_MMC_CLOCKRATE_MAX, .voltages = MMC_VDD_32_33 | MMC_VDD_33_34, .host_caps = MMC_MODE_4BIT | MMC_MODE_HS | MMC_MODE_HC |

This serie of patches speed up access time of MVEBUMMC driver
This is allowed by a fix in MVEBUMMC init status check inspired from linux MVSDIO driver. * Hardware weirdness. The FIFO_EMPTY bit of the HW_STATE * register is sometimes not set before a while when some * "unusual" data block sizes are used (such as with the SWITCH * command), even despite the fact that the XFER_DONE interrupt * was raised. And if another data transfer starts before * this bit comes to good sense (which eventually happens by * itself) then the new transfer simply fails with a timeout.
It allows about 10x to 40x faster access time transfer on SHEEVAPLUG MMC It may also fixes some SD types incompatibilities
### before patch
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 977 ms (1.6 MiB/s)
### with fix
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 83 ms (18.5 MiB/s)
Gérald Kerma (6): MVEBUMMC : Change copyright date MVEBUMMC : Speed up access time MVEBUMMC : FIX debug strings MVEBUMMC : REMOVE unnecessary delays MVEBUMMC : CLEAN code MVEBUMMC : REMOVE unnecessary delay from init
drivers/mmc/mvebu_mmc.c | 103 ++++++++++++++++++++++++++++-------------------- include/mvebu_mmc.h | 1 + 2 files changed, 61 insertions(+), 43 deletions(-)

Signed-off-by: Gérald Kerma drEagle@doukki.net --- drivers/mmc/mvebu_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 9f98c3f..063d4da 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -1,7 +1,7 @@ /* * Marvell MMC/SD/SDIO driver * - * (C) Copyright 2012 + * (C) Copyright 2012-2014 * Marvell Semiconductor <www.marvell.com> * Written-by: Maen Suleiman, Gerald Kerma *

Hi Gérald,
On Dec 13, 2014, at 22:35 , Gérald Kerma drEagle@doukki.net wrote:
Signed-off-by: Gérald Kerma drEagle@doukki.net
drivers/mmc/mvebu_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 9f98c3f..063d4da 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -1,7 +1,7 @@ /*
- Marvell MMC/SD/SDIO driver
- (C) Copyright 2012
- (C) Copyright 2012-2014
- Marvell Semiconductor <www.marvell.com>
- Written-by: Maen Suleiman, Gerald Kerma
-- 2.1.3
Applied, thanks
— Pantelis

Get about 40x faster access on SHEEVAPLUG MMC Fix some SD type compatibility
Changes in v3: - fix the HW_STATE (from linux mvsdio) - review delays and timeouts
Changes in v2: - increase number of loops - remove initial delay
Changes in v1: - review all loops, delays and timeouts
Signed-off-by: Gérald Kerma drEagle@doukki.net --- drivers/mmc/mvebu_mmc.c | 48 +++++++++++++++++++++++++++++++----------------- include/mvebu_mmc.h | 1 + 2 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 063d4da..91a9be0 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -23,6 +23,8 @@ DECLARE_GLOBAL_DATA_PTR;
#define MVEBU_TARGET_DRAM 0
+#define TIMEOUT_DELAY 5*CONFIG_SYS_HZ /* wait 5 seconds */ + static void mvebu_mmc_write(u32 offs, u32 val) { writel(val, CONFIG_SYS_MMC_BASE + (offs)); @@ -63,7 +65,7 @@ static int mvebu_mmc_setup_data(struct mmc_data *data) static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) { - int timeout = 10; + ulong start; ushort waittype = 0; ushort resptype = 0; ushort xfertype = 0; @@ -72,19 +74,33 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, debug("cmdidx [0x%x] resp_type[0x%x] cmdarg[0x%x]\n", cmd->cmdidx, cmd->resp_type, cmd->cmdarg);
- udelay(10*1000); - debug("%s: cmd %d (hw state 0x%04x)\n", DRIVER_NAME, cmd->cmdidx, mvebu_mmc_read(SDIO_HW_STATE));
- /* Checking if card is busy */ - while ((mvebu_mmc_read(SDIO_HW_STATE) & CARD_BUSY)) { - if (timeout == 0) { - printf("%s: card busy!\n", DRIVER_NAME); - return -1; - } - timeout--; - udelay(1000); + /* + * Hardware weirdness. The FIFO_EMPTY bit of the HW_STATE + * register is sometimes not set before a while when some + * "unusual" data block sizes are used (such as with the SWITCH + * command), even despite the fact that the XFER_DONE interrupt + * was raised. And if another data transfer starts before + * this bit comes to good sense (which eventually happens by + * itself) then the new transfer simply fails with a timeout. + */ + if (!(mvebu_mmc_read(SDIO_HW_STATE) & CMD_FIFO_EMPTY)) { + ushort hw_state, count = 0; + + start = get_timer(0); + do { + hw_state = mvebu_mmc_read(SDIO_HW_STATE); + if ((get_timer(0) - start) > TIMEOUT_DELAY) { + printf("%s : FIFO_EMPTY bit missing\n", + DRIVER_NAME); + break; + } + count++; + } while (!(hw_state & CMD_FIFO_EMPTY)); + debug("%s *** wait for FIFO_EMPTY bit (hw=0x%04x, count=%d, jiffies=%ld)\n", + DRIVER_NAME, hw_state, count, (get_timer(0) - (start))); }
/* Set up for a data transfer if we have one */ @@ -147,8 +163,7 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, mvebu_mmc_write(SDIO_NOR_INTR_EN, SDIO_POLL_MASK); mvebu_mmc_write(SDIO_ERR_INTR_EN, SDIO_POLL_MASK);
- /* Waiting for completion */ - timeout = 1000000; + start = get_timer(0);
while (!((mvebu_mmc_read(SDIO_NOR_INTR_STATUS)) & waittype)) { if (mvebu_mmc_read(SDIO_NOR_INTR_STATUS) & SDIO_NOR_ERROR) { @@ -161,13 +176,12 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, return COMM_ERR; }
- timeout--; - udelay(1); - if (timeout <= 0) { - printf("%s: command timed out\n", DRIVER_NAME); + if ((get_timer(0) - start) > TIMEOUT_DELAY) { + debug("%s: command timed out\n", DRIVER_NAME); return TIMEOUT; } } + if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) & (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) return TIMEOUT; diff --git a/include/mvebu_mmc.h b/include/mvebu_mmc.h index 28d98fe..7fb71f7 100644 --- a/include/mvebu_mmc.h +++ b/include/mvebu_mmc.h @@ -79,6 +79,7 @@ #define CMD_INHIBIT (1 << 0) #define CMD_TXACTIVE (1 << 8) #define CMD_RXACTIVE (1 << 9) +#define CMD_FIFO_EMPTY (1 << 13) #define CMD_AUTOCMD12ACTIVE (1 << 14) #define CMD_BUS_BUSY (CMD_AUTOCMD12ACTIVE | \ CMD_RXACTIVE | \

Hi Gérald,
On Dec 13, 2014, at 22:35 , Gérald Kerma drEagle@doukki.net wrote:
Get about 40x faster access on SHEEVAPLUG MMC Fix some SD type compatibility
Changes in v3:
- fix the HW_STATE (from linux mvsdio)
- review delays and timeouts
Changes in v2:
- increase number of loops
- remove initial delay
Changes in v1:
- review all loops, delays and timeouts
Signed-off-by: Gérald Kerma drEagle@doukki.net
drivers/mmc/mvebu_mmc.c | 48 +++++++++++++++++++++++++++++++----------------- include/mvebu_mmc.h | 1 + 2 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 063d4da..91a9be0 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -23,6 +23,8 @@ DECLARE_GLOBAL_DATA_PTR;
#define MVEBU_TARGET_DRAM 0
+#define TIMEOUT_DELAY 5*CONFIG_SYS_HZ /* wait 5 seconds */
static void mvebu_mmc_write(u32 offs, u32 val) { writel(val, CONFIG_SYS_MMC_BASE + (offs)); @@ -63,7 +65,7 @@ static int mvebu_mmc_setup_data(struct mmc_data *data) static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) {
- int timeout = 10;
- ulong start; ushort waittype = 0; ushort resptype = 0; ushort xfertype = 0;
@@ -72,19 +74,33 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, debug("cmdidx [0x%x] resp_type[0x%x] cmdarg[0x%x]\n", cmd->cmdidx, cmd->resp_type, cmd->cmdarg);
udelay(10*1000);
debug("%s: cmd %d (hw state 0x%04x)\n", DRIVER_NAME, cmd->cmdidx, mvebu_mmc_read(SDIO_HW_STATE));
/* Checking if card is busy */
while ((mvebu_mmc_read(SDIO_HW_STATE) & CARD_BUSY)) {
if (timeout == 0) {
printf("%s: card busy!\n", DRIVER_NAME);
return -1;
}
timeout--;
udelay(1000);
/*
* Hardware weirdness. The FIFO_EMPTY bit of the HW_STATE
* register is sometimes not set before a while when some
* "unusual" data block sizes are used (such as with the SWITCH
* command), even despite the fact that the XFER_DONE interrupt
* was raised. And if another data transfer starts before
* this bit comes to good sense (which eventually happens by
* itself) then the new transfer simply fails with a timeout.
*/
if (!(mvebu_mmc_read(SDIO_HW_STATE) & CMD_FIFO_EMPTY)) {
ushort hw_state, count = 0;
start = get_timer(0);
do {
hw_state = mvebu_mmc_read(SDIO_HW_STATE);
if ((get_timer(0) - start) > TIMEOUT_DELAY) {
printf("%s : FIFO_EMPTY bit missing\n",
DRIVER_NAME);
break;
}
count++;
} while (!(hw_state & CMD_FIFO_EMPTY));
debug("%s *** wait for FIFO_EMPTY bit (hw=0x%04x, count=%d, jiffies=%ld)\n",
DRIVER_NAME, hw_state, count, (get_timer(0) - (start)));
}
/* Set up for a data transfer if we have one */
@@ -147,8 +163,7 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, mvebu_mmc_write(SDIO_NOR_INTR_EN, SDIO_POLL_MASK); mvebu_mmc_write(SDIO_ERR_INTR_EN, SDIO_POLL_MASK);
- /* Waiting for completion */
- timeout = 1000000;
start = get_timer(0);
while (!((mvebu_mmc_read(SDIO_NOR_INTR_STATUS)) & waittype)) { if (mvebu_mmc_read(SDIO_NOR_INTR_STATUS) & SDIO_NOR_ERROR) {
@@ -161,13 +176,12 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, return COMM_ERR; }
timeout--;
udelay(1);
if (timeout <= 0) {
printf("%s: command timed out\n", DRIVER_NAME);
if ((get_timer(0) - start) > TIMEOUT_DELAY) {
} }debug("%s: command timed out\n", DRIVER_NAME); return TIMEOUT;
- if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) & (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) return TIMEOUT;
diff --git a/include/mvebu_mmc.h b/include/mvebu_mmc.h index 28d98fe..7fb71f7 100644 --- a/include/mvebu_mmc.h +++ b/include/mvebu_mmc.h @@ -79,6 +79,7 @@ #define CMD_INHIBIT (1 << 0) #define CMD_TXACTIVE (1 << 8) #define CMD_RXACTIVE (1 << 9) +#define CMD_FIFO_EMPTY (1 << 13) #define CMD_AUTOCMD12ACTIVE (1 << 14) #define CMD_BUS_BUSY (CMD_AUTOCMD12ACTIVE | \ CMD_RXACTIVE | \ -- 2.1.3
Applied, thanks
— Pantelis

Signed-off-by: Gérald Kerma drEagle@doukki.net --- drivers/mmc/mvebu_mmc.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 91a9be0..854bcc6 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -71,8 +71,8 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, ushort xfertype = 0; ushort resp_indx = 0;
- debug("cmdidx [0x%x] resp_type[0x%x] cmdarg[0x%x]\n", - cmd->cmdidx, cmd->resp_type, cmd->cmdarg); + debug("%s: cmdidx [0x%x] resp_type[0x%x] cmdarg[0x%x]\n", + DRIVER_NAME, cmd->cmdidx, cmd->resp_type, cmd->cmdarg);
debug("%s: cmd %d (hw state 0x%04x)\n", DRIVER_NAME, cmd->cmdidx, mvebu_mmc_read(SDIO_HW_STATE)); @@ -107,8 +107,11 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, if (data) { int err = mvebu_mmc_setup_data(data);
- if (err) + if (err) { + debug("%s: command DATA error :%x\n", + DRIVER_NAME, err); return err; + } }
resptype = SDIO_CMD_INDEX(cmd->cmdidx); @@ -171,8 +174,12 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, DRIVER_NAME, cmd->cmdidx, mvebu_mmc_read(SDIO_ERR_INTR_STATUS)); if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) & - (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) + (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) { + debug("%s: command READ timed out\n", + DRIVER_NAME); return TIMEOUT; + } + debug("%s: command READ error\n", DRIVER_NAME); return COMM_ERR; }
@@ -265,6 +272,7 @@ static void mvebu_mmc_set_clk(unsigned int clock) if (m > MVEBU_MMC_BASE_DIV_MAX) m = MVEBU_MMC_BASE_DIV_MAX; mvebu_mmc_write(SDIO_CLK_DIV, m & MVEBU_MMC_BASE_DIV_MAX); + debug("%s: clock (%d) div : %d\n", DRIVER_NAME, clock, m); }
udelay(10*1000); @@ -369,7 +377,7 @@ static void mvebu_window_setup(void)
static int mvebu_mmc_initialize(struct mmc *mmc) { - debug("%s: mvebu_mmc_initialize", DRIVER_NAME); + debug("%s: mvebu_mmc_initialize\n", DRIVER_NAME);
/* * Setting host parameters

Hi Gérald,
On Dec 13, 2014, at 22:35 , Gérald Kerma drEagle@doukki.net wrote:
Signed-off-by: Gérald Kerma drEagle@doukki.net
drivers/mmc/mvebu_mmc.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 91a9be0..854bcc6 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -71,8 +71,8 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, ushort xfertype = 0; ushort resp_indx = 0;
- debug("cmdidx [0x%x] resp_type[0x%x] cmdarg[0x%x]\n",
cmd->cmdidx, cmd->resp_type, cmd->cmdarg);
debug("%s: cmdidx [0x%x] resp_type[0x%x] cmdarg[0x%x]\n",
DRIVER_NAME, cmd->cmdidx, cmd->resp_type, cmd->cmdarg);
debug("%s: cmd %d (hw state 0x%04x)\n", DRIVER_NAME, cmd->cmdidx, mvebu_mmc_read(SDIO_HW_STATE));
@@ -107,8 +107,11 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, if (data) { int err = mvebu_mmc_setup_data(data);
if (err)
if (err) {
debug("%s: command DATA error :%x\n",
DRIVER_NAME, err); return err;
}
}
resptype = SDIO_CMD_INDEX(cmd->cmdidx);
@@ -171,8 +174,12 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, DRIVER_NAME, cmd->cmdidx, mvebu_mmc_read(SDIO_ERR_INTR_STATUS)); if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) &
(SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT))
(SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) {
debug("%s: command READ timed out\n",
DRIVER_NAME); return TIMEOUT;
}
}debug("%s: command READ error\n", DRIVER_NAME); return COMM_ERR;
@@ -265,6 +272,7 @@ static void mvebu_mmc_set_clk(unsigned int clock) if (m > MVEBU_MMC_BASE_DIV_MAX) m = MVEBU_MMC_BASE_DIV_MAX; mvebu_mmc_write(SDIO_CLK_DIV, m & MVEBU_MMC_BASE_DIV_MAX);
debug("%s: clock (%d) div : %d\n", DRIVER_NAME, clock, m);
}
udelay(10*1000);
@@ -369,7 +377,7 @@ static void mvebu_window_setup(void)
static int mvebu_mmc_initialize(struct mmc *mmc) {
- debug("%s: mvebu_mmc_initialize", DRIVER_NAME);
debug("%s: mvebu_mmc_initialize\n", DRIVER_NAME);
/*
- Setting host parameters
-- 2.1.3
Applied, thanks
— Pantelis

Remove delays in mvebu_mmc_set_bus and mvebu_mmc_set_clk
Signed-off-by: Gérald Kerma drEagle@doukki.net --- drivers/mmc/mvebu_mmc.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 854bcc6..3e08f40 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -274,8 +274,6 @@ static void mvebu_mmc_set_clk(unsigned int clock) mvebu_mmc_write(SDIO_CLK_DIV, m & MVEBU_MMC_BASE_DIV_MAX); debug("%s: clock (%d) div : %d\n", DRIVER_NAME, clock, m); } - - udelay(10*1000); }
static void mvebu_mmc_set_bus(unsigned int bus) @@ -315,7 +313,6 @@ static void mvebu_mmc_set_bus(unsigned int bus) "high-speed" : "");
mvebu_mmc_write(SDIO_HOST_CTRL, ctrl_reg); - udelay(10*1000); }
static void mvebu_mmc_set_ios(struct mmc *mmc)

Hi Gérald,
On Dec 13, 2014, at 22:35 , Gérald Kerma drEagle@doukki.net wrote:
Remove delays in mvebu_mmc_set_bus and mvebu_mmc_set_clk
Signed-off-by: Gérald Kerma drEagle@doukki.net
drivers/mmc/mvebu_mmc.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 854bcc6..3e08f40 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -274,8 +274,6 @@ static void mvebu_mmc_set_clk(unsigned int clock) mvebu_mmc_write(SDIO_CLK_DIV, m & MVEBU_MMC_BASE_DIV_MAX); debug("%s: clock (%d) div : %d\n", DRIVER_NAME, clock, m); }
- udelay(10*1000);
}
static void mvebu_mmc_set_bus(unsigned int bus) @@ -315,7 +313,6 @@ static void mvebu_mmc_set_bus(unsigned int bus) "high-speed" : "");
mvebu_mmc_write(SDIO_HOST_CTRL, ctrl_reg);
- udelay(10*1000);
}
static void mvebu_mmc_set_ios(struct mmc *mmc)
2.1.3
Applied, thanks
— Pantelis

Clean mvebu_mmc_send_cmd
Signed-off-by: Gérald Kerma drEagle@doukki.net --- drivers/mmc/mvebu_mmc.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 3e08f40..721ebcc 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -103,16 +103,9 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, DRIVER_NAME, hw_state, count, (get_timer(0) - (start))); }
- /* Set up for a data transfer if we have one */ - if (data) { - int err = mvebu_mmc_setup_data(data); - - if (err) { - debug("%s: command DATA error :%x\n", - DRIVER_NAME, err); - return err; - } - } + /* Clear status */ + mvebu_mmc_write(SDIO_NOR_INTR_STATUS, SDIO_POLL_MASK); + mvebu_mmc_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK);
resptype = SDIO_CMD_INDEX(cmd->cmdidx);
@@ -138,6 +131,14 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, }
if (data) { + int err = mvebu_mmc_setup_data(data); + + if (err) { + debug("%s: command DATA error :%x\n", + DRIVER_NAME, err); + return err; + } + resptype |= SDIO_CMD_DATA_PRESENT | SDIO_CMD_CHECK_DATACRC16; xfertype |= SDIO_XFER_MODE_HW_WR_DATA_EN; if (data->flags & MMC_DATA_READ) { @@ -157,15 +158,9 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, /* Setting Xfer mode */ mvebu_mmc_write(SDIO_XFER_MODE, xfertype);
- mvebu_mmc_write(SDIO_NOR_INTR_STATUS, ~SDIO_NOR_CARD_INT); - mvebu_mmc_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK); - /* Sending command */ mvebu_mmc_write(SDIO_CMD, resptype);
- mvebu_mmc_write(SDIO_NOR_INTR_EN, SDIO_POLL_MASK); - mvebu_mmc_write(SDIO_ERR_INTR_EN, SDIO_POLL_MASK); - start = get_timer(0);
while (!((mvebu_mmc_read(SDIO_NOR_INTR_STATUS)) & waittype)) { @@ -189,10 +184,6 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, } }
- if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) & - (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) - return TIMEOUT; - /* Handling response */ if (cmd->resp_type & MMC_RSP_136) { uint response[8]; @@ -225,6 +216,11 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, cmd->response[1] = ((response[0] & 0xfc00) >> 10); cmd->response[2] = 0; cmd->response[3] = 0; + } else { + cmd->response[0] = 0; + cmd->response[1] = 0; + cmd->response[2] = 0; + cmd->response[3] = 0; }
debug("%s: resp[0x%x] ", DRIVER_NAME, cmd->resp_type); @@ -234,6 +230,10 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, debug("[0x%x] ", cmd->response[3]); debug("\n");
+ if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) & + (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) + return TIMEOUT; + return 0; }

Hi Gérald,
On Dec 13, 2014, at 22:35 , Gérald Kerma drEagle@doukki.net wrote:
Clean mvebu_mmc_send_cmd
Signed-off-by: Gérald Kerma drEagle@doukki.net
drivers/mmc/mvebu_mmc.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 3e08f40..721ebcc 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -103,16 +103,9 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, DRIVER_NAME, hw_state, count, (get_timer(0) - (start))); }
- /* Set up for a data transfer if we have one */
- if (data) {
int err = mvebu_mmc_setup_data(data);
if (err) {
debug("%s: command DATA error :%x\n",
DRIVER_NAME, err);
return err;
}
- }
/* Clear status */
mvebu_mmc_write(SDIO_NOR_INTR_STATUS, SDIO_POLL_MASK);
mvebu_mmc_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK);
resptype = SDIO_CMD_INDEX(cmd->cmdidx);
@@ -138,6 +131,14 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, }
if (data) {
int err = mvebu_mmc_setup_data(data);
if (err) {
debug("%s: command DATA error :%x\n",
DRIVER_NAME, err);
return err;
}
- resptype |= SDIO_CMD_DATA_PRESENT | SDIO_CMD_CHECK_DATACRC16; xfertype |= SDIO_XFER_MODE_HW_WR_DATA_EN; if (data->flags & MMC_DATA_READ) {
@@ -157,15 +158,9 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, /* Setting Xfer mode */ mvebu_mmc_write(SDIO_XFER_MODE, xfertype);
mvebu_mmc_write(SDIO_NOR_INTR_STATUS, ~SDIO_NOR_CARD_INT);
mvebu_mmc_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK);
/* Sending command */ mvebu_mmc_write(SDIO_CMD, resptype);
mvebu_mmc_write(SDIO_NOR_INTR_EN, SDIO_POLL_MASK);
mvebu_mmc_write(SDIO_ERR_INTR_EN, SDIO_POLL_MASK);
start = get_timer(0);
while (!((mvebu_mmc_read(SDIO_NOR_INTR_STATUS)) & waittype)) {
@@ -189,10 +184,6 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, } }
- if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) &
(SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT))
return TIMEOUT;
- /* Handling response */ if (cmd->resp_type & MMC_RSP_136) { uint response[8];
@@ -225,6 +216,11 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, cmd->response[1] = ((response[0] & 0xfc00) >> 10); cmd->response[2] = 0; cmd->response[3] = 0;
} else {
cmd->response[0] = 0;
cmd->response[1] = 0;
cmd->response[2] = 0;
cmd->response[3] = 0;
}
debug("%s: resp[0x%x] ", DRIVER_NAME, cmd->resp_type);
@@ -234,6 +230,10 @@ static int mvebu_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, debug("[0x%x] ", cmd->response[3]); debug("\n");
- if (mvebu_mmc_read(SDIO_ERR_INTR_STATUS) &
(SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT))
return TIMEOUT;
- return 0;
}
-- 2.1.3
Applied, thanks
— Pantelis

Remove unnessecary delay from mvebu_mmc_initialize
Signed-off-by: Gérald Kerma drEagle@doukki.net --- drivers/mmc/mvebu_mmc.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 721ebcc..8ca0904 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -403,8 +403,6 @@ static int mvebu_mmc_initialize(struct mmc *mmc) /* SW reset */ mvebu_mmc_write(SDIO_SW_RESET, SDIO_SW_RESET_NOW);
- udelay(10*1000); - return 0; }

Hi Gérald,
On Dec 13, 2014, at 22:35 , Gérald Kerma drEagle@doukki.net wrote:
Remove unnessecary delay from mvebu_mmc_initialize
Signed-off-by: Gérald Kerma drEagle@doukki.net
drivers/mmc/mvebu_mmc.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 721ebcc..8ca0904 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -403,8 +403,6 @@ static int mvebu_mmc_initialize(struct mmc *mmc) /* SW reset */ mvebu_mmc_write(SDIO_SW_RESET, SDIO_SW_RESET_NOW);
- udelay(10*1000);
- return 0;
}
-- 2.1.3
Applied, thanks
— Pantelis

2014-12-13 21:35 GMT+01:00 Gérald Kerma drEagle@doukki.net:
This serie of patches speed up access time of MVEBUMMC driver
This is allowed by a fix in MVEBUMMC init status check inspired from linux MVSDIO driver. * Hardware weirdness. The FIFO_EMPTY bit of the HW_STATE * register is sometimes not set before a while when some * "unusual" data block sizes are used (such as with the SWITCH * command), even despite the fact that the XFER_DONE interrupt * was raised. And if another data transfer starts before * this bit comes to good sense (which eventually happens by * itself) then the new transfer simply fails with a timeout.
It allows about 10x to 40x faster access time transfer on SHEEVAPLUG MMC It may also fixes some SD types incompatibilities
### before patch
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 977 ms (1.6 MiB/s)
### with fix
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 83 ms (18.5 MiB/s)
Looks good to me. ACK to this series of patches:
Gérald Kerma (6): MVEBUMMC : Change copyright date MVEBUMMC : Speed up access time MVEBUMMC : FIX debug strings MVEBUMMC : REMOVE unnecessary delays MVEBUMMC : CLEAN code MVEBUMMC : REMOVE unnecessary delay from init
drivers/mmc/mvebu_mmc.c | 103 ++++++++++++++++++++++++++++-------------------- include/mvebu_mmc.h | 1 + 2 files changed, 61 insertions(+), 43 deletions(-)
-- 2.1.3 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Hi,
Any chance to be included in the next release of u-boot ?
Regards, Gérald
Le 15/12/2014 12:14, Mario Schuknecht a écrit :
2014-12-13 21:35 GMT+01:00 Gérald Kerma <drEagle@doukki.net mailto:drEagle@doukki.net>:
This serie of patches speed up access time of MVEBUMMC driver This is allowed by a fix in MVEBUMMC init status check inspired from linux MVSDIO driver. * Hardware weirdness. The FIFO_EMPTY bit of the HW_STATE * register is sometimes not set before a while when some * "unusual" data block sizes are used (such as with the SWITCH * command), even despite the fact that the XFER_DONE interrupt * was raised. And if another data transfer starts before * this bit comes to good sense (which eventually happens by * itself) then the new transfer simply fails with a timeout. It allows about 10x to 40x faster access time transfer on SHEEVAPLUG MMC It may also fixes some SD types incompatibilities ### before patch Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 977 ms (1.6 MiB/s) ### with fix Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 83 ms (18.5 MiB/s)
Looks good to me. ACK to this series of patches:
Gérald Kerma (6): MVEBUMMC : Change copyright date MVEBUMMC : Speed up access time MVEBUMMC : FIX debug strings MVEBUMMC : REMOVE unnecessary delays MVEBUMMC : CLEAN code MVEBUMMC : REMOVE unnecessary delay from init drivers/mmc/mvebu_mmc.c | 103 ++++++++++++++++++++++++++++-------------------- include/mvebu_mmc.h | 1 + 2 files changed, 61 insertions(+), 43 deletions(-) -- 2.1.3 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de <mailto:U-Boot@lists.denx.de> http://lists.denx.de/mailman/listinfo/u-boot

Hi Gerald,
Last pull-req for mmc was last Friday, I intend to issue another this Friday too.
Regards
— Pantelis
On Dec 17, 2014, at 11:22 , drEagle dreagle@doukki.net wrote:
Hi,
Any chance to be included in the next release of u-boot ?
Regards, Gérald
Le 15/12/2014 12:14, Mario Schuknecht a écrit :
2014-12-13 21:35 GMT+01:00 Gérald Kerma <drEagle@doukki.net mailto:drEagle@doukki.net>:
This serie of patches speed up access time of MVEBUMMC driver
This is allowed by a fix in MVEBUMMC init status check inspired from linux MVSDIO driver. * Hardware weirdness. The FIFO_EMPTY bit of the HW_STATE * register is sometimes not set before a while when some * "unusual" data block sizes are used (such as with the SWITCH * command), even despite the fact that the XFER_DONE interrupt * was raised. And if another data transfer starts before * this bit comes to good sense (which eventually happens by * itself) then the new transfer simply fails with a timeout.
It allows about 10x to 40x faster access time transfer on SHEEVAPLUG MMC It may also fixes some SD types incompatibilities
### before patch
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 977 ms (1.6 MiB/s)
### with fix
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 83 ms (18.5 MiB/s)
Looks good to me. ACK to this series of patches:
Gérald Kerma (6): MVEBUMMC : Change copyright date MVEBUMMC : Speed up access time MVEBUMMC : FIX debug strings MVEBUMMC : REMOVE unnecessary delays MVEBUMMC : CLEAN code MVEBUMMC : REMOVE unnecessary delay from init
drivers/mmc/mvebu_mmc.c | 103 ++++++++++++++++++++++++++++-------------------- include/mvebu_mmc.h | 1 + 2 files changed, 61 insertions(+), 43 deletions(-)
-- 2.1.3 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de mailto:U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Hi Pantelis,
Is these patches reviewed and upstreamed ?
Regards, Gérald
Le 17/12/2014 11:18, Pantelis Antoniou a écrit :
Hi Gerald,
Last pull-req for mmc was last Friday, I intend to issue another this Friday too.
Regards
— Pantelis
On Dec 17, 2014, at 11:22 , drEagle dreagle@doukki.net wrote:
Hi,
Any chance to be included in the next release of u-boot ?
Regards, Gérald
Le 15/12/2014 12:14, Mario Schuknecht a écrit :
2014-12-13 21:35 GMT+01:00 Gérald Kerma <drEagle@doukki.net mailto:drEagle@doukki.net>:
This serie of patches speed up access time of MVEBUMMC driver
This is allowed by a fix in MVEBUMMC init status check inspired from linux MVSDIO driver. * Hardware weirdness. The FIFO_EMPTY bit of the HW_STATE * register is sometimes not set before a while when some * "unusual" data block sizes are used (such as with the SWITCH * command), even despite the fact that the XFER_DONE interrupt * was raised. And if another data transfer starts before * this bit comes to good sense (which eventually happens by * itself) then the new transfer simply fails with a timeout.
It allows about 10x to 40x faster access time transfer on SHEEVAPLUG MMC It may also fixes some SD types incompatibilities
### before patch
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 977 ms (1.6 MiB/s)
### with fix
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 83 ms (18.5 MiB/s)
Looks good to me. ACK to this series of patches:
Gérald Kerma (6): MVEBUMMC : Change copyright date MVEBUMMC : Speed up access time MVEBUMMC : FIX debug strings MVEBUMMC : REMOVE unnecessary delays MVEBUMMC : CLEAN code MVEBUMMC : REMOVE unnecessary delay from init
drivers/mmc/mvebu_mmc.c | 103 ++++++++++++++++++++++++++++-------------------- include/mvebu_mmc.h | 1 + 2 files changed, 61 insertions(+), 43 deletions(-)
-- 2.1.3 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de mailto:U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Hi,
any news for this patch ?
Regards, Gérald,
Le 23/12/2014 14:01, drEagle a écrit :
Hi Pantelis,
Is these patches reviewed and upstreamed ?
Regards, Gérald
Le 17/12/2014 11:18, Pantelis Antoniou a écrit :
Hi Gerald,
Last pull-req for mmc was last Friday, I intend to issue another this Friday too.
Regards
— Pantelis
On Dec 17, 2014, at 11:22 , drEagle dreagle@doukki.net wrote:
Hi,
Any chance to be included in the next release of u-boot ?
Regards, Gérald
Le 15/12/2014 12:14, Mario Schuknecht a écrit :
2014-12-13 21:35 GMT+01:00 Gérald Kerma <drEagle@doukki.net mailto:drEagle@doukki.net>:
This serie of patches speed up access time of MVEBUMMC driver
This is allowed by a fix in MVEBUMMC init status check inspired from linux MVSDIO driver. * Hardware weirdness. The FIFO_EMPTY bit of the HW_STATE * register is sometimes not set before a while when some * "unusual" data block sizes are used (such as with the SWITCH * command), even despite the fact that the XFER_DONE interrupt * was raised. And if another data transfer starts before * this bit comes to good sense (which eventually happens by * itself) then the new transfer simply fails with a timeout.
It allows about 10x to 40x faster access time transfer on SHEEVAPLUG MMC It may also fixes some SD types incompatibilities
### before patch
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 977 ms (1.6 MiB/s)
### with fix
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 83 ms (18.5 MiB/s)
Looks good to me. ACK to this series of patches:
Gérald Kerma (6): MVEBUMMC : Change copyright date MVEBUMMC : Speed up access time MVEBUMMC : FIX debug strings MVEBUMMC : REMOVE unnecessary delays MVEBUMMC : CLEAN code MVEBUMMC : REMOVE unnecessary delay from init
drivers/mmc/mvebu_mmc.c | 103 ++++++++++++++++++++++++++++-------------------- include/mvebu_mmc.h | 1 + 2 files changed, 61 insertions(+), 43 deletions(-)
-- 2.1.3 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de mailto:U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

All applied,
There’s something called a Christmas break so no worries now :)
On Jan 3, 2015, at 18:06 , drEagle drEagle@DOUKKI.NET wrote:
Hi,
any news for this patch ?
Regards, Gérald,
Le 23/12/2014 14:01, drEagle a écrit :
Hi Pantelis,
Is these patches reviewed and upstreamed ?
Regards, Gérald
Le 17/12/2014 11:18, Pantelis Antoniou a écrit :
Hi Gerald,
Last pull-req for mmc was last Friday, I intend to issue another this Friday too.
Regards
— Pantelis
On Dec 17, 2014, at 11:22 , drEagle dreagle@doukki.net wrote:
Hi,
Any chance to be included in the next release of u-boot ?
Regards, Gérald
Le 15/12/2014 12:14, Mario Schuknecht a écrit :
2014-12-13 21:35 GMT+01:00 Gérald Kerma <drEagle@doukki.net mailto:drEagle@doukki.net>:
This serie of patches speed up access time of MVEBUMMC driver
This is allowed by a fix in MVEBUMMC init status check inspired from linux MVSDIO driver. * Hardware weirdness. The FIFO_EMPTY bit of the HW_STATE * register is sometimes not set before a while when some * "unusual" data block sizes are used (such as with the SWITCH * command), even despite the fact that the XFER_DONE interrupt * was raised. And if another data transfer starts before * this bit comes to good sense (which eventually happens by * itself) then the new transfer simply fails with a timeout.
It allows about 10x to 40x faster access time transfer on SHEEVAPLUG MMC It may also fixes some SD types incompatibilities
### before patch
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 977 ms (1.6 MiB/s)
### with fix
Marvell>> ext2load mmc 0:1 0x800000 uImage 1613392 bytes read in 83 ms (18.5 MiB/s)
Looks good to me. ACK to this series of patches:
Gérald Kerma (6): MVEBUMMC : Change copyright date MVEBUMMC : Speed up access time MVEBUMMC : FIX debug strings MVEBUMMC : REMOVE unnecessary delays MVEBUMMC : CLEAN code MVEBUMMC : REMOVE unnecessary delay from init
drivers/mmc/mvebu_mmc.c | 103 ++++++++++++++++++++++++++++-------------------- include/mvebu_mmc.h | 1 + 2 files changed, 61 insertions(+), 43 deletions(-)
-- 2.1.3 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de mailto:U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
participants (4)
-
drEagle
-
Gérald Kerma
-
Mario Schuknecht
-
Pantelis Antoniou