[PATCH] sdhci: Add pre and post reset processing for chip specific= reset

philip (none) philip at philip-laptop.
Sat Dec 11 19:58:59 EST 2010


Marvell pxa controllers have private registers that need to be
touched before and after a reset is done.  Implement hooks
to allow this to happen.

Signed-off-by: Philip Rakity <prakity at marvell.com<mailto:prakity at marvell.co=
m>>
---
drivers/mmc/host/sdhci.c |    6 ++++++
drivers/mmc/host/sdhci.h |    2 ++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index d5febe5..f439881 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -157,6 +157,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mas=
k)
if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
ier =3D sdhci_readl(host, SDHCI_INT_ENABLE);

+ if (host->ops->platform_reset_enter)
+ host->ops->platform_reset_enter(host, mask);
+
sdhci_writeb(host, mask, SDHCI_SOFTWARE_RESET);

if (mask & SDHCI_RESET_ALL)
@@ -177,6 +180,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mas=
k)
mdelay(1);
}

+ if (host->ops->platform_reset_exit)
+ host->ops->platform_reset_exit(host, mask);
+
if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, ier);
}
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 6e0969e..9dd7bc1 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -222,6 +222,8 @@ struct sdhci_ops {
void (*platform_send_init_74_clocks)(struct sdhci_host *host,
    u8 power_mode);
unsigned int    (*get_ro)(struct sdhci_host *host);
+ void (*platform_reset_enter)(struct sdhci_host *host, u8 mask);
+ void (*platform_reset_exit)(struct sdhci_host *host, u8 mask);
};

#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
--
1.6.0.4


--_000_C514DA21446D4153B5B9E4AE4D0A06CAmarvellcom_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html><head></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode:=
 space; -webkit-line-break: after-white-space; "><div><br></div>Resend addi=
ng correct name and e-mail for&nbsp;<div>Signed-off-by:<br><div><br><div>Be=
gin forwarded message:</div><br class=3D"Apple-interchange-newline"><blockq=
uote type=3D"cite"><div style=3D"margin-top: 0px; margin-right: 0px; margin=
-bottom: 0px; margin-left: 0px;"><span style=3D"font-family:'Helvetica'; fo=
nt-size:medium; color:rgba(0, 0, 0, 1);"><b>From: </b></span><span style=3D=
"font-family:'Helvetica'; font-size:medium;">Philip Rakity &lt;<a href=3D"m=
ailto:prakity at marvell.com">prakity at marvell.com</a>&gt;<br></span></div><div=
 style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-le=
ft: 0px;"><span style=3D"font-family:'Helvetica'; font-size:medium; color:r=
gba(0, 0, 0, 1);"><b>Date: </b></span><span style=3D"font-family:'Helvetica=
'; font-size:medium;">December 21, 2010 11:08:35 PM PST<br></span></div><di=
v style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-l=
eft: 0px;"><span style=3D"font-family:'Helvetica'; font-size:medium; color:=
rgba(0, 0, 0, 1);"><b>To: </b></span><span style=3D"font-family:'Helvetica'=
; font-size:medium;">"<a href=3D"mailto:linux-mmc at vger.kernel.org">linux-mm=
c at vger.kernel.org</a>" &lt;<a href=3D"mailto:linux-mmc at vger.kernel.org">lin=
ux-mmc at vger.kernel.org</a>&gt;, "<a href=3D"mailto:linux-arm-kernel at lists.i=
nfradead.org">linux-arm-kernel at lists.infradead.org</a>" &lt;<a href=3D"mail=
to:linux-arm-kernel at lists.infradead.org">linux-arm-kernel at lists.infradead.o=
rg</a>&gt;<br></span></div><div style=3D"margin-top: 0px; margin-right: 0px=
; margin-bottom: 0px; margin-left: 0px;"><span style=3D"font-family:'Helvet=
ica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Cc: </b></span><span st=
yle=3D"font-family:'Helvetica'; font-size:medium;">Mark Brown &lt;<a href=
=3D"mailto:markb at marvell.com">markb at marvell.com</a>&gt;<br></span></div><di=
v style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-l=
eft: 0px;"><span style=3D"font-family:'Helvetica'; font-size:medium; color:=
rgba(0, 0, 0, 1);"><b>Subject: </b></span><span style=3D"font-family:'Helve=
tica'; font-size:medium;"><b>[PATCH 7/23]  Alternative mmc structure to sup=
port pxa168, pxa910, mmp2 family SD </b><br></span></div><br><div>From 4998=
88df1a52491c201077c8a0f8310b70583290 Mon Sep 17 00:00:00 2001<br>From: phil=
ip &lt;philip at philip-laptop.(none)&gt;<br>Date: Sat, 11 Dec 2010 16:58:59 -=
0800<br>Subject: [PATCH] sdhci: Add pre and post reset processing for chip =
specific reset<br><br>Marvell pxa controllers have private registers that n=
eed to be<br>touched before and after a reset is done. &nbsp;Implement hook=
s<br>to allow this to happen.<br><br>Signed-off-by: Philip Rakity &lt;<a hr=
ef=3D"mailto:prakity at marvell.com">prakity at marvell.com</a>&gt;<br>---<br> dr=
ivers/mmc/host/sdhci.c | &nbsp;&nbsp;&nbsp;6 ++++++<br> drivers/mmc/host/sd=
hci.h | &nbsp;&nbsp;&nbsp;2 ++<br> 2 files changed, 8 insertions(+), 0 dele=
tions(-)<br><br>diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sd=
hci.c<br>index d5febe5..f439881 100644<br>--- a/drivers/mmc/host/sdhci.c<br=
>+++ b/drivers/mmc/host/sdhci.c<br>@@ -157,6 +157,9 @@ static void sdhci_re=
set(struct sdhci_host *host, u8 mask)<br> <span class=3D"Apple-tab-span" st=
yle=3D"white-space:pre">	</span>if (host-&gt;quirks &amp; SDHCI_QUIRK_RESTO=
RE_IRQS_AFTER_RESET)<br> <span class=3D"Apple-tab-span" style=3D"white-spac=
e:pre">	</span><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</=
span>ier =3D sdhci_readl(host, SDHCI_INT_ENABLE);<br><br>+<span class=3D"Ap=
ple-tab-span" style=3D"white-space:pre">	</span>if (host-&gt;ops-&gt;platfo=
rm_reset_enter)<br>+<span class=3D"Apple-tab-span" style=3D"white-space:pre=
">	</span><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>=
host-&gt;ops-&gt;platform_reset_enter(host, mask);<br>+<br> <span class=3D"=
Apple-tab-span" style=3D"white-space:pre">	</span>sdhci_writeb(host, mask, =
SDHCI_SOFTWARE_RESET);<br><br> <span class=3D"Apple-tab-span" style=3D"whit=
e-space:pre">	</span>if (mask &amp; SDHCI_RESET_ALL)<br>@@ -177,6 +180,9 @@=
 static void sdhci_reset(struct sdhci_host *host, u8 mask)<br> <span class=
=3D"Apple-tab-span" style=3D"white-space:pre">	</span><span class=3D"Apple-=
tab-span" style=3D"white-space:pre">	</span>mdelay(1);<br> <span class=3D"A=
pple-tab-span" style=3D"white-space:pre">	</span>}<br><br>+<span class=3D"A=
pple-tab-span" style=3D"white-space:pre">	</span>if (host-&gt;ops-&gt;platf=
orm_reset_exit)<br>+<span class=3D"Apple-tab-span" style=3D"white-space:pre=
">	</span><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>=
host-&gt;ops-&gt;platform_reset_exit(host, mask);<br>+<br> <span class=3D"A=
pple-tab-span" style=3D"white-space:pre">	</span>if (host-&gt;quirks &amp; =
SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)<br> <span class=3D"Apple-tab-span" st=
yle=3D"white-space:pre">	</span><span class=3D"Apple-tab-span" style=3D"whi=
te-space:pre">	</span>sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, ier);<=
br> }<br>diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h<b=
r>index 6e0969e..9dd7bc1 100644<br>--- a/drivers/mmc/host/sdhci.h<br>+++ b/=
drivers/mmc/host/sdhci.h<br>@@ -222,6 +222,8 @@ struct sdhci_ops {<br> <spa=
n class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>void (*platfor=
m_send_init_74_clocks)(struct sdhci_host *host,<br> <span class=3D"Apple-ta=
b-span" style=3D"white-space:pre">	</span><span class=3D"Apple-tab-span" st=
yle=3D"white-space:pre">	</span><span class=3D"Apple-tab-span" style=3D"whi=
te-space:pre">	</span><span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</spa=
n> &nbsp;&nbsp;&nbsp;&nbsp;u8 power_mode);<br> <span class=3D"Apple-tab-spa=
n" style=3D"white-space:pre">	</span>unsigned int &nbsp;&nbsp;&nbsp;(*get_r=
o)(struct sdhci_host *host);<br>+<span class=3D"Apple-tab-span" style=3D"wh=
ite-space:pre">	</span>void<span class=3D"Apple-tab-span" style=3D"white-sp=
ace:pre">	</span>(*platform_reset_enter)(struct sdhci_host *host, u8 mask);=
<br>+<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>void<=
span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>(*platform_=
reset_exit)(struct sdhci_host *host, u8 mask);<br> };<br><br> #ifdef CONFIG=
_MMC_SDHCI_IO_ACCESSORS<br>-- <br>1.6.0.4<br><br></div></blockquote></div><=
/div></body></html>=

--_000_C514DA21446D4153B5B9E4AE4D0A06CAmarvellcom_--

--_005_C514DA21446D4153B5B9E4AE4D0A06CAmarvellcom_
Content-Type: application/octet-stream;
	name="0007-sdhci-Add-pre-and-post-reset-processing-for-chip-sp.patch"
Content-Description: 0007-sdhci-Add-pre-and-post-reset-processing-for-chip-sp.patch
Content-Disposition: attachment;
	filename="0007-sdhci-Add-pre-and-post-reset-processing-for-chip-sp.patch";
	size=1910; creation-date="Wed, 22 Dec 2010 15:06:52 GMT";
	modification-date="Wed, 22 Dec 2010 15:06:52 GMT"
Content-Transfer-Encoding: base64

RnJvbSA0OTk4ODhkZjFhNTI0OTFjMjAxMDc3Yzh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0Zm9ybV9z
ZW5kX2luaXRfNzRfY2xvY2tzKShzdHJ1Y3Qgc2RoY2lfaG9zdCAqaG9zdCwKIAkJCQkJICAgICB1
OCBwb3dlcl9tb2RlKTsKIAl1bnNpZ25lZCBpbnQgICAgKCpnZXRfcm8pKHN0cnVjdCBzZGhjaV9o
b3N0ICpob3N0KTsKKwl2b2lkCSgqcGxhdGZvcm1fcmVzZXRfZW50ZXIpKHN0cnVjdCBzZGhjaV9o
b3N0ICpob3N0LCB1OCBtYXNrKTsKKwl2b2lkCSgqcGxhdGZvcm1fcmVzZXRfZXhpdCkoc3RydWN0
IHNkaGNpX2hvc3QgKmhvc3QsIHU4IG1hc2spOwogfTsKIAogI2lmZGVmIENPTkZJR19NTUNfU0RI
Q0lfSU9fQUNDRVNTT1JTCi0tIAoxLjYuMC40Cgo=

--_005_C514DA21446D4153B5B9E4AE4D0A06CAmarvellcom_
Content-Type: text/html; name="ATT00001..htm"
Content-Description: ATT00001..htm
Content-Disposition: attachment; filename="ATT00001..htm"; size=147;
	creation-date="Wed, 22 Dec 2010 15:06:52 GMT";
	modification-date="Wed, 22 Dec 2010 15:06:52 GMT"
Content-Transfer-Encoding: base64

PGh0bWw+PGhlYWQ+PC9oZWFkPjxib2R5IHN0eWxlPSJ3b3JkLXdyYXA6IGJyZWFrLXdvcmQ7IC13
ZWJraXQtbmJzcC1tb2RlOiBzcGFjZTsgLXdlYmtpdC1saW5lLWJyZWFrOiBhZnRlci13aGl0ZS1z
cGFjZTsgIj48ZGl2PjwvZGl2PjwvYm9keT48L2h0bWw+

--_005_C514DA21446D4153B5B9E4AE4D0A06CAmarvellcom_--



More information about the linux-arm-kernel mailing list