summaryrefslogtreecommitdiff
path: root/sys/dev/sdmmc
AgeCommit message (Collapse)Author
2013-10-25Turn a few __unused into __diagusedmartin
2013-10-19add Ricoh MMC readermlelstv
2013-10-12Pass the device name in, so we can debug what deferred drivers did not work.christos
2013-05-03Add support for the valid card types in eMMC v4.4 (needed by beaglebonematt
black).
2013-05-03Fix typo.matt
2013-01-10add SDHC_FLAG_NO_HS_BIT flag to prevent sdhc driver from setting the ↵jmcneill
SDHC_HIGH_SPEED bit in SDHC_HOST_CTL, required to get many high speed cards working on rpi
2013-01-08If the command protocol calls for a trailing busy signal,jakllsch
wait (up to 10 seconds) for it to be released.
2013-01-07Find correct slot index in sdhc_cfprint().jakllsch
2012-12-24SDHC_VOLTAGE_SUPP_1_8V is only valid in the presence of SDHC_EMBEDDED_SLOT.jakllsch
Fixes probing of full-size 1GB Toshiba card made in 2008 that fails to respond with a 1.8V supply. (JMB389 (in TS-RDF1) host claims SDHC_VOLTAGE_SUPP_1_8V but does not claim SDHC_EMBEDDED_SLOT.)
2012-12-24Add a few more register bits from SDHCI 3.0.jakllsch
Also, add comment to denote an ESDHC bit.
2012-12-23SMC_CAPS_DMA without SMC_CAPS_MULTI_SEG_DMA means we as a host driver onlyjakllsch
can support one segment per operation. This is not the case with SDHCI SDMA, the only SDHCI DMA mechanism we currently support in sdhc(4). Should fix corrupt data on DMA-enabled SDHCI controllers claiming conformance to a SDHCI Specification other than 1.0.
2012-12-22We can't block our interrupt while sdmmc_detach_card is called, asjakllsch
it can issue commands, and some host drivers have interrupt-driven command completion. Prevents assertion (or deadlock) upon detach of sdhc(4) with inserted card.
2012-12-22Revert sdmmc.c r1.18 (previous commit to this file).jakllsch
It seems to have caused regressions to detaching drivers from cards at the appropriate time. DETACH_FORCE to sdmmc_card_detach really means the SD/SDIO card is gone, and can not be abused to mean that the host controller disappered.
2012-12-22Add support for SDHCI 3.0 bus clock generation, which unlike 1.0 and 2.0jakllsch
has support for non-power-of-two divisors from 1 to 1023. Additionally restore finding the correct power-of-two divisor for standard-compliant pre-3.0 SDHCI parts. Also, calculate minimum divided clock for the clkmsk-quirk parts correctly. XXX Will future standard-compliant SDHCI versions have a SDHCI 3.0 backwards-compatible clock generator, or just SDHCI 1.0/2.0?
2012-12-20If we get a SDMA boundary-crossing interrupt at the end of the finaljakllsch
segment, the transfer is not implicitly complete; we still need to wait for the transfer complete interrupt so that we can issue new commands successfully. This fixes the problem my Ricoh R5C822 was having where all writes after a larger (64KiB) write were failing because we attempted to issue CMD13 (to check the status of the aformentioned write) too soon afterwards. I suspect this fix to apply to other Ricoh SDHCI controllers I've heard people have had trouble with. Sorry I didn't look at this sooner.
2012-12-20Change sdhc_detach so that it detaches all host controllers at once.jakllsch
This should make multiple slot controllers, for example those with a controller on more than one PCI/CardBus BAR, detach with fewer bugs. Tested with as-of-yet-uncommited sdhc_pci changes on a single-host ExpressCard JMicron JMB38[89].
2012-12-20Only use DETACH_FORCE as flags argument to sdmmc_card_detach when thejakllsch
host controller has disappeared or is detaching. XXX should pass flags from sdmmc_detach through to the task thread ending to differentiate host controller disappearance from mere detachment.
2012-12-20fix off-by-one in switch function argument validation.jakllsch
2012-12-15It's also useful to compile-test before committing.jakllsch
2012-12-15When debugging, it's useful to know what exactly failed.jakllsch
2012-12-15Correctly read the 512-bit-wide big-endian Switch Function Status register.jakllsch
Some of this could/will also be useful for the SD Status register.
2012-12-14Display the whole CID register upon attach as "<MID:OID:PNM:PRV:PSN:MDT>"jakllsch
instead of just "<PNM>". Probably should figure out a way to stuff this into the device properties database too, but not everything has pseudo-device drvctl enabled. Also, drop trailing whitespace.
2012-12-14The Card Command Class (CCC) field is valid in both SD_CSD_CSDVER_1_0jakllsch
and SD_CSD_CSDVER_2_0.
2012-12-13Implement TI AM335x's SDHC reset quirk. Beaglebone SDHC works now!riastradh
On the AM335x, we first must wait for the controller to acknowledge the reset; then we can wait for the reset to complete. I believe this quirk also applies to the OMAP4 ES, but I don't have one of those to test and we don't seem to have an obvious conditional for it anyway. This quirk may work for controllers that don't require it too, but I am nervous about doing it by default because if we miss the reset acknowledgement, then we'll just time out even though everything is really hunky-dory. Also, for all sdhc, don't bother writing 0 in sdhc_soft_reset while waiting for the reset to complete; there is no need. ok matt
2012-12-12Add sc_vendor_bus_clock hookmatt
From jmcneill.
2012-12-12Avoid the 16-bit read in sdhc_host_found for 32-bit-only devices.riastradh
This change makes sdhc_host_found allocate hp up front before showing the identification, in order to avoid having to open-code a copy of HREAD2 before hp is available.
2012-10-29Support omap3 SDHC driver. tested on OVERO only.kiyohara
2012-10-27split device_t/softc for all remaining drivers.chs
replace "struct device *" with "device_t". use device_xname(), device_unit(), etc.
2012-10-15Make whitespace following preprocessor keywords consistentjakllsch
with the predominating form in this file (that is, a space).
2012-10-13Fix variable name for message of printf.kiyohara
2012-09-13Don't use const foo const as type, one const is enough.joerg
2012-08-31Support deciphering SDHCv3 clock rates.matt
2012-08-04Print 'Standard Function Interface Code" in sdmmc_print(), if not ↵kiyohara
SD_IO_SFIC_NO_STANDARD.
2012-07-30Make PIO on normal SDHC devices work correctly on big-endian machines.matt
Add locking around interrupt manipulation (it should now be MP safe).
2012-07-28Only SDHC 1.0 controllers can do that fucky MULTI_SEG stuff.matt
2012-07-28sdhc(4) currently only implements support for the SDHC 1.0 DMA mechanism, sojakllsch
only enable in that case.
2012-07-28Fix comments about __bitfield.matt
2012-07-26Fix a delay to a correct value.matt
2012-07-26MULTI_SEG does not for ESDHC. (Don't know how it works at all on any SDHCmatt
but ...)
2012-07-23Responses are actually in host order (except SCR which is return inmatt
big endian so that's convert to host order).
2012-07-21Provide a method for attachments to specify capabilites.skrll
2012-07-20Add use of watermark register when PIO to an ESDHC. After every kill ormatt
drain of watermask words, pause a bit to give time for the fifo to recover. Always the command response in BE byteorder. Rewrite __bitfield to deal with this.
2012-07-17If there was an error in 32-bit mode, just set ERROR_INTERRUPT otherwisematt
see if matched anything we care about.
2012-07-17Handle interrupt acknowledgement in the SDHC_FLAG_32BIT_ACCESS case inskrll
the same way as non-SDHC_FLAG_32BIT_ACCESS case.
2012-07-17Whitespace.skrll
2012-07-12bus_space_*_stream_N() functions are not universally available.jakllsch
Provite alternate implementation for when they are unavailable.
2012-07-12Completely rework (and enable) SDHC 1.0 DMA data transfer.jakllsch
While without a large physically-contiguous buffer the performance suffers severly, this should still be better than PIO.
2012-07-12No need to panic on failure to find a divisor.jakllsch
Additionally, add commented out calculation of actual clock frequency.
2012-07-12SDHC can have multiple slots, note which slot a specific sdmmc(4) attaches to.jakllsch
2012-07-12SDHCI byte swaps the BE response on the wire into LE registers.jakllsch
As we always want response data in LE, use bus_space_read_stream. Additonally, read response data in 1 or 4 4-byte chunks, instead of one 4-byte chunk or 15 1-byte chunks.