Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add a driver for Realtek RTS5209/RTS5229 Card Reader.
details: https://anonhg.NetBSD.org/src/rev/9b2ef0373742
branches: trunk
changeset: 327865:9b2ef0373742
user: nonaka <nonaka%NetBSD.org@localhost>
date: Wed Mar 19 15:26:41 2014 +0000
description:
Add a driver for Realtek RTS5209/RTS5229 Card Reader.
Ported from OpenBSD.
diffstat:
distrib/sets/lists/man/mi | 5 +-
share/man/man4/Makefile | 4 +-
share/man/man4/rtsx.4 | 55 +
share/man/man4/sdmmc.4 | 4 +-
sys/arch/amd64/conf/GENERIC | 6 +-
sys/arch/i386/conf/ALL | 6 +-
sys/arch/i386/conf/GENERIC | 6 +-
sys/conf/files | 8 +-
sys/dev/DEVNAMES | 5 +-
sys/dev/ic/rtsx.c | 1598 +++++++++++++++++++++++++++++++++++++++++++
sys/dev/ic/rtsxreg.h | 522 ++++++++++++++
sys/dev/ic/rtsxvar.h | 70 +
sys/dev/pci/files.pci | 8 +-
sys/dev/pci/rtsx_pci.c | 165 ++++
sys/dev/sdmmc/sdmmc.c | 38 +-
sys/dev/sdmmc/sdmmc_mem.c | 112 ++-
sys/dev/sdmmc/sdmmcvar.h | 7 +-
17 files changed, 2549 insertions(+), 70 deletions(-)
diffs (truncated from 3057 to 300 lines):
diff -r d7110adbbd00 -r 9b2ef0373742 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Wed Mar 19 11:14:12 2014 +0000
+++ b/distrib/sets/lists/man/mi Wed Mar 19 15:26:41 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1464 2014/03/16 09:28:58 martin Exp $
+# $NetBSD: mi,v 1.1465 2014/03/19 15:26:41 nonaka Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -1564,6 +1564,7 @@
./usr/share/man/cat4/rtii.0 man-sys-catman .cat
./usr/share/man/cat4/rtk.0 man-sys-catman .cat
./usr/share/man/cat4/rtpphy.0 man-obsolete obsolete
+./usr/share/man/cat4/rtsx.0 man-sys-catman .cat
./usr/share/man/cat4/rtw.0 man-sys-catman .cat
./usr/share/man/cat4/rum.0 man-sys-catman .cat
./usr/share/man/cat4/rumpfs.0 man-sys-catman .cat,rump
@@ -4530,6 +4531,7 @@
./usr/share/man/html4/rtfps.html man-sys-htmlman html
./usr/share/man/html4/rtii.html man-sys-htmlman html
./usr/share/man/html4/rtk.html man-sys-htmlman html
+./usr/share/man/html4/rtsx.html man-sys-htmlman html
./usr/share/man/html4/rtw.html man-sys-htmlman html
./usr/share/man/html4/rum.html man-sys-htmlman html
./usr/share/man/html4/rumpfs.html man-sys-htmlman html,rump
@@ -7400,6 +7402,7 @@
./usr/share/man/man4/rtii.4 man-sys-man .man
./usr/share/man/man4/rtk.4 man-sys-man .man
./usr/share/man/man4/rtpphy.4 man-obsolete obsolete
+./usr/share/man/man4/rtsx.4 man-sys-man .man
./usr/share/man/man4/rtw.4 man-sys-man .man
./usr/share/man/man4/rum.4 man-sys-man .man
./usr/share/man/man4/rumpfs.4 man-sys-man .man,rump
diff -r d7110adbbd00 -r 9b2ef0373742 share/man/man4/Makefile
--- a/share/man/man4/Makefile Wed Mar 19 11:14:12 2014 +0000
+++ b/share/man/man4/Makefile Wed Mar 19 15:26:41 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.610 2014/03/16 09:28:43 martin Exp $
+# $NetBSD: Makefile,v 1.611 2014/03/19 15:26:41 nonaka Exp $
# @(#)Makefile 8.1 (Berkeley) 6/18/93
MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -49,7 +49,7 @@
pseye.4 ptcd.4 ptm.4 pty.4 puc.4 pud.4 puffs.4 pwdog.4 px.4 pxg.4 \
qe.4 qec.4 qsphy.4 \
raid.4 ral.4 ray.4 rcons.4 rdcphy.4 re.4 rgephy.4 rlphy.4 \
- rnd.4 route.4 rs5c372rtc.4 rtk.4 rtw.4 rum.4 run.4 \
+ rnd.4 route.4 rs5c372rtc.4 rtk.4 rtsx.4 rtw.4 rum.4 run.4 \
s390rtc.4 satalink.4 sbus.4 scc.4 schide.4 \
scsi.4 sd.4 se.4 seeprom.4 sem.4 \
ses.4 sf.4 sfb.4 sgsmix.4 shb.4 shmif.4 \
diff -r d7110adbbd00 -r 9b2ef0373742 share/man/man4/rtsx.4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/rtsx.4 Wed Mar 19 15:26:41 2014 +0000
@@ -0,0 +1,55 @@
+.\" $NetBSD: rtsx.4,v 1.1 2014/03/19 15:26:41 nonaka Exp $
+.\" $OpenBSD: rtsx.4,v 1.4 2013/11/06 13:51:02 stsp Exp $
+.\"
+.\" Theo de Raadt, 2006. Public Domain.
+.\" Stefan Sperling, 2012. Public Domain.
+.\"
+.Dd March 19 2014
+.Dt RTSX 4
+.Os
+.Sh NAME
+.Nm rtsx
+.Nd Realtek SD card reader
+.Sh SYNOPSIS
+.Cd "rtsx* at pci?"
+.Cd "sdmmc* at rtsx?"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for the Realtek RTS5209 and RTS5229 SD card readers.
+.Pp
+The
+.Xr sdmmc 4
+subsystem performs SD/MMC transactions to communicate with
+whatever MMC, SD or SDHC devices are inserted into the SD slot.
+.Sh SEE ALSO
+.Xr intro 4 ,
+.Xr sdmmc 4
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Ox 5.3
+and in
+.Nx 7.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Stefan Sperling
+.Aq stsp%openbsd.org@localhost
+for
+.Ox
+and ported to
+.Nx
+by
+.An NONAKA Kimihiro
+.Aq nonaka%netbsd.org@localhost .
+.Sh BUGS
+The
+.Nm
+driver does not support MS (Memory Stick) and xD (Extreme Digital) devices
+even though the hardware supports them.
+.Pp
+Support for SDIO interrupts is not implemented.
diff -r d7110adbbd00 -r 9b2ef0373742 share/man/man4/sdmmc.4
--- a/share/man/man4/sdmmc.4 Wed Mar 19 11:14:12 2014 +0000
+++ b/share/man/man4/sdmmc.4 Wed Mar 19 15:26:41 2014 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: sdmmc.4,v 1.4 2009/10/01 05:42:22 wiz Exp $
+.\" $NetBSD: sdmmc.4,v 1.5 2014/03/19 15:26:41 nonaka Exp $
.\" $OpenBSD: sdmmc.4,v 1.8 2009/03/25 19:33:06 mk Exp $
.\"
.\" Theo de Raadt, 2006. Public Domain.
@@ -13,6 +13,7 @@
.Cd "# pxa2x0 specific"
.Cd "sdmmc* at pxamci?"
.Cd "# all architectures"
+.Cd "sdmmc* at rtsx?"
.Cd "sdmmc* at sdhc?"
.Cd "sdmmc* at wb?"
.Cd "ld* at sdmmc?"
@@ -27,6 +28,7 @@
.Sh SEE ALSO
.Xr intro 4 ,
.Xr ld 4 ,
+.Xr rtsx 4 ,
.Xr sbt 4 ,
.Xr sdhc 4 ,
.Xr wb 4
diff -r d7110adbbd00 -r 9b2ef0373742 sys/arch/amd64/conf/GENERIC
--- a/sys/arch/amd64/conf/GENERIC Wed Mar 19 11:14:12 2014 +0000
+++ b/sys/arch/amd64/conf/GENERIC Wed Mar 19 15:26:41 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.381 2013/10/26 09:16:20 nonaka Exp $
+# $NetBSD: GENERIC,v 1.382 2014/03/19 15:26:42 nonaka Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.381 $"
+#ident "GENERIC-$Revision: 1.382 $"
maxusers 64 # estimated number of users
@@ -1146,8 +1146,10 @@
# SD/MMC controller
sdhc* at pci? # SD Host Controller
+rtsx* at pci? # Realtek RTS5209/RTS5229 Card Reader
sdhc* at cardbus? # SD Host Controller
sdmmc* at sdhc? # SD/MMC bus
+sdmmc* at rtsx? # SD/MMC bus
ld* at sdmmc?
diff -r d7110adbbd00 -r 9b2ef0373742 sys/arch/i386/conf/ALL
--- a/sys/arch/i386/conf/ALL Wed Mar 19 11:14:12 2014 +0000
+++ b/sys/arch/i386/conf/ALL Wed Mar 19 15:26:41 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.368 2014/03/16 09:35:05 martin Exp $
+# $NetBSD: ALL,v 1.369 2014/03/19 15:26:42 nonaka Exp $
# From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
#
# ALL machine description file
@@ -17,7 +17,7 @@
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "ALL-$Revision: 1.368 $"
+#ident "ALL-$Revision: 1.369 $"
maxusers 64 # estimated number of users
@@ -1415,11 +1415,13 @@
# PCI SD/MMC controller
sdhc* at pci? # SD Host Controller
+rtsx* at pci? # Realtek RTS5209/RTS5229 Card Reader
# CardBus SD/MMC controller
sdhc* at cardbus? function ? # SD Host Controller
sdmmc* at sdhc? # SD/MMC bus
+sdmmc* at rtsx? # SD/MMC bus
ld* at sdmmc?
diff -r d7110adbbd00 -r 9b2ef0373742 sys/arch/i386/conf/GENERIC
--- a/sys/arch/i386/conf/GENERIC Wed Mar 19 11:14:12 2014 +0000
+++ b/sys/arch/i386/conf/GENERIC Wed Mar 19 15:26:41 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1099 2014/01/26 19:16:16 dsl Exp $
+# $NetBSD: GENERIC,v 1.1100 2014/03/19 15:26:42 nonaka Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.1099 $"
+#ident "GENERIC-$Revision: 1.1100 $"
maxusers 64 # estimated number of users
@@ -1340,11 +1340,13 @@
# PCI SD/MMC controller
sdhc* at pci? # SD Host Controller
+rtsx* at pci? # Realtek RTS5209/RTS5229 Card Reader
# CardBus SD/MMC controller
sdhc* at cardbus? function ? # SD Host Controller
sdmmc* at sdhc? # SD/MMC bus
+sdmmc* at rtsx? # SD/MMC bus
ld* at sdmmc?
diff -r d7110adbbd00 -r 9b2ef0373742 sys/conf/files
--- a/sys/conf/files Wed Mar 19 11:14:12 2014 +0000
+++ b/sys/conf/files Wed Mar 19 15:26:41 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.1086 2014/03/18 18:20:41 riastradh Exp $
+# $NetBSD: files,v 1.1087 2014/03/19 15:26:42 nonaka Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20100430
@@ -1221,7 +1221,7 @@
file dev/usb/hid.c hid
# SD Host controller
-device sdhc: sdmmcbus
+device sdhc: sdmmcbus
file dev/sdmmc/sdhc.c sdhc needs-flag
# Winbond Integrated Media Reader
@@ -1229,6 +1229,10 @@
file dev/ic/w83l518d.c wb
file dev/ic/w83l518d_sdmmc.c wb
+# Realtek RTS5209/RTS5229 Card Reader
+device rtsx: sdmmcbus
+file dev/ic/rtsx.c rtsx
+
# Myson MTD803 3-in-1 Fast Ethernet Controller
device mtd: arp, ether, ifnet, mii
file dev/ic/mtd803.c mtd
diff -r d7110adbbd00 -r 9b2ef0373742 sys/dev/DEVNAMES
--- a/sys/dev/DEVNAMES Wed Mar 19 11:14:12 2014 +0000
+++ b/sys/dev/DEVNAMES Wed Mar 19 15:26:41 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: DEVNAMES,v 1.287 2014/02/21 12:24:52 jdc Exp $
+# $NetBSD: DEVNAMES,v 1.288 2014/03/19 15:26:42 nonaka Exp $
#
# This file contains all used device names and defined attributes in
# alphabetical order. New devices added to the system somewhere should first
@@ -1179,6 +1179,7 @@
rtii MI
rtk MI
rtl80x9 MI Attribute
+rtsx MI
rum MI
run MI
rx MI
@@ -1223,6 +1224,8 @@
scsibus MI
scsirom x68k
sd MI
+sdhc MI
+sdmmc MI
sdtemp MI
se MI
sea MI
diff -r d7110adbbd00 -r 9b2ef0373742 sys/dev/ic/rtsx.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/ic/rtsx.c Wed Mar 19 15:26:41 2014 +0000
@@ -0,0 +1,1598 @@
+/* $NetBSD: rtsx.c,v 1.1 2014/03/19 15:26:41 nonaka Exp $ */
+/* $OpenBSD: rtsx.c,v 1.7 2013/12/08 18:31:03 stsp Exp $ */
+
+/*
+ * Copyright (c) 2006 Uwe Stuehler <uwe%openbsd.org@localhost>
+ * Copyright (c) 2012 Stefan Sperling <stsp%openbsd.org@localhost>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
Home |
Main Index |
Thread Index |
Old Index