Commit graph

15 commits

Author SHA1 Message Date
Henri Hennebert
d6a32773ea rtsx: Number of tweaks for RTS5260.
MFC after:	2 weeks

(cherry picked from commit 8290c14420)
2022-05-10 20:56:53 -04:00
Henri Hennebert
ee772cbdc4 rtsx: Remove update of softc during probe and some var rename.
MFC after:	1 week

(cherry picked from commit 2e88306786)
2022-03-30 21:48:24 -04:00
Henri Hennebert
c1a9422b99 rtsx: Display error if rtsx_read()/rtsx_write() fail.
MFC after:	1 week

(cherry picked from commit 9b261d2e0a)
2022-03-30 21:48:24 -04:00
Henri Hennebert
cd89969685 rtsx: Don't detach during shutdown
MFC after:	1 week

(cherry picked from commit 6b7718377b)
2022-03-30 21:48:24 -04:00
hlh-restart
205fa5f0a5 rtsx: Call rtsx_init() on resume.
MFC after:	3 days

(cherry picked from commit 1b1bab0078)
2022-03-21 20:28:34 -04:00
Henri Hennebert
3e5cd5dfd4 rtsx: Add RTS5260 support and replace bootverbose with sysctl.
Tested by:	mav
MFC after:	4 days
Differential Revision:	https://reviews.freebsd.org/D34246

(cherry picked from commit 577130e56e)
2022-02-22 19:39:53 -05:00
Henri Hennebert
785a5b8d91 rtsx: Update driver version number to 2.1c
Differential Revision:	https://reviews.freebsd.org/D32154

(cherry picked from commit ad494d3b2d)
2022-02-22 19:39:53 -05:00
Henri Hennebert
23566767c3 rtsx: Do not display pci_read_config() errors during rtsx_init()
Differential Revision:	https://reviews.freebsd.org/D32154

(cherry picked from commit 1e800a5934)
2022-02-22 19:39:53 -05:00
Henri Hennebert
a1b4c74dad rtsx: Add CTLFLAG_STATS flag for read and write counters
Differential Revision:	https://reviews.freebsd.org/D32154

(cherry picked from commit ec1f122b56)
2022-02-22 19:39:36 -05:00
Henri Hennebert
4efab785f6 rtsx: Prefer __FreeBSD_version over __FreeBSD__
No functional change.

Differential Revision:	https://reviews.freebsd.org/D32154

(cherry picked from commit 7e5933b333)
2022-02-22 19:39:29 -05:00
Henri Hennebert
545def055b 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

(cherry picked from commit 8e9740b62e)
2022-02-22 19:39:19 -05:00
Henri Hennebert
277a326b1e 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]
Differential Revision:	https://reviews.freebsd.org/D30499

(cherry picked from commit 9d3bc16382)
2021-09-16 09:49:21 -04:00
Warner Losh
4c2819607a 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

(cherry picked from commit 9339e7c0bd)
2021-09-12 09:56:16 -06:00
Gordon Bergling
dbb74dd891 Fix some common typos in source code comments
- s/priviledged/privileged/
- s/funtion/function/
- s/doens't/doesn't/
- s/sychronization/synchronization/

(cherry picked from commit 5bdf58e196)
2021-08-31 08:13:15 +02: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