summaryrefslogtreecommitdiff
path: root/sys/src/9/port/sdmmc.c
AgeCommit message (Collapse)Author
2023-01-15sdmmc: implement boot partition access for emmccinap_lenrek
We expose the boot partitions as separate units, such as sdM0 is the user data partition and sdM1 is the first boot partition and sdM2 is the second boot partition. On access, we automatically switch the BOOT_PARTITOIN_ACCESS bits in the EXT_CSD. Also, the units ctl file contains "boot enabled" or "boot disabled" if that unit is the active or inactive boot partition.
2022-12-30sdmmc: switch argument must be integercinap_lenrek
2022-12-29sdmmc: actually implement mmc supportcinap_lenrek
- pass the correct ocr value for SEND_OP_COND (advertise Hcs and 3.3v) - disambiguate SEND_RELATIVE_ADDRESS/SET_RELATIVE_ADDRESS - detect the MMC version from CSD structure - detect the capacity according to spec for MMC - implement SWITCH command to set highspeed frequency and bus width - rename Ctlr to Card (thats really what we keep track of here)
2022-12-27sdmmc: new interface for SDiocinap_lenrek
We want to support the internal emmc device on the reform, which has a different initialization sequence from SDcard. The problem is, all mmc controller drivers where using the command index to derive the command properties. The command index's interpretation depends on the command set. And MMC has different commands then SD. Also, there are the APP_CMD escaped commands which drivers then tried to recover the state... All of this is total nonsense... The controller drivers should not care and the command properties should be maintained by port/sdmmc.c. So we pass the command as a struct SDiocmd, which has all the properties (command index, response type, data transfer mode... and even a string for debugging). The controller just converts this into register values and just executes the commands. Next, the controller drivers shouldnt snoop on the commands and then try to apply bus and frequency switching on their own. This is now made explicit by having SDio.bus(io, width, speed) function.
2022-12-11sdmmc: multiple controller supportcinap_lenrek
remove the global sdio struct and add a addmmcio() function for drivers to register their controllers. there is a SDio.aux pointer now where controller drivers can stash a pointer to their private data. SDio.init() also can signal that it wants to be called again for more controllers by returning > 0 (see pc/pmmc.c). this is in preparation for supporting the internal mmc device in the mnt-reform which is hooked up to usdhc1.
2022-06-18imx8/usdhc: work around broken multi-write for nowcinap_lenrek
for unknown reasons, multiwrite is busted in usdhc: sdhc: write error intr 10 stat ff88858e usdhccmd: need to reset Datinhibit intr 10 stat ff88858e usdhc: cmd 193a0027 arg 1e5b6b error intr 18010 stat ff88858f i'm disabling it for now, adding a flag to the SDio struct.
2021-11-07sdmmc: do card init in a background process after the first trycinap_lenrek
Some mmc controllers have no card detect pin, so the only way to detect card presence is to issue the ACMD41 which will fail after a pretty long timeout. To avoid mmconline() blocking, we only try to initialize the card synchronous once, and then retry in a background process, while returning immediately from mmconline() while the retry is in progress. This speeds up network boot times significantly on a raspi without a sdcard inserted.
2019-08-25emmc: 50MHz highspeed support (from richard miller)cinap_lenrek
2019-08-25bcm64: replace emmc2 driver with richard millers sdhc drivercinap_lenrek
the new driver supports 50MHz highspeed bus mode and uses ADMA instead of SDMA.
2015-09-20sdmmc: handle fakescsi emulationcinap_lenrek
2013-07-14add ricoh pci sdmmc host controller driver for X230cinap_lenrek
the driver should work for standard sdhc (see http://www.sdcard.org/) controllers, but matches for the ricoh controller only as it was the only one i have for testing.
2013-01-26kernel: add portable sd mmc interface (from sources)cinap_lenrek