summaryrefslogtreecommitdiffstats
path: root/sys/dev/sdmmc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Apparently one of the main concepts in the SDMMC I/O subsystem is thatpatrick2017-10-121-7/+7
| | | | | | | | | | | | the driver attached to an SDIO card always holds the lock and only releases it once it detaches. Now with that in mind, some time ago sdmmc_io_function_disable() and sdmmc_io_function_ready() were changed to only assert the write lock and not take it, but not all of the tree was converted. Change sdmmc_io_function_enable() as well, and remove the enter/exit dance in the interrupt code. Apparently there is no SDIO driver yet/anymore which would trigger those issues. ok kettenis@
* Add bwfm(4), a driver for Broadcom FullMAC WiFi controllers. Thepatrick2017-10-112-1/+455
| | | | | | | | | | | | | | FullMAC, in comparison to SoftMAC, does most WiFi handling in the firmware that's running on the controller. This means we have to work around the net80211 stack while still implementing all the WiFi interfaces to userland. This driver is still in early development. So far it can connect to open WiFis over the USB bus. SDIO and PCIe support, for devices like the Raspberry Pi 3 or the Macbooks, is not yet implemented. Also mbufs on the transmit path leak and are not yet freed. ok stsp@
* Fix a memory leak in an error path. Coverity CID 1453042.jsg2017-08-281-2/+2
| | | | ok visa@
* Implement two quirks to support the Arasan eMMC 5.1 controller found onkettenis2017-05-052-2/+11
| | | | | | | | | | the Rockchip RK3399. - Make it possible to override sdhc_signal_voltage(). - Make it possible to disable double-data rate modes. ok patrick@
* Sizes for the remaining free() calls, and use mallocarray()deraadt2017-04-062-7/+12
| | | | ok visa
* remove stray character in previous that broke the buildjsg2017-04-061-2/+2
|
* add sizes to free() callsderaadt2017-04-064-11/+11
| | | | ok dhill
* p_comm is the process's command and isn't per thread, so move it fromguenther2017-01-213-8/+8
| | | | | | struct proc to struct process. ok deraadt@ kettenis@
* sdmmc sd(4) devices should be marked SID_REMOVABLE, so that eject(1) canderaadt2017-01-201-1/+2
| | | | | succeed. No downside in the bottom part of the driver. ok dlg krw
* Get SDIO reset working.mglocker2016-09-111-8/+8
| | | | Tested and ok kettenis
* Sync with the ADMA2 implementation in imxesdhc(4):kettenis2016-05-151-2/+5
| | | | | | | Map the ADMA2 descriptor table use BUS_DMA_COHERENT and add a missing bus_dmamap_sync(9). Doesn't really fix anything, but adding the missing sync makes the code more correct. Using BUS_DMA_COHERENT avoids some cache flushes on architectures that implement it.
* Remove bogus rw_exit() call.kettenis2016-05-121-2/+2
|
* Bump up the clock to 25 MHz before trying to read the SCR register of an SDkettenis2016-05-052-27/+39
| | | | | | card. Data transfers don't seem to work on the Realtek RTS5229 Card Reader if the clock frequency is too low, and reading the SCR requires a data transfer.
* Add Dual Data Rate support for eMMC at 52MHz.kettenis2016-05-057-51/+172
|
* Populate SCSI inquiry data with information from SD and MMC cards.kettenis2016-05-051-7/+39
| | | | | | Code is slightly more convoluted to avoid using strncpy(9). ok jsg@, millert@, deraadt@
* Print SD host controller version.kettenis2016-05-041-2/+3
|
* Add high-speed support for SD cards. In theory this should double thekettenis2016-05-045-15/+142
| | | | | transfer rates to and from the card. In practice the improvement will be smaller, but I am seeing serious improvement in the read speeds.
* Print some capabilities.kettenis2016-05-011-1/+13
| | | | ok deraadt@, patrick@
* Print base clock frequency.kettenis2016-05-011-1/+3
| | | | ok deraadt@, patrick@
* Add bus width switching support for MMC. Enable 8-bit bus support onkettenis2016-05-012-5/+38
| | | | | | | sdhc(4) controllers that support it. Mostly from NetBSD. This makes the raw transfer rate of the eMMC on the Lenovo Ideacentre Stick 300 go up to 40 MB/s.
* Add a small delay after switching an MMC card into high-speed mode to makekettenis2016-05-011-1/+3
| | | | sure it has witched before changing the bus clock speed.
* Always write block count. This fixes the DMA issues on Bay Trail.kettenis2016-05-011-3/+2
|
* Add support for changing the bus width to the sdmmc subsystem and the sdhc(4)kettenis2016-05-016-39/+192
| | | | | | controller. Use this to switch SD cards to a 4-bit bus if they support it. ok deraadt@, jsg@
* Enable high speed timing for bus clock frequencies over 26MHz and advertisekettenis2016-04-301-1/+11
| | | | | support for it. In principle SD cards use high speed timing for frequencies over 25MHz, but it is silly to run those with a clock between 25-26MHz.
* Add some missing interrupt bits, and enable the ADMA error interrupt.kettenis2016-04-301-4/+6
|
* Implement DMA support. Bits and pieces taken from NetBSD, but we onlykettenis2016-04-307-30/+260
| | | | | | | | | | | | support ADMA2. The older SDMA mode has too many limitations to be really usable. Gives us only moderate speed improvements, bus reduces the CPU load considerably. We will reap the full benefits once we implement wider bus widths and high speed modes. There is a remining issue with simultanious use of eMMC and external SD card on (some) Intel Bay Trail hardware. Still under investigation. ok patrick@, stsp@, deraadt@
* Implement reading of the CIS for functions 1-7. Don't write a bogus bus widthkettenis2016-04-233-44/+34
| | | | | | value when initializing function 0, and correct a few related #defines. ok deraadt@
* Expose the functionality that triggers a check for card insertion or removal.kettenis2016-03-302-2/+13
| | | | ok jsg@
* Make it possible to override the standard card detect mechanism. The SDkettenis2016-03-272-2/+8
| | | | | | | | controller on Intel's Bay Trail SoC tends to be used in a way where a separate gpio is used that signals the presence of a card in a slot. This change allows us to support that mode. ok stsp@
* Reduces the noise around the global ``ticks'' variable by renaming allmpi2016-03-191-4/+4
| | | | | | | | local ones to ``nticks''. (missed in previous) ok stefan@, deraadt@
* Improve CIS parsing to recognize CISTPL_NULL codes instead of bailing out onkettenis2016-01-112-8/+13
| | | | | | them. Add symbolic constant for CISTPL_END. ok jsg@
* Add (limited) support for controllers that implement version 3.0 of thekettenis2016-01-112-8/+46
| | | | | | | SD host controller standard. Support the larger base clock and larger clock divisors. ok jsg@
* Seems the voltage bit defenitions in sdmmcreg.h for voltages below 2Vkettenis2016-01-102-8/+5
| | | | | | | | | | | | are not quite right. At least I can't find them in any of the MMC and SD card documentation I can find on the interwebs. Instead there is a single "low voltage bit" that indicates support for the 1.65-1.95V or 1.70-1.95V range depending on the document you're reading. Go with the 1.65-1.95V range as that is what Linux does. Necessary (but not sufficient) to make the eMMC on the ASUS X205TA work. ok jsg@ (who did the armv7 bits)
* Always claim to support sector mode for eMMC. Allows BeagleBone Blackjsg2015-11-082-2/+7
| | | | | | | | | | | | boards with Micron eMMC to work. The Micron eMMC seems to adhere to the spec which states: "If there is no indication by a host to a memory that the host is capable of handling sector type of addressing the higher than 2GB of density of memory will change its state to Inactive (similarly to a sit- uation in which there is no common voltage range to work with)" From Ian Sutton with feedback from uwe@
* Init error to 0 for sdmmc_mem_single_{read,write}_blockjsg2015-04-221-3/+3
| | | | | otherwise the value would be uninitialised in the unlikely case of being called with length 0.
* Remove some includes include-what-you-use claims don'tjsg2015-03-144-8/+4
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* Memory leak if copyin() or copyout() fails; found by Maxime Villardmiod2015-02-161-8/+11
| | | | max@M00nBSD.net's code scanner; ok doug@ jca@
* More malloc() -> mallocarray() in the kernel.doug2014-12-091-2/+2
| | | | ok deraadt@ tedu@
* fix the build when SDMMC_DEBUG is definedjsg2014-11-012-3/+4
|
* Fix high capacity (> 2GB) eMMC support.rapha2014-09-232-12/+18
| | | | | | Based on a diff by Cedric Tessier, nezetic at gmail dot com, thanks! Discussed with and ok jsg@
* remove uneeded proc.h includesjsg2014-09-143-6/+3
| | | | ok mpi@ kspillner@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-125-15/+15
| | | | after discussions with beck deraadt kettenis.
* "It's not the years, honey; it's the mileage."tedu2014-07-112-588/+1
| | | | | | bluetooth support doesn't work and isn't going anywhere. the current design is a dead end, and should not be the basis for any future support. general consensus says to whack it so as to not mislead the unwary.
* Raise the delay before initializing sdmmc. Still a hack so the XXX stays,sthen2014-03-051-2/+2
| | | | | but at least lets the reader on X220 work pretty reliably, rather than about 1/4 of the time. ok stsp@
* if cold, do not use tsleep, but use the delay path.deraadt2014-01-231-2/+2
| | | | | Such as during DVACT_RESUME... ok guenther kettenis
* rearrange DVACT_RESUME chunk to avoid implying something ridiculousderaadt2013-12-211-2/+2
| | | | ok stsp
* Add a DVACT_WAKEUP op to the *_activate() API. This is called after thederaadt2013-12-062-15/+12
| | | | | | | | kernel resumes normal (non-cold, able to run processes, etc) operation. Previously we were relying on specific DVACT_RESUME op's in drivers creating callback/threads themselves, but that has become too common, indicating the need for a built-in mechanism. ok dlg kettenis, tested by a sufficient amount of people
* simplify kthread_create(). no more stdargderaadt2013-11-181-2/+2
| | | | ok matthew guenther mikeb
* Add code for SMC_CAPS_SINGLE_ONLY capability.syl2013-10-221-8/+83
| | | | | | | | | This capability force the sdmmc stack to only issue single blocks transfers. tested by rapha@ and I on ommmc(4). tested by rapha@ on pxammc(4). ok rapha@
* Add basic support for eMMC memory.rapha2013-09-125-11/+214
| | | | | | | | Heavily based on netbsd. Tested by dlg@, bcallah@ (sdhc), stsp@ (rstx) and me (ommmc). ok patrick@