4 * Copyright (c) 2006 NONAKA Kimihiro <nonaka@netbsd.org>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #ifndef _PXA2X0_MCI_H_
30 #define _PXA2X0_MCI_H_
33 #include <sys/device.h>
34 #include <sys/mutex.h>
35 #include <sys/condvar.h>
37 #include <arm/xscale/pxa2x0_dmac.h>
42 uint32_t (*get_ocr
)(void *);
43 int (*set_power
)(void *, uint32_t);
44 int (*card_detect
)(void *);
45 int (*write_protect
)(void *);
50 bus_space_tag_t sc_iot
;
51 bus_space_handle_t sc_ioh
;
55 struct dmac_xfer
*sc_rxdx
;
56 bus_dma_segment_t sc_rxdr
; /* read descriptor */
57 struct dmac_xfer
*sc_txdx
;
58 bus_dma_segment_t sc_txdr
; /* write descriptor */
60 struct pxamci_tag sc_tag
;
63 #define PMC_CAPS_4BIT (1U << 0)
64 #define PMC_CAPS_NO_DMA (1U << 1)
67 #define PMF_CARDINITED (1U << 0)
69 struct sdmmc_command
* volatile sc_cmd
; /* command in progress */
73 uint32_t sc_ocr
; /* selected OCR */
74 int sc_maxblklen
; /* maximum block length */
75 int sc_buswidth
; /* current bus width */
83 int pxamci_attach_sub(device_t
, struct pxaip_attach_args
*);
84 void pxamci_card_detect_event(struct pxamci_softc
*);
86 #endif /* _PXA2X0_MCI_H_ */