summaryrefslogtreecommitdiffstats
path: root/sys/dev/sdmmc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix SDMMC_DEBUG buildkn2021-03-272-8/+8
| | | | | - Replace undefined SDMMCDEVNAME macro with usual DEVNAME from sdmmcvar.h - typofix struct member name
* Refactor bwfm(4) firmware loading. The PCIe backend will need to be ablepatrick2021-02-261-100/+3
| | | | | | | to load the CLM blob like the SDIO backend already does. Additionally it is also helpful for the PCIe backend to try a file named after the device tree compatible. Thus refactor the SDIO code and make it available for both SDIO and PCIe.
* sdmmc(4): sdmmc_io_function_enable(): don't sleep on lboltcheloha2020-12-261-2/+2
| | | | | | | | Just sleep for 1 second on the nowake channel instead. With input from kettenis@, mpi@, and claudio@. ok kettenis@
* Replace simple one-line bcopy()/memcpy() of faked data into scsi_xfer with callkrw2020-10-151-2/+2
| | | | | to scsi_copy_internal_data(). Thus getting xs->resid properly set and adding the usual uio/size sanity checks.
* Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw2020-09-221-9/+9
| | | | | | | | | | | | member of 'struct scsi_xfer' has always been pointed at the 'struct scsi_generic cmdstore' member of the same instance. So nuke 'cmdstore' and remove the '*' from cmd. Take the address of cmd as required by the various casts. No intentional functional change. luna88k test by aoyama@, sparc64 test by jmatthew@ Identification of 2009's last *cmd use and ok jmatthew@
* Replace '32' with SID_SCSI2_ALEN (a.k.a. 31) when building emulated INQUIRYkrw2020-09-051-2/+2
| | | | | responses. This is what the SCSI specifications say is the correct value and already used in several cases.
* Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.krw2020-09-031-2/+2
|
* When building emulated INQUIRY results use the SCSI_REV_* #define's tokrw2020-09-021-2/+2
| | | | initialize the 'version' field. Not numbers.
* Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big tokrw2020-09-011-8/+8
| | | | | | struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test)
* Implement UHS-I support in the sdmmc(4) midlayer.kettenis2020-08-243-18/+156
| | | | ok mglocker@
* Print ddr52 and hs200 indicators if those modes are supported.kettenis2020-08-151-1/+5
| | | | ok stsp@
* Add support for eMMC HS200 mode. Loosely based on code from NetBSD.kettenis2020-08-145-72/+164
| | | | ok patrick@
* No need for a bzero(), just init saa.sf to NULL. All the saa.saakrw2020-07-251-2/+2
| | | | fields are explicitly initialized.
* Turning on various scsi drivers' *DEBUG options reveals that this haskrw2020-07-241-1/+5
| | | | | | | | rarely (if ever) been done. Fix many printf format errors to calm clang and gcc on amd64, i386, hppa. Missing #include, complaints if 'option <blah>DEBUG' is used in config files, etc. All in debug code.
* Nuke unused struct scsi_link members of adapter softc's where thekrw2020-07-221-2/+1
| | | | driver successfully compiles on one or more of amd64, i386, hppa.
* Move remaining scsi bus initialization info from "prototype scsi link"krw2020-07-201-5/+5
| | | | | | | fields to struct scsibus_attach_args. Nuke the struct scsi_link * (saa_sc_link) in scaibus_attach_args. Explicitly initialize each field in scsibus_attach_args variables.
* Move the adapter related items (luns, adapter, adapter_target,krw2020-07-191-6/+6
| | | | | | | adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
* Access adapter softc via link->bus->sb_adapter_softc.krw2020-07-161-7/+7
| | | | | | | | In sparc64 autoconf access 'luns' via sb_luns and 'adapter_buswidth' via sb_adapter_buswidth. Removes last post-config uses of the copies of bus related information in scsi_link.
* Remove some pointless casting of void * when assigning onekrw2020-07-131-2/+2
| | | | (scsi_link.adapter_softc) to a pointer of a particular softc type.
* Pass the expected 'scsibus_attach_args *' to scsibus_attach() viakrw2020-07-032-5/+5
| | | | config_found(), not a 'scsi_link *'. Part of matthew@'s 2010 work.
* Add support for BCM4359 SDIO variants such as the AP6359SA module foundkettenis2020-06-191-1/+5
| | | | | | | | | on the RockPro64 WiFi module. Note that there is no fiirmware for this chip in the bwfm-firmware package at the moment. ok patrick@
* Make sure SDHC_HOST_CTL2 is consistently controlled using 2-byte accesses,patrick2020-06-141-2/+2
| | | | | | | otherwise it would lead to unaligned memory access. Fixes a panic on my MACCHIATObin. ok kettenis@
* Add pre/post hooks for bus clock changes to sdhc(4). These will bepatrick2020-05-222-2/+10
| | | | | | used by sdhc(4) attachment drivers to do additional MD initialization. ok kettenis@
* Some newer bwfm(4) chips from Cypress hold their regulatorypatrick2020-05-151-1/+12
| | | | | constraints in a separate blob, instead of in the firmware. This .clm_blob needs to be loaded as well.
* sdhc(4), sdmmc(4): tsleep(9) -> tsleep_nsec(9); ok patrick@cheloha2020-05-132-18/+19
|
* According to the SDIO Simplified Specification 3.0, a tuple lengthpatrick2020-04-291-7/+1
| | | | | | | | (aka link field) of 0 specifies an empty tuple body. This implies that a tuple length of 0 is actually allowed, so we don't need to error out if we encounter one. Seen on an SDIO-connected ath10k. ok kettenis@
* fix SDHC_DEBUG build, remove procname printf'sians2020-04-271-5/+4
| | | | ok kettenis@
* Add comments to clarify the hex IDs of some bwfm(4) devices on SD bus.stsp2020-04-191-7/+7
| | | | | ok jmc@ deraadt@ kettenis@ "thanks and don't wait for me" patrick@
* Add support for hardware where an SDHC controller lives on a bus thatkettenis2020-04-191-1/+2
| | | | | | only supports 32-bit access (hello Raspberry Pi). ok tobhe@
* Add support for hardware where an SDHC controller lives on a bus thatkettenis2020-04-191-21/+107
| | | | | | only supports 32-bit access (hello Raspberry Pi). ok tobhe@
* On fdt platforms attempt to load system specific .txt and .bin filesjsg2020-03-141-15/+71
| | | | | | | | | | | | with filenames constructed from the first compatible string of the root node. Matches the format used in the linux-firmware repository. If these are not found fallback to the generic filenames. When the compatible string contains a '/' as in 'solidrun,cubox-i/q' it will be handled as everything before the '/' so the cubox filename is brcmfmac4330-sdio.solidrun,cubox-i.txt. ok kurt@ patrick@
* Recognize BCM43341 as a BCM43340 variant.patrick2020-03-131-1/+2
| | | | From Rob Schmersel
* Use snprintf(9) to create the names for the firmware and NVRAM files. Thispatrick2020-03-071-55/+38
| | | | | | | | reduces the amount of duplicated lines per chip, and allows us to ship per- board files in the future. Based on a diff from jsg@ ok kurt@
* Fixup bwfm(4) register bit regarding SDIO device suspend/resume.patrick2020-03-061-2/+2
|
* Process the NVRAM in bwfm(4) itself. So far we have relied on somepatrick2020-03-061-6/+30
| | | | | | | external tool to pre-process the NVRAM, even though it's simple to do ourselves. This allows easier firmware distribution. ok kurt@
* Make bwfm(4) call if_input() only once per interrupt.patrick2020-02-251-14/+18
| | | | | | | This reduces drops caused by the ifq pressure drop mechanism and hence increases throughput. ok tobhe@
* Relax the grip the dead hand of QBUS (a.k.a. MAXPHYS) has on thekrw2020-02-201-1/+3
| | | | | | | | | | | throat of physio(). Allows individual devices to eventually be modified to support larger physio() (a.k.a. 'raw') i/o's if they prove capable of them. No immediate functional change. Tested for many weeks by and ok robert@.
* Bring a few stragglers into line with the idiom used by the other 40+krw2020-02-121-6/+6
| | | | | | scsi drivers. i.e. eliminate the struct scsi_adapter member in the softc and rely on the pointer to a static scsi_adapter in the struct scsi_link member.
* Shuffle some names around to make reading the code less headachekrw2020-01-261-4/+4
| | | | | | | | inducing. Rename scsi_adapter member 'scsi_minphys' to 'dev_minphys' to reflect what it is supposed to do. Use consistent naming convention (<dev>_minphys) for the actual device functions. No functional change.
* Drivers that implement their own *minphys() don't need to call thekrw2020-01-251-3/+1
| | | | | | | system minphys(). scsi_minphys() will do that and cd/sd/st will call scsi_minphys(). ok jmatthew@ as part of larger diff
* Recognize BCM4345 rev 9, which requires a different firmware,patrick2020-01-221-3/+8
| | | | as shipped with the Pinebook Pro as an AMPAK AP6256 module.
* delete wasteful ;;deraadt2020-01-221-3/+3
| | | | ok tedu
* Convert infinite sleeps to {m,t}sleep_nsec(9).mpi2019-12-312-5/+5
| | | | ok kn@
* Don't detach non-removable devices during resume on "sdhc* at acpi?".stsp2019-04-024-5/+11
| | | | | | Makes hibernate work with rootfs on built-in emmc storage. Tested on King Jim Portabook. ok deraadt@ kettenis@
* Consistently use m_freem(9). This fixes possible leaks in a fewpatrick2019-02-071-2/+2
| | | | error cases.
* Turns out we do need to handle control messages that exceed MLEN, sokettenis2019-02-041-6/+15
| | | | | | | allocate a cluster if the message is larger than that. Fixes a panic on shutdown on my Asus X205TA. ok patrick@, stsp@
* Allow passing the maximum size of a segment that a SD/MMC hostpatrick2018-12-293-4/+8
| | | | | | controller can handle for DMA tranfers, since not all support 64k. ok kettenis@
* Avoid using m_trailingspace(9) on an mbuf allocated with MGET(9) as it relieskettenis2018-12-221-2/+4
| | | | | | | | | | | | on header fields that aren't initialized, which may trigger an assertion. Check whether the control message doesn't exceed MLEN instead and turn the check into a KASSERT as the driver should not generate control messages that are larger. with help form claudio@ (who points out that the driver should not use MT_CONTROL here). ok patrick@
* M_LEADINGSPACE() and M_TRAILINGSPACE() are just wrappers forclaudio2018-11-091-2/+2
| | | | | | m_leadingspace() and m_trailingspace(). Convert all callers to call directly the functions and remove the defines. OK krw@, mpi@
* Implement 64-bit DMA support in sdhc(4).patrick2018-09-062-10/+39
| | | | | tested in snaps ok kettenis@