| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ssumci.c,v 1.2 2012/01/21 19:44:29 nonaka Exp $ */ | | 1 | /* $NetBSD: ssumci.c,v 1.2.16.1 2014/01/12 12:38:37 bouyer Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (C) 2010 NONAKA Kimihiro <nonaka@netbsd.org> | | 4 | * Copyright (C) 2010 NONAKA Kimihiro <nonaka@netbsd.org> |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -20,27 +20,27 @@ | | | @@ -20,27 +20,27 @@ |
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | | 26 | */ |
27 | | | 27 | |
28 | /* | | 28 | /* |
29 | * driver to access MMC/SD card | | 29 | * driver to access MMC/SD card |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | __KERNEL_RCSID(0, "$NetBSD: ssumci.c,v 1.2 2012/01/21 19:44:29 nonaka Exp $"); | | 33 | __KERNEL_RCSID(0, "$NetBSD: ssumci.c,v 1.2.16.1 2014/01/12 12:38:37 bouyer Exp $"); |
34 | | | 34 | |
35 | #include <sys/param.h> | | 35 | #include <sys/param.h> |
36 | #include <sys/device.h> | | 36 | #include <sys/device.h> |
37 | #include <sys/systm.h> | | 37 | #include <sys/systm.h> |
38 | #include <sys/malloc.h> | | 38 | #include <sys/malloc.h> |
39 | #include <sys/kernel.h> | | 39 | #include <sys/kernel.h> |
40 | #include <sys/proc.h> | | 40 | #include <sys/proc.h> |
41 | #include <sys/bus.h> | | 41 | #include <sys/bus.h> |
42 | #include <sys/intr.h> | | 42 | #include <sys/intr.h> |
43 | | | 43 | |
44 | #include <sh3/devreg.h> | | 44 | #include <sh3/devreg.h> |
45 | #include <sh3/pfcreg.h> | | 45 | #include <sh3/pfcreg.h> |
46 | #include <sh3/scireg.h> | | 46 | #include <sh3/scireg.h> |
| @@ -141,27 +141,27 @@ do { \ | | | @@ -141,27 +141,27 @@ do { \ |
141 | #define SCPCR_CLK_IN 0x000C | | 141 | #define SCPCR_CLK_IN 0x000C |
142 | #define SCPCR_CLK_OUT 0x0004 | | 142 | #define SCPCR_CLK_OUT 0x0004 |
143 | #define SCPDR_CLK 0x02 | | 143 | #define SCPDR_CLK 0x02 |
144 | #define SCPCR_DAT_MASK 0x0003 | | 144 | #define SCPCR_DAT_MASK 0x0003 |
145 | #define SCPCR_DAT_IN 0x0003 | | 145 | #define SCPCR_DAT_IN 0x0003 |
146 | #define SCPCR_DAT_OUT 0x0001 | | 146 | #define SCPCR_DAT_OUT 0x0001 |
147 | #define SCPDR_DAT 0x01 | | 147 | #define SCPDR_DAT 0x01 |
148 | #define SCPCR_CMD_MASK 0x0030 | | 148 | #define SCPCR_CMD_MASK 0x0030 |
149 | #define SCPCR_CMD_IN 0x0030 | | 149 | #define SCPCR_CMD_IN 0x0030 |
150 | #define SCPCR_CMD_OUT 0x0010 | | 150 | #define SCPCR_CMD_OUT 0x0010 |
151 | #define SCPDR_CMD 0x04 | | 151 | #define SCPDR_CMD 0x04 |
152 | #define SCPCR_CS_MASK 0x000C | | 152 | #define SCPCR_CS_MASK 0x000C |
153 | #define SCPCR_CS_OUT 0x0004 | | 153 | #define SCPCR_CS_OUT 0x0004 |
154 | #define SCPDR_CS 0x08 | | 154 | #define SCPDR_CS 0x02 |
155 | #define SCPCR_EJECT 0x00C0 | | 155 | #define SCPCR_EJECT 0x00C0 |
156 | #define SCPDR_EJECT 0x08 | | 156 | #define SCPDR_EJECT 0x08 |
157 | | | 157 | |
158 | #define MMC_TIME_OVER 20000 | | 158 | #define MMC_TIME_OVER 20000 |
159 | | | 159 | |
160 | struct ssumci_softc { | | 160 | struct ssumci_softc { |
161 | device_t sc_dev; | | 161 | device_t sc_dev; |
162 | device_t sc_sdmmc; | | 162 | device_t sc_sdmmc; |
163 | }; | | 163 | }; |
164 | | | 164 | |
165 | static int ssumci_match(device_t, cfdata_t, void *); | | 165 | static int ssumci_match(device_t, cfdata_t, void *); |
166 | static void ssumci_attach(device_t, device_t, void *); | | 166 | static void ssumci_attach(device_t, device_t, void *); |
167 | | | 167 | |