summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-linus' of ↵Linus Torvalds2007-10-1152-430/+6259
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: (67 commits) mmc: don't use weight32() pxamci: support arbitrary block size sdio: make the IRQ thread more resilient in the presence of bad states sdio: fix IRQ diagnostic message sdhci: remove old dma module params sdhci: add SDHCI_QUIRK_BROKEN_DMA quirk sdhci: remove DMA capability check from controller's PCI Class reg sdhci: fix a typo mmc: Disabler for Ricoh MMC controller sdio: adaptive interrupt polling mmc: pxamci: add SDIO card interrupt reporting capability mmc: pxamci: set proper buswidth capabilities according to PXA flavor mmc: pxamci: set proper block capabilities according to PXA flavor mmc: pxamci: better pending IRQ determination arm: i.MX/MX1 SDHC implements SD cards read-only switch read-back mmc: add led trigger mmc_spi host driver MMC core learns about SPI MMC/SD card driver learns SPI MMC headers learn about SPI ...
| * mmc: don't use weight32()Nicolas Pitre2007-10-112-2/+4
| | | | | | | | | | | | | | | | | | Using weight32() to determine if a value is a power of 2 is a rather heavi weight solution. The classic idiom is (x & (x - 1)) == 0, but the kernel already provide a is_power_of_2 function for it. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * pxamci: support arbitrary block sizeNicolas Pitre2007-10-101-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PXA has two transmit FIFOes, each32 byte deep. when one FIFO is full and the other one has been transmitted, they are automatically swapped and DMA is triggered for another 32 byte burst. However, when there is less than 32 bytes left to send, the FIFO swap has to be done manually. This is required for some SDIO transfers which are not required to be multiples of 32 bytes. A DMA completion interrupt is set for each descriptor which length isn't a multiple of 32 in order to force the FIFO swap. While at it, the DMA interrupt handler has been made a bit more resilient against errors. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: make the IRQ thread more resilient in the presence of bad statesNicolas Pitre2007-10-061-2/+8
| | | | | | | | | | | | | | | | | | | | | | Currently we print a message about some bad states wrt function IRQ handlers but return 0 from process_sdio_pending_irqs() nevertheless. This can lead to an infinite loop as nothing might have cleared the condition for the pending card interrupt from the host controller by the time host->ops->enable_sdio_irq(host, 1) is called. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: fix IRQ diagnostic messageNicolas Pitre2007-10-061-1/+1
| | | | | | | | | | | | | | If func is actually null we won't get much from sdio_func_id(func). Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdhci: remove old dma module paramsPierre Ossman2007-10-031-12/+1
| | | | | | | | | | | | | | The forcedma and nodma module parameters can be replaced with the quirks parameter, so remove the redundancy. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdhci: add SDHCI_QUIRK_BROKEN_DMA quirkFeng Tang2007-10-031-2/+11
| | | | | | | | | | | | | | | | Some controllers like ENE712 can't work properly with DMA mode, add this quirk to force these kinds of HW work with PIO mode Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdhci: remove DMA capability check from controller's PCI Class regFeng Tang2007-10-031-2/+7
| | | | | | | | | | | | | | | | | | Many host controllers don't fully follow the PCI spec to claim whether they support DMA in PCI class register. Leave the driver to judge it from the Capability register, quirks and module parameter Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdhci: fix a typoNicolas Pitre2007-10-032-2/+2
| | | | | | | | | | Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: Disabler for Ricoh MMC controllerPhilip Langdale2007-10-034-0/+171
| | | | | | | | | | | | | | | | | | | | Thanks to Matt Domsch and Rezwanul Kabir at Dell, we know how to disable the MMC controller on the multi-function Ricoh R5C832. The MMC controller needs to be disabled or it will steal MMC cards from the SD controller where they would otherwise be supported by the Linux SDHCI driver. Signed-off-by: Philipl Langdale <philipl@overt.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: adaptive interrupt pollingPierre Ossman2007-09-271-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | The interrupt polling frequency is a compromise between power usage and interrupt latency. Unfortunately, it affects throughput rather severely for devices which require an interrupt for every chunk of data. By making the polling frequency adaptive, we get better throughput with those devices without sacficing too much power. Polling will quickly increase when there is an actual interrupt, and slowly fall back to the idle frequency when the interrupts stop coming. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: pxamci: add SDIO card interrupt reporting capabilityBridge Wu2007-09-252-5/+24
| | | | | | | | | | | | | | | | Again, only available from PXA27x. Signed-off-by: Bridge Wu <mingqiao.wu@gmail.com> Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: pxamci: set proper buswidth capabilities according to PXA flavorBridge Wu2007-09-252-1/+10
| | | | | | | | | | | | | | | | From PXA27x, it is possible to do 4-bit data transfers. Signed-off-by: Bridge Wu <mingqiao.wu@gmail.com> Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: pxamci: set proper block capabilities according to PXA flavorNicolas Pitre2007-09-251-2/+2
| | | | | | | | | | | | | | From PXA27x, it is possible to do 2048-byte block transfers. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: pxamci: better pending IRQ determinationBridge Wu2007-09-251-1/+1
| | | | | | | | | | | | | | | | | | Pending interrupts should be determined from both I_REG and I_MASK registers. Signed-off-by: Bridge Wu <mingqiao.wu@gmail.com> Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * arm: i.MX/MX1 SDHC implements SD cards read-only switch read-backPavel Pisa2007-09-243-4/+19
| | | | | | | | | | | | | | The patch enables to define MMC host get_ro() method through platform data. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: add led triggerPierre Ossman2007-09-243-0/+16
| | | | | | | | | | | | | | Add a led trigger for each host controller that indicates if there is a request active on the controller. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc_spi host driverDavid Brownell2007-09-235-0/+1461
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the latest version of the MMC-over-SPI support. It works on 2.6.23-rc2 plus git-mmc (from rc1-mm2), along with the preceding patches which teach the rest of the MMC stack about SPI. The main issue of note is that sometimes cards need to be power cycled to recover after certain faults. Also, it may sometimes be necessary to disable CRCs. ("modprobe mmc_core use_spi_crc=n") Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: mikael.starvik@axis.com, Cc: Hans-Peter Nilsson <hp@axis.com> Cc: Jan Nikitenko <jan.nikitenko@gmail.com> Cc: Mike Lavender <mike@steroidmicros.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * MMC core learns about SPIDavid Brownell2007-09-2310-103/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach the MMC/SD/SDIO core about using SPI mode. - Use mmc_host_is_spi() so enumeration works through SPI signaling and protocols, not just the native versions. - Provide the SPI response type flags with each request issued, including requests from the new lock/unlock code. - Understand that cmd->resp[0] and mmc_get_status() results for SPI return different values than for "native" MMC/SD protocol; this affects resetting, checking card lock status, and some others. - Understand that some commands act a bit differently ... notably: * OP_COND command doesn't return the OCR * APP_CMD status doesn't have an R1_APP_CMD analogue Those changes required some new and updated primitives: - Provide utilities to access two SPI-only requests, and one request that wasn't previously needed: * mmc_spi_read_ocr() ... SPI only * mmc_spi_set_crc() ... SPI only (override by module parm) * mmc_send_cid() ... for use without broadcast mode - Updated internal routines: * Previous mmc_send_csd() modified into mmc_send_cxd_native(); it uses native "R2" responses, which include 16 bytes of data. * Previous mmc_send_ext_csd() becomes new mmc_send_cxd_data() helper for command-and-data access * Bugfix to that mmc_send_cxd_data() code: dma-to-stack is unsafe/nonportable, so kmalloc a bounce buffer instead. - Modified mmc_send_ext_csd() now uses mmc_send_cxd_data() helper - Modified mmc_send_csd(), and new mmc_spi_send_cid(), routines use those helper routines based on whether they're native or SPI The newest categories of cards supported by the MMC stack aren't expected to work yet with SPI: MMC or SD cards with over 4GB data, and SDIO. All those cards support SPI mode, so eventually they should work too. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * MMC/SD card driver learns SPIDavid Brownell2007-09-231-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Teaching the MMC/SD block card driver about SPI. - Provide the SPI response type flags with each request issued. - Understand that multiblock SPI writes don't use STOP_TRANSMISSION. - Correct check for APP_CMD failure. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * MMC headers learn about SPIDavid Brownell2007-09-233-13/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach the MMC/SD/SDIO system headers that some hosts use SPI mode - New host capabilities and status bits * MMC_CAP_SPI, with mmc_host_is_spi() test * mmc_host.use_spi_crc flag - SPI-specific declarations: * Response types, MMC_RSP_SPI_R* * Two SPI-only commands * Status bits used native to SPI: R1_SPI_*, R2_SPI_* - Fix a few (unrelated) whitespace bugs in the headers. - Reorder a few mmc_host fields, removing several bytes of padding None of these changes affect current code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: store vendor stringsPierre Ossman2007-09-235-1/+60
| | | | | | | | | | | | | | Store vendor strings found in CISTPL_VERS_1 so that function drivers can access them. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: increase power up delayPierre Ossman2007-09-231-1/+9
| | | | | | | | | | | | | | | | Increase delay for power up in order to support some slower boards. Also add some comments about why the delays are there. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdhci: sdio interrupt supportPierre Ossman2007-09-231-1/+38
| | | | | | | | | | | | Add support for relaying the sdio interrupt signal from the card. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: fix recursion issues between sdio-uart driver and tty layerNicolas Pitre2007-09-231-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a few places, sdio_uart_irq() is called directly instead of waiting for the actual interrupt to be raised and the SDIO IRQ thread scheduled in order to reduce latency. However, some interaction with the tty core may end up calling us back (serial echo, flow control, etc.) creating two issues: - the host lock gets claimed twice from the same thread causing a deadlock; - the same direct calls to sdio_uart_irq() may be performed causing unexpected reentrancy into the IRQ handler. This patch handles both of those issues. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: add default c_ispeed/c_ospeed values to sdio_uart driverNicolas Pitre2007-09-231-0/+2
| | | | | | | | | | | | | | | | | | Note that the default baudrate is 4800 instead of 9600 as a convenience because that's what GPS devices want which is still the main use for this driver. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: add sdio_f0_readb() and sdio_f0_writeb()David Vrabel2007-09-232-0/+69
| | | | | | | | | | | | | | | | | | Add sdio_f0_readb() and sdio_f0_writeb() functions to reading and writing function 0 registers. Writes outside the vendor specific CCCR registers (0xF0 - 0xFF) are not permitted. Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: replace BUG_ON with WARN_ONPierre Ossman2007-09-235-15/+13
| | | | | | | | | | | | | | | | Replace all cases of BUG_ON with WARN_ON where there is a chance (with varying degrees of slim) that the kernel can continue without incidence. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: kmalloc + memset conversion to kzallocMariusz Kozlowski2007-09-231-3/+1
| | | | | | | | | | Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: extend sdio_readsb() and friends to handle any length of bufferDavid Vrabel2007-09-233-28/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend sdio_readsb(), sdio_writesb(), sdio_memcpy_fromio(), and sdio_memcpy_toio() to handle any length of buffer by splitting the transfer into several IO_RW_EXTENDED commands. Typically, a transfer would be split into a single block mode transfer followed by a byte mode transfer for the remainder but we also handle lack of block mode support and the block size being greater than 512 (the maximum byte mode transfer size). host->max_seg_size <= host->max_req_size so there's no need to check both when determining the maximum data size for a single command. Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: set the functions' block sizeDavid Vrabel2007-09-234-2/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before a driver is probed, set the function's block size to the default so the driver is sure the block size is something sensible and it needn't explicitly set it. The default block size is the largest that's supported by both the card and the host, with a maximum of 512 to ensure aribitrarily sized transfer use the optimal (least) number of commands. See http://lkml.org/lkml/2007/8/7/150 for reasons for the block size choice. Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: add SDIO_FBR_BASE(f) macroDavid Vrabel2007-09-233-3/+5
| | | | | | | | | | Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: fix sdio timeout calculationPierre Ossman2007-09-231-0/+9
| | | | | | | | | | | | | | SDIO doesn't have a CSD so it uses different timeout values than SD memory. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: fix incorrect divisor in debug outputPierre Ossman2007-09-231-1/+1
| | | | | | | | Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: enable wide bus modePierre Ossman2007-09-231-0/+33
| | | | | | | | | | | | | | Enable 4-bit data bus mode, according to host and card capabilities. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: change clock speedPierre Ossman2007-09-231-0/+6
| | | | | | | | | | | | Change clock speed to the highest supported by the card. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * make struct sdio_dev_attrs[] staticAdrian Bunk2007-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Wed, Jul 25, 2007 at 04:03:04AM -0700, Andrew Morton wrote: >... > Changes since 2.6.22-rc6-mm1: >... > git-mmc.patch >... > git trees >... sdio_dev_attrs[] can become static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: add interface for host side SDIO interrupt reportingNicolas Pitre2007-09-233-1/+18
| | | | | | | | | | Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: support IO_RW_EXTENDEDPierre Ossman2007-09-235-0/+275
| | | | | | | | | | | | | | Support the multi-byte transfer operation, including handlers for common operations like writel()/readl(). Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: add /proc interface to sdio_uart driverNicolas Pitre2007-09-231-0/+62
| | | | | | | | | | | | | | This mimics what the serial_core does. Useful for diagnostics. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: UART/GPS driverNicolas Pitre2007-09-233-0/+1086
| | | | | | | | | | | | | | | | This currently only accepts the GPS class since that's all I have for testing. Tested with a Matsushita GPS and gpsd version 2.34. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: core support for SDIO function interruptNicolas Pitre2007-09-235-1/+257
| | | | | | | | | | Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: allow for mmc_claim_host to be abortedNicolas Pitre2007-09-232-7/+28
| | | | | | | | | | | | | | | | | | | | It is sometimes necessary to give up on trying to claim the host lock, especially if that happens in a thread that has to be stopped. While at it, fix the description for mmc_claim_host() which was wrong. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: defines for some standard interface typesNicolas Pitre2007-09-231-0/+23
| | | | | | | | | | Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: add basic sysfs attributesPierre Ossman2007-09-231-0/+32
| | | | | | | | Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: add modalias supportPierre Ossman2007-09-232-1/+40
| | | | | | | | Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: whip bus uevent handler into shapePierre Ossman2007-09-231-14/+17
| | | | | | | | | | | | Make the mmc bus uevent callback look like all other subsystems. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: add device id table and matchingPierre Ossman2007-09-233-7/+92
| | | | | | | | Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * mmc: initialize mmc subsystem with subsys_initcall()Nicolas Pitre2007-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that the sdio_bus must be registered before any SDIO drivers are registered against it otherwise the kernel sulks. Because the sdio_bus registration happens through module_init (equivalent to device_initcall), then any SDIO drivers linked before the SDIO core code in the kernel will be initialized first. Upcoming SDIO function drivers are likely to be located outside the drivers/mmc directory as it is common practice to group drivers according to their function rather than the bus they use. SDIO drivers are therefore likely to appear at random location in the kernel link. To make sure the sdio_bus is always initialized before any SDIO drivers, let's move the MMC init to the subsys_initcall level. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
| * sdio: split up common and function CIS parsingPierre Ossman2007-09-237-26/+205
| | | | | | | | | | | | | | | | Add a more clean separation between global, common CIS information and the function specific one as we need the common information in places where no specific function is specified. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
OpenPOWER on IntegriCloud