summaryrefslogtreecommitdiff
path: root/sys/dev/sdmmc
AgeCommit message (Collapse)Author
2023-04-29sdmmc: Only check chipset WP status for SD cards.jmcneill
The sdmmc_chip_write_protect callback returns the write protect switch status from the controller (SDWP#). This signal does not exist for eMMC; instead, write protect is signaled using card registers (CSD). So lets skip asking the chipset for WP status on eMMC cards for each write request.
2022-12-03Fix bug in protocol parser that often caused fatal 'checksum error'.mlelstv
Defer power save setting to interface start. More verbose on errors. Allow build without FDT.
2022-11-02Select DMA mode after programming the ADMA base address register(s).jmcneill
The Arasan SDHCI 8.9a found in the Xilinx Zynq-7000 SoC requires this sequence to avoid sporadic transfer errors.
2022-10-14Disable ADMA2 on Ricoh SDHCI controllers.jmcneill
PR# 57015
2022-06-18Trailing whitespaceskrll
2022-05-16sdmmc: ld: Include the card type (SD card, MMC) in the disk description.jmcneill
2022-03-14Add OpenBSD to code to optionally load CLM (Country Locale Matrix) files.mlelstv
2022-02-06sdhc: Retire SDHC_FLAG_USE_ADMA2 flag.jmcneill
ADMA2 support in sdhc is mature now, so no need for it to be opt-in.
2022-01-17sdhc: avoid taking adaptive mutex while holding spin mutexmrg
the clock_bus pre- and post- callbacks used in sdhc_bus_clock_ddr() are called with a spin mutex held, and the new sdhc@acpi ends up calling into (sleeping) ACPI code, triggering lockdebug assertion. introduce an adaptive mutex that is held around these callbacks, and reduce the spin mutex held time in sdhc_bus_clock_ddr().
2022-01-15sdhc: High speed support capability flag applies to eMMC too.jmcneill
2021-11-10s/suport/support/ in comment.msaitoh
2021-08-08Fixup bwfm(4) register bit regarding SDIO device suspend/resume.jmcneill
From OpenBSD if_bwfm_sdio.h r1.3
2021-08-08Use SMBIOS system product instead of the string "netbsd,generic-acpi"jmcneill
for firmware loading on ACPI systems.
2021-08-07Merge thorpej-cfargs2.thorpej
2021-08-03 Use unsigned to avoid undefined behavior in sdmmc_mem_sd_switch().msaitoh
Found by kUBSan.
2021-06-21fix proplib deprecationchristos
2021-06-13Don't crash on detach where interlock == NULL.mlelstv
2021-06-13Be less verbose normally and more when debugging.mlelstv
2021-05-13 Use unsigned to avoid undefined behavior in hwrite[12](). Found by kUBSan.msaitoh
2021-04-24Merge thorpej-cfargs branch:thorpej
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
2021-03-13Enable block count only for count > 0.mlelstv
Don't enable autostop when command sets new flag SCF_NO_STOP.
2021-03-13define NO_STOP flagmlelstv
2021-01-27Rename of_match_compat_data() to of_compatible_match(). Similarly,thorpej
rename of_search_compatible() to of_compatible_lookup(). Standardize on of_compatible_match() for driver matching, and adapt all call sites.
2020-11-03Continue parsing frames after empty payload.mlelstv
Add diagnostic messages.
2020-10-17Fix error message. No functional change, both commands use the samemlelstv
bit to select read or write mode.
2020-08-02Remove unnecessary wait in ldbegindetach.riastradh
Like disk_begindetach, ldbegindetach only commits to detaching but doesn't wait for existing xfers to drain; it is up to the driver to abort them, once we are committed, and then ldenddetach to wait for them to drain.
2020-07-22Sort includes. Nix trailing whitespace.riastradh
No functional change intended.
2020-07-22Need <sys/kmem.h> for kmem_*.riastradh
Currently accidentally side-loaded by <sys/pcq.h>.
2020-07-22Sort #includes. Nix trailing whitespace.riastradh
No functional change intended.
2020-07-22Omit needless <sys/pcq.h>.riastradh
2020-07-20clear all interrupts, not just those we expect from the hostintmask.mrg
this removes the final hard hang i have seen in pinebookpro wifi, though one may still need to 'ifconfig bwfm0 down up' occasionally, so we still have bugs to fix here (the hang is usually associated with 'checksum error' from bwfm/sdio.)
2020-07-20only ask for SDPCMD_INTSTATUS_HMB_SW_MASK and SDPCMD_INTSTATUS_CHIPACTIVEmrg
interrupts, not all of them. we only ack these ones. mostly fixes pinebookpro wifi hard hangs. still is problematic and can trigger interrupt storm that appears as a hard hang without NET_MPSAFE, and a follow up, less clearly right, change will reduce that to a soft hang of the interface that can be cleared with 'ifconfig bwfm0 down up', and even often recovers itself now.
2020-07-15Identify SDHC 4.1 and 4.2. From {DragonFly,Free}BSD.msaitoh
2020-06-23Make this work on big endian machinesmartin
2020-05-30discussed with thorpej@, and it seems it's better to allocate the bssjdolecek
alignment buffer statically (as part of softc) just to be sure to not affect performance
2020-05-30constify, and make static where possiblejdolecek
2020-05-24Fix races in sdmmc tasks and teach ld@sdmmc to abort xfers on detach.riastradh
- Teach sdmmc_add_task to queue it only if not already queued. - Remove now-redundant logic to avoid repeated queueing elsewhere. - Teach sdmmc_del_task to wait until task has completed. - Call sdmmc_del_task in various needful places. - Replace abuse of pcq by a lock and a tailq. (pcq is multi-producer, _single_-consumer, but there are potentially multiple consumers here and really only one producer.) - Teach ld_sdmmc to abort xfers on detach. (Mechanism is kinda kludgey but it'll do for now; any effort one is tempted to spend overhauling this should be spent overhauling sdmmc to support proper asynchronous commands.) - Make sure ld_sdmmc_discard either returns failure or eventually calls ldenddiscard. XXX Currently ld_sdmmc_detach aborts xfers _before_ ldbegindetach has has committed to detaching or not. This is currently necessary to avoid a deadlock because ldbegindetach waits for xfers to drain -- which strikes me as wrong; ldbegindetach shouldn't wait for anything, and should only make the decision to commit to detaching or not so the caller can decide whether to abort xfers before we actually wait for them in ldenddetach. XXX pullup -- although this changes some kernel symbols (sdmmc_add_task and sdmmc_del_task), it shouldn't affect any existing modules; the only module that uses sdmmc is ld_sdmmc.kmod, which is `.if 0' in the build so there shouldn't be any of them floating around.
2020-05-11If the controller doesn't support switch func (opcode 6) then skipjdc
setting this but continue with other settings. This allows us to use a card, albeit at a lower speed.
2020-05-07add entry for BCM43362, found on Cubietruckmacallan
ok jmcneill@
2020-03-25- Refactor the firmware loading code into a set of common routines in thethorpej
core driver that understand how to find model-specific files before the generic files. This greatly simplifies the firmware loading procedure in each of the bus front ends. Adding additional firmware file types (such as CLM files) much simpler. - Make firmware image selection table-driven rather than a set of switch() and if() statements. - Add several additional firmware image entries.
2020-01-29Adopt <net/if_stats.h>.thorpej
2020-01-04Be less noisy for some commands.mlelstv
2020-01-04size check was backwards.mlelstv
2020-01-01Use correct firmware for BCM43456jmcneill
2020-01-01regenjmcneill
2020-01-01Add product ID for Broadcom BCM43455jmcneill
2019-12-30Follow the Linux driver an use the FDT "compatible" property to build amlelstv
filename for the nvram config file, fall back to the standard filename. E.g. # ofctl -p / [Caching 123 nodes and 1093 properties] #address-cells 00000001 ........ ........ ........ 1 #size-cells 00000001 ........ ........ ........ 1 compatible 73696e6f 766f6970 2c627069 2d6d322d "sinovoip,bpi-m2- 0010: 7a65726f 00...... ........ ........ zero" 0015: 616c6c77 696e6e65 722c7375 6e38692d "allwinner,sun8i- 0025: 68322d70 6c757300 ........ ........ h2-plus" interrupt-parent 00000001 ........ ........ ........ .... model 42616e61 6e612050 69204250 492d4d32 "Banana Pi BPI-M2 0010: 2d5a6572 6f00.... ........ ........ -Zero" name 00...... ........ ........ ........ "" serial-number 30326330 30303432 65636431 36376566 02c00042ecd167ef 0010: 00...... ........ ........ ........ . -rw-r--r-- 1 root wheel 875 Nov 2 12:06 brcmfmac43430-sdio.AP6212.txt lrwxr-xr-x 1 root wheel 29 Dec 30 16:19 brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt -> brcmfmac43430-sdio.AP6212.txt -rw-r--r-- 1 root wheel 874 Jun 30 2019 brcmfmac43430-sdio.raspberrypi,3-model-b.txt -rw-r--r-- 1 root wheel 1864 Jun 30 2019 brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt lrwxr-xr-x 1 root wheel 29 Dec 30 11:24 brcmfmac43455-sdio.raspberrypi,4-model-b-plus.txt -> brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
2019-12-19Avoid changing signedness bit with << in sdmmc_ioreg.hkamil
Reported by <prlw1>
2019-12-02drop my name from the advertising clause.christos
2019-11-10in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAITchs
and remove code to handle failures that can no longer happen.