* [OLPC] sdhci: add quirk for the Marvell CaFe's vdd/powerup issue
@ 2008-06-22 1:15 Andres Salomon
2008-06-27 16:29 ` Pierre Ossman
0 siblings, 1 reply; 4+ messages in thread
From: Andres Salomon @ 2008-06-22 1:15 UTC (permalink / raw)
To: akpm; +Cc: drzeus-sdhci, sdhci-devel, linux-kernel
This has been sitting around unloved for way too long..
The Marvell CaFe chip's SD implementation chokes during card insertion
if one attempts to set the voltage and power up in the same
SDHCI_POWER_CONTROL register write. This adds a quirk that does
that particular dance in two steps.
It also adds an entry to pci_ids.h for the CaFe chip's SD device.
Signed-off-by: Andres Salomon <dilinger@debian.org>
---
drivers/mmc/host/sdhci.c | 18 ++++++++++++++++++
include/linux/pci_ids.h | 1 +
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 07c2048..5b74c8c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -55,6 +55,8 @@ static unsigned int debug_quirks = 0;
#define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<7)
/* Controller needs to be reset after each request to stay stable */
#define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<8)
+/* Controller needs voltage and power writes to happen separately */
+#define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1<<9)
static const struct pci_device_id pci_ids[] __devinitdata = {
{
@@ -128,6 +130,14 @@ static const struct pci_device_id pci_ids[] __devinitdata = {
},
{
+ .vendor = PCI_VENDOR_ID_MARVELL,
+ .device = PCI_DEVICE_ID_MARVELL_CAFE_SD,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .driver_data = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER,
+ },
+
+ {
.vendor = PCI_VENDOR_ID_JMICRON,
.device = PCI_DEVICE_ID_JMICRON_JMB38X_SD,
.subvendor = PCI_ANY_ID,
@@ -774,6 +784,14 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
BUG();
}
+ /*
+ * At least the CaFe chip gets confused if we set the voltage
+ * and set turn on power at the same time, so set the voltage first.
+ */
+ if ((host->chip->quirks & SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER))
+ writeb(pwr & ~SDHCI_POWER_ON,
+ host->ioaddr + SDHCI_POWER_CONTROL);
+
writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL);
out:
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index eafc9d6..6595382 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1520,6 +1520,7 @@
#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430
#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460
#define PCI_DEVICE_ID_MARVELL_MV64460 0x6480
+#define PCI_DEVICE_ID_MARVELL_CAFE_SD 0x4101
#define PCI_VENDOR_ID_V3 0x11b0
#define PCI_DEVICE_ID_V3_V960 0x0001
--
1.5.5.3
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [OLPC] sdhci: add quirk for the Marvell CaFe's vdd/powerup issue
2008-06-22 1:15 [OLPC] sdhci: add quirk for the Marvell CaFe's vdd/powerup issue Andres Salomon
@ 2008-06-27 16:29 ` Pierre Ossman
2008-06-28 17:02 ` Joel Stanley
0 siblings, 1 reply; 4+ messages in thread
From: Pierre Ossman @ 2008-06-27 16:29 UTC (permalink / raw)
To: Andres Salomon; +Cc: akpm, drzeus-sdhci, sdhci-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]
On Sat, 21 Jun 2008 21:15:16 -0400
Andres Salomon <dilinger@queued.net> wrote:
> This has been sitting around unloved for way too long..
>
> The Marvell CaFe chip's SD implementation chokes during card insertion
> if one attempts to set the voltage and power up in the same
> SDHCI_POWER_CONTROL register write. This adds a quirk that does
> that particular dance in two steps.
>
> It also adds an entry to pci_ids.h for the CaFe chip's SD device.
>
> Signed-off-by: Andres Salomon <dilinger@debian.org>
> ---
Looks ok, but please try to diff against my -next branch. The sdhci
driver has been split up into a core and PCI part.
> @@ -774,6 +784,14 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
> BUG();
> }
>
> + /*
> + * At least the CaFe chip gets confused if we set the voltage
> + * and set turn on power at the same time, so set the voltage first.
> + */
This comment should probably say "Marvell controller" or something like
that. Few know of the CaFE name.
--
-- Pierre Ossman
WARNING: This correspondence is being monitored by the
Swedish government. Make sure your server uses encryption
for SMTP traffic and consider using PGP for end-to-end
encryption.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [OLPC] sdhci: add quirk for the Marvell CaFe's vdd/powerup issue
2008-06-27 16:29 ` Pierre Ossman
@ 2008-06-28 17:02 ` Joel Stanley
2008-07-01 3:07 ` Andres Salomon
0 siblings, 1 reply; 4+ messages in thread
From: Joel Stanley @ 2008-06-28 17:02 UTC (permalink / raw)
To: Pierre Ossman
Cc: Andres Salomon, akpm, drzeus-sdhci, sdhci-devel, linux-kernel
On Sat, Jun 28, 2008 at 1:59 AM, Pierre Ossman <drzeus@drzeus.cx> wrote:
> This comment should probably say "Marvell controller" or something like
> that. Few know of the CaFE name.
Marvell named CaFE the 88ALP01:
http://www.marvell.com/products/pcconn/88ALP01.jsp
But the driver for the webcam part of the chip names it both cafe and 88ALP01:
drivers/media/video/cafe_ccic.c
FWIW, CaFE is easier to say and remember :)
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OLPC] sdhci: add quirk for the Marvell CaFe's vdd/powerup issue
2008-06-28 17:02 ` Joel Stanley
@ 2008-07-01 3:07 ` Andres Salomon
0 siblings, 0 replies; 4+ messages in thread
From: Andres Salomon @ 2008-07-01 3:07 UTC (permalink / raw)
To: Joel Stanley; +Cc: Pierre Ossman, akpm, drzeus-sdhci, sdhci-devel, linux-kernel
On Sun, 29 Jun 2008 02:32:38 +0930
"Joel Stanley" <joel.stan@gmail.com> wrote:
[...]
>
> FWIW, CaFE is easier to say and remember :)
>
> Joel
Indeed, and that's why I've been using it. I have yet to hear anyone
(who isn't reading off the data sheet) call it the"88alp01".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-01 3:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-22 1:15 [OLPC] sdhci: add quirk for the Marvell CaFe's vdd/powerup issue Andres Salomon
2008-06-27 16:29 ` Pierre Ossman
2008-06-28 17:02 ` Joel Stanley
2008-07-01 3:07 ` Andres Salomon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®