Commit Graph

16 Commits

Author SHA1 Message Date
John Baldwin
03cfce6f73 rtsx: Remove unused devclass argument to DRIVER_MODULE. 2022-05-06 15:46:56 -07:00
Henri Hennebert
8290c14420 rtsx: Number of tweaks for RTS5260.
MFC after:	2 weeks
2022-04-26 21:43:17 -04:00
Henri Hennebert
2e88306786 rtsx: Remove update of softc during probe and some var rename.
MFC after:	1 week
2022-03-25 15:24:49 -04:00
Henri Hennebert
9b261d2e0a rtsx: Display error if rtsx_read()/rtsx_write() fail.
MFC after:	1 week
2022-03-23 21:01:00 -04:00
Henri Hennebert
6b7718377b rtsx: Don't detach during shutdown
MFC after:	1 week
2022-03-23 20:58:38 -04:00
hlh-restart
1b1bab0078 rtsx: Call rtsx_init() on resume.
MFC after:	3 days
2022-03-19 12:37:24 -04:00
Henri Hennebert
577130e56e rtsx: Add RTS5260 support and replace bootverbose with sysctl.
Tested by:	mav
MFC after:	4 days
Differential Revision:	https://reviews.freebsd.org/D34246
2022-02-19 11:46:40 -05:00
Henri Hennebert
ad494d3b2d rtsx: Update driver version number to 2.1c
Differential Revision:	https://reviews.freebsd.org/D32154
2022-02-03 18:43:13 -05:00
Henri Hennebert
1e800a5934 rtsx: Do not display pci_read_config() errors during rtsx_init()
Differential Revision:	https://reviews.freebsd.org/D32154
2022-02-03 18:43:13 -05:00
Henri Hennebert
ec1f122b56 rtsx: Add CTLFLAG_STATS flag for read and write counters
Differential Revision:	https://reviews.freebsd.org/D32154
2022-02-03 18:43:12 -05:00
Henri Hennebert
7e5933b333 rtsx: Prefer __FreeBSD_version over __FreeBSD__
No functional change.

Differential Revision:	https://reviews.freebsd.org/D32154
2022-02-03 18:43:12 -05:00
Henri Hennebert
8e9740b62e rtsx: Convert driver to use the mmc_sim interface
A lot more generic cam related things were done in mmc_sim so this
simplifies the driver a lot.

Differential Revision:	https://reviews.freebsd.org/D32154
Reviewed by:		imp
2022-02-03 18:43:12 -05:00
Henri Hennebert
9d3bc16382 rtsx: Call taskqueue sooner, adjust DELAY(9) calls, add an inversion heuristic
- Some configurations, e.g. HP EliteBook 840 G3, come with a dummy card
in the card slot which is detected as a valid SD card.  This added long
timeout at boot time.  To alleviate the problem, the default timeout is
reduced to one second during the setup phase. [1]

- Some configurations crash at boot if rtsx(4) is defined in the kernel
config.  At boot time, without a card inserted, the driver found that
a card is present and just after that a "spontaneous" interrupt is
generated showing that no card is present.  To solve this problem,
DELAY(9) is set to one quarter of a second before checking card presence
during driver attach.

- As advised by adrian, taskqueue and DMA are set up sooner during
the driver attach.  A heuristic to try to detect configuration needing
inversion was added.

PR:		255130 [1]
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30499
2021-09-09 14:26:17 -04:00
Gordon Bergling
5bdf58e196 Fix some common typos in source code comments
- s/priviledged/privileged/
- s/funtion/function/
- s/doens't/doesn't/
- s/sychronization/synchronization/

MFC after:	3 days
2021-08-28 18:57:23 +02:00
Warner Losh
9339e7c0bd rtsx: Fix wakeup race similar to sdhci one fixed in 35547df5c7
rtsx copied code from sdhci, and has the same wakeup race bug that was
fixed in 35547df5c7, so apply a similar fix here.

Sponsored by:		Netflix
2021-08-10 17:10:25 -06:00
Jung-uk Kim
926ce35a7e Port rtsx(4) driver for Realtek SD card reader from OpenBSD.
This driver provides support for Realtek PCI SD card readers.  It attaches
mmc(4) bus on card insertion and detaches it on card removal.  It has been
tested with RTS5209, RTS5227, RTS5229, RTS522A, RTS525A and RTL8411B.  It
should also work with RTS5249, RTL8402 and RTL8411.

PR:			204521
Submitted by:		Henri Hennebert (hlh at restart dot be)
Reviewed by:		imp, jkim
Differential Revision:	https://reviews.freebsd.org/D26435
2020-11-24 21:28:44 +00:00