Commit graph

13 commits

Author SHA1 Message Date
Seungwon Jeon 6e83e10d92 mmc: dw_mmc: protect a sequence of request and request-done.
Response timeout (RTO), Response crc error (RCRC) and Response error (RE)
signals come with command done (CD) and can be raised preceding command
done (CD). That is these error interrupts and CD can be handled in
separate dw_mci_interrupt(). If mmc_request_done() is called because of
a response timeout before command done has occured, we might send the
next request before the CD of current request is finished. This can
bring about a broken sequence of request and request-done.

And Data error interrupt (DRTO, DCRC, SBE, EBE) and data transfer
over (DTO) have the same problem.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-20 17:20:53 -04:00
Seungwon Jeon 1d56c453b1 mmc: dw_mmc: set the card_width bit per card.
This patch sets the card_width bit of CTYPE for the corresponding card.

CTYPE[31] and CTYPE[16] correspond respectively to card[15] and card[0]
for 8-bit mode. And CTYPE[15] and CTYPE[0] correspond respectively to
card[15] and CTYPE[0] for 1-bit or 4-bit mode.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-20 17:20:53 -04:00
Jaehoon Chung 1d6c4e0a00 mmc: dw_mmc: fixed wrong regulator_enable in suspend/resume
regulator_enable() was incorrectly placed in the suspend function
instead of the resume function.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-05-24 23:53:56 -04:00
Jaehoon Chung a5289a433d mmc: dw_mmc: set fixed burst in BMOD register
This patch uses the fixed burst bit when using an internal DMA controller.
I found increased performance with IDMAC when this bit is set.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-25 10:30:49 -04:00
Jaehoon Chung c07946a335 mmc: dw_mmc: support mmc power control with regulator
This patch adds support for power regulators.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-17 15:35:22 -04:00
Jaehoon Chung e61cf1184d mmc: dw_mmc: fix suspend/resume operation
This patch is related to re-init processing on suspend/resume.

When card is resuming, some register is reset.  If card is removable,
maybe controller should be rescan for card.  But if assume card is
non-removable, need to restore the old value at registers.

We store the value of FIFOTH at probe time and then restore it in
dw_mci_resume().

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-17 15:35:20 -04:00
Jaehoon Chung fc3d772054 mmc: dw_mmc: add quirks for unreliable card detect, and capabilities
This patch adds quirks and capabilities to platdata.

Some cards don't use the CDn pin; in that case, we assume the card's
inserted. Some boards need other capabilities. So, we add capabilities
in the board's platdata.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-17 15:35:18 -04:00
Chris Ball ba6a902d9d mmc: dw_mmc: Remove set-but-unused variable.
count is only ever used by assigning to old_len if count == 0, and
then old_len isn't ever used at all.  So, both are redundant.  Fixes:

drivers/mmc/host/dw_mmc.c: In function ‘dw_mci_read_data_pio’:
drivers/mmc/host/dw_mmc.c:1034:32: warning: variable ‘old_len’ set but
not used [-Wunused-but-set-variable]

Signed-off-by: Chris Ball <cjb@laptop.org>
Acked-by: Will Newton <will.newton@imgtec.com>
2011-03-17 15:35:06 -04:00
Jaehoon Chung 41babf753c mmc: dw_mmc: support DDR mode
This patch adds DDR mode support to dw_mmc.

If we set any bit in UHS_REG bit[16:31], the card of that slot is
supported for DDR mode.  For example, if UHS_REG[16] is set, card
number 0 is DDR mode.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15 13:51:47 -04:00
Jaehoon Chung c9b2a06fb0 mmc: dw_mmc: support 8-bit buswidth
This patch adds support for 8-bit buswidth.
dw_mmc can use 8-bit buswidth and set to CTYPE_8BIT in card-type register.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15 13:49:30 -04:00
Will Newton aadb9f4110 mmc: dw_mmc: Enable low-power mode for the card clock.
Setting this bit in the clock enable register will stop the clock
when the card is in the IDLE state.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15 13:48:53 -04:00
Will Newton dd6c4b9807 mmc: dw_mmc: Run card detect tasklet during slot initialisation.
We need to run the card detect tasklet at the end of slot initialisation
as it is possible that a card has been inserted prior to boot, so we don't
see an insertion interrupt and now the card is sitting there inserted but
with no power to it.

Signed-off-by: Neil Jones <neil.jones@imgtec.com>
Signed-off-by: Will Newton <will.newton@imgtec.com>
Reviewed-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-03-15 13:48:51 -04:00
Will Newton f95f3850f7 mmc: dw_mmc: Add Synopsys DesignWare mmc host driver.
This adds the mmc host driver for the Synopsys DesignWare mmc
host controller, found in a number of embedded SoC designs.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Reviewed-by: Matt Fleming <matt@console-pimps.org>
Reviewed-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-01-08 23:52:24 -05:00