olpc: sdhci: add quirk for the Marvell CaFe's vdd/powerup issue

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>
Cc: Pierre Ossman <drzeus-list@drzeus.cx>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Andres Salomon and committed by Linus Torvalds e08c1694 49153998

+19
+18
drivers/mmc/host/sdhci.c
··· 55 55 #define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<7) 56 56 /* Controller needs to be reset after each request to stay stable */ 57 57 #define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<8) 58 + /* Controller needs voltage and power writes to happen separately */ 59 + #define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1<<9) 58 60 59 61 static const struct pci_device_id pci_ids[] __devinitdata = { 60 62 { ··· 127 125 .subdevice = PCI_ANY_ID, 128 126 .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | 129 127 SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS, 128 + }, 129 + 130 + { 131 + .vendor = PCI_VENDOR_ID_MARVELL, 132 + .device = PCI_DEVICE_ID_MARVELL_CAFE_SD, 133 + .subvendor = PCI_ANY_ID, 134 + .subdevice = PCI_ANY_ID, 135 + .driver_data = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER, 130 136 }, 131 137 132 138 { ··· 783 773 default: 784 774 BUG(); 785 775 } 776 + 777 + /* 778 + * At least the CaFe chip gets confused if we set the voltage 779 + * and set turn on power at the same time, so set the voltage first. 780 + */ 781 + if ((host->chip->quirks & SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER)) 782 + writeb(pwr & ~SDHCI_POWER_ON, 783 + host->ioaddr + SDHCI_POWER_CONTROL); 786 784 787 785 writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL); 788 786
+1
include/linux/pci_ids.h
··· 1520 1520 #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 1521 1521 #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 1522 1522 #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 1523 + #define PCI_DEVICE_ID_MARVELL_CAFE_SD 0x4101 1523 1524 1524 1525 #define PCI_VENDOR_ID_V3 0x11b0 1525 1526 #define PCI_DEVICE_ID_V3_V960 0x0001