Based on https://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/pci.html example,
and https://lists.freebsd.org/pipermail/freebsd-hackers/2018-April/052520.html
Place source in /usr/src/sys/dev/rtsx
make clean
make
make install
kldload mmc
kldload mmcsd
kldload rtsx
dev.rtsx.0.debug_mask
can be set with the following masks:
-
0x01 - to show the basic flow of the driver,
-
0x02 - to trace the SD commands,
-
0x04 - to trace the tuning phase.
- probe of Vendor ID: 0x10ec - Device ID: 0x5287
- attach (and dev initialization...)
- detect card inserted / ejected
- get card information
- detach (at least kldunload)
- patch to add detection of SD card insertion/removal (from Gary Jennejohn [email protected])
- patch to read SCR and STATUS (CMD51 & CMD13) (from Jesper Schmitz Mouridsen [email protected])
- patch to allow successful read operations (from Jesper Schmitz Mouridsen [email protected])
- write operation completed with Jesper Schmitz Mouridsen [email protected].
- patch for RTS525A from Lutz Bichler [email protected]
- add read-only detection
- add suspend and resume (at least on Acer Aspire E 15 E5-576-77W6)
- committed to head (FreeBSD 13.0-CURRENT) by revision 367998.
- More testing please!
- RTS5209 under releng/13.0 (Lenovo ThinkPad L520, Packard Bell EN LV44HC i3-2328M)
- RTS5227 under stable/11, releng/12.1 and releng/13.0 releng/13.1 (HP ProBook 430 g2, HP Elitebook 820 G2, Lenovo ThinkPad S440/T450/T450s/X240/X250/X270/yoga 1, Fujitsu H730)
- RTS5229 under releng/12.1 and releng/13.0 (Lenovo IdeaPad 120S-14IAP, ASUS GL553VE)
- RTS522A under releng/12.1 and releng/13.0 (Intel NUC8i5BE, ThinkPad P50s, ThinkPad T470p, Thinkpad x260, HP EliteBook 840 G3)
- RTS525A under releng/12.1 (Dell Latitude E5570, Dell XPS 13 - model 9360)
- RTL8411B under stable/12 and releng/13.0 (Acer Aspire E 15 E5-576-77W6, ACER ASPIRE 5 A515-51G-C97B)
- RTS5260 under 14.0-CURRENT (Dell XPS 13 9310)
- RTS522A on Lenovo P50s and Lenovo T470p, card detection and read-only switch are reversed.
To adapt the driver add in loader.conf(5)
dev.rtsx.0.inversion=1
. - Mounting a filesystem with write access on a card write protected may involve a kernel crash.
- Suspend/Resume do not work under MMCCAM.
- For some chips (e.g. RTS5260) after
devctl disable/enable
orkldunload/kldload
the driver can't detect a card correctly.