From: Shawn Lin <shawn.lin@rock-chips.com>
To: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
Shawn Lin <shawn.lin@rock-chips.com>
Subject: [PATCH 0/2] Add hw reset support for DesignWare MMC controller.
Date: Thu, 22 Oct 2015 14:19:00 +0800 [thread overview]
Message-ID: <1445494740-16778-1-git-send-email-shawn.lin@rock-chips.com> (raw)
MMC core stack and blk layer can do some recovery if mmc
device runs into broken state for any reasons. So we implement it
for DesignWare MMC host controller.
From Synopsys DesignWare Cores Mobile Storage Host Databook
(Section 7.4.4), we get the details:
1. Program CMD12 to end any transfer in process.
2. Wait for DTO, even if no response is sent back by the card.
3. Set the following resets:
Software reset – BMOD[0] for IDMAC only
DMA reset– CTRL[2]
FIFO reset – CTRL[1] bits
4. Program the CARD_RESET register with a value of 0 for the bit
corresponding to the card number; This can be done at any time when
the card is connected to the controller. This programming asserts the
RST_n signal and resets the card.
5. Wait for minimum of 1 μs or cclk_in period, which ever is greater
6. After a minimum of 1 μs, the application should program a value of
0 into the CARD_RESET register for the bit corresponding to the card
number. This de-asserts the RST_n signal and takes the card out of reset.
7. The application can program a new CMD only after a minimum of 200 us
after the de-assertion of the RST_n signal, as per the MMC 4.41 standard.
HW reset producer will be call in mmc_init_card before mmc_go_idle. At that
time,dw mmc hasn't update clk for itself, so CMD12 is inappropriate and
unnecessary. Moreover, if mmc device runs into broken states, DRTO or RTO
generated by previous cmd w/ data will make mmc core issue stop already. Then
it will retry again and again, issue stop and card status again until the
cmd's retry number decrease to zero. That will finally trigger HW reset producer
if we declare MMC_CAP_HW_RESET. So there's no need to do step 1 and 2 for the
reasons we mentioned above.
This implementation can be easily tested by cutting off->On vmmc while doing data
accessing in background to simulate that case. And dw_mmc can generate timeout
interrupt and make mmc core trigger hw reset producer before re-init mmc card
to recover itself.
This patchset do following things:
- add hw reset for dw_mmc
- implement specific hw_reset extention
Shawn Lin (2):
mmc: dw_mmc: add hw_reset support
mmc: dw_mmc: add hw_reset extension hook
drivers/mmc/host/dw_mmc.c | 33 +++++++++++++++++++++++++++++++++
drivers/mmc/host/dw_mmc.h | 6 ++++++
2 files changed, 39 insertions(+)
--
2.3.7
next reply other threads:[~2015-10-22 6:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 6:19 Shawn Lin [this message]
2015-10-22 6:19 ` [PATCH 1/2] mmc: dw_mmc: add hw_reset support Shawn Lin
2015-10-23 12:07 ` Jaehoon Chung
2015-10-26 0:47 ` Shawn Lin
2015-10-22 6:19 ` [PATCH 2/2] mmc: dw_mmc: add hw_reset extension hook Shawn Lin
2015-10-22 9:48 ` Ulf Hansson
2015-10-22 11:25 ` Shawn Lin
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=1445494740-16778-1-git-send-email-shawn.lin@rock-chips.com \
--to=shawn.lin@rock-chips.com \
--cc=jh80.chung@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.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;
as well as URLs for NNTP newsgroup(s).