Home | History | Annotate | Line # | Download | only in sdmmc
sdmmcvar.h revision 1.1.4.5
      1  1.1.4.5  yamt /*	$NetBSD: sdmmcvar.h,v 1.1.4.5 2010/10/09 03:32:25 yamt Exp $	*/
      2  1.1.4.2  yamt /*	$OpenBSD: sdmmcvar.h,v 1.13 2009/01/09 10:55:22 jsg Exp $	*/
      3  1.1.4.2  yamt 
      4  1.1.4.2  yamt /*
      5  1.1.4.2  yamt  * Copyright (c) 2006 Uwe Stuehler <uwe (at) openbsd.org>
      6  1.1.4.2  yamt  *
      7  1.1.4.2  yamt  * Permission to use, copy, modify, and distribute this software for any
      8  1.1.4.2  yamt  * purpose with or without fee is hereby granted, provided that the above
      9  1.1.4.2  yamt  * copyright notice and this permission notice appear in all copies.
     10  1.1.4.2  yamt  *
     11  1.1.4.2  yamt  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     12  1.1.4.2  yamt  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     13  1.1.4.2  yamt  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     14  1.1.4.2  yamt  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     15  1.1.4.2  yamt  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     16  1.1.4.2  yamt  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     17  1.1.4.2  yamt  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     18  1.1.4.2  yamt  */
     19  1.1.4.2  yamt 
     20  1.1.4.2  yamt #ifndef	_SDMMCVAR_H_
     21  1.1.4.2  yamt #define	_SDMMCVAR_H_
     22  1.1.4.2  yamt 
     23  1.1.4.2  yamt #include <sys/queue.h>
     24  1.1.4.2  yamt #include <sys/mutex.h>
     25  1.1.4.4  yamt #include <sys/callout.h>
     26  1.1.4.2  yamt 
     27  1.1.4.2  yamt #include <machine/bus.h>
     28  1.1.4.2  yamt 
     29  1.1.4.2  yamt #include <dev/sdmmc/sdmmcchip.h>
     30  1.1.4.2  yamt #include <dev/sdmmc/sdmmcreg.h>
     31  1.1.4.2  yamt 
     32  1.1.4.3  yamt #define	SDMMC_SECTOR_SIZE_SB	9
     33  1.1.4.3  yamt #define	SDMMC_SECTOR_SIZE	(1 << SDMMC_SECTOR_SIZE_SB)	/* =512 */
     34  1.1.4.3  yamt 
     35  1.1.4.2  yamt struct sdmmc_csd {
     36  1.1.4.2  yamt 	int	csdver;		/* CSD structure format */
     37  1.1.4.2  yamt 	u_int	mmcver;		/* MMC version (for CID format) */
     38  1.1.4.2  yamt 	int	capacity;	/* total number of sectors */
     39  1.1.4.2  yamt 	int	read_bl_len;	/* block length for reads */
     40  1.1.4.2  yamt 	int	write_bl_len;	/* block length for writes */
     41  1.1.4.2  yamt 	int	r2w_factor;
     42  1.1.4.2  yamt 	int	tran_speed;	/* transfer speed (kbit/s) */
     43  1.1.4.5  yamt 	int	ccc;		/* Card Command Class for SD */
     44  1.1.4.2  yamt 	/* ... */
     45  1.1.4.2  yamt };
     46  1.1.4.2  yamt 
     47  1.1.4.2  yamt struct sdmmc_cid {
     48  1.1.4.2  yamt 	int	mid;		/* manufacturer identification number */
     49  1.1.4.2  yamt 	int	oid;		/* OEM/product identification number */
     50  1.1.4.2  yamt 	char	pnm[8];		/* product name (MMC v1 has the longest) */
     51  1.1.4.2  yamt 	int	rev;		/* product revision */
     52  1.1.4.2  yamt 	int	psn;		/* product serial number */
     53  1.1.4.2  yamt 	int	mdt;		/* manufacturing date */
     54  1.1.4.2  yamt };
     55  1.1.4.2  yamt 
     56  1.1.4.4  yamt struct sdmmc_scr {
     57  1.1.4.4  yamt 	int	sd_spec;
     58  1.1.4.4  yamt 	int	bus_width;
     59  1.1.4.4  yamt };
     60  1.1.4.4  yamt 
     61  1.1.4.2  yamt typedef uint32_t sdmmc_response[4];
     62  1.1.4.2  yamt 
     63  1.1.4.2  yamt struct sdmmc_softc;
     64  1.1.4.2  yamt 
     65  1.1.4.2  yamt struct sdmmc_task {
     66  1.1.4.2  yamt 	void (*func)(void *arg);
     67  1.1.4.2  yamt 	void *arg;
     68  1.1.4.2  yamt 	int onqueue;
     69  1.1.4.2  yamt 	struct sdmmc_softc *sc;
     70  1.1.4.2  yamt 	TAILQ_ENTRY(sdmmc_task) next;
     71  1.1.4.2  yamt };
     72  1.1.4.2  yamt 
     73  1.1.4.2  yamt #define	sdmmc_init_task(xtask, xfunc, xarg)				\
     74  1.1.4.2  yamt do {									\
     75  1.1.4.2  yamt 	(xtask)->func = (xfunc);					\
     76  1.1.4.2  yamt 	(xtask)->arg = (xarg);						\
     77  1.1.4.2  yamt 	(xtask)->onqueue = 0;						\
     78  1.1.4.2  yamt 	(xtask)->sc = NULL;						\
     79  1.1.4.2  yamt } while (/*CONSTCOND*/0)
     80  1.1.4.2  yamt 
     81  1.1.4.2  yamt #define sdmmc_task_pending(xtask) ((xtask)->onqueue)
     82  1.1.4.2  yamt 
     83  1.1.4.2  yamt struct sdmmc_command {
     84  1.1.4.2  yamt 	struct sdmmc_task c_task;	/* task queue entry */
     85  1.1.4.2  yamt 	uint16_t	 c_opcode;	/* SD or MMC command index */
     86  1.1.4.2  yamt 	uint32_t	 c_arg;		/* SD/MMC command argument */
     87  1.1.4.2  yamt 	sdmmc_response	 c_resp;	/* response buffer */
     88  1.1.4.2  yamt 	bus_dmamap_t	 c_dmamap;
     89  1.1.4.5  yamt 	int		 c_dmaseg;	/* DMA segment number */
     90  1.1.4.5  yamt 	int		 c_dmaoff;	/* offset in DMA segment */
     91  1.1.4.2  yamt 	void		*c_data;	/* buffer to send or read into */
     92  1.1.4.2  yamt 	int		 c_datalen;	/* length of data buffer */
     93  1.1.4.2  yamt 	int		 c_blklen;	/* block length */
     94  1.1.4.2  yamt 	int		 c_flags;	/* see below */
     95  1.1.4.4  yamt #define SCF_ITSDONE	(1U << 0)		/* command is complete */
     96  1.1.4.4  yamt #define SCF_RSP_PRESENT	(1U << 1)
     97  1.1.4.4  yamt #define SCF_RSP_BSY	(1U << 2)
     98  1.1.4.4  yamt #define SCF_RSP_136	(1U << 3)
     99  1.1.4.4  yamt #define SCF_RSP_CRC	(1U << 4)
    100  1.1.4.4  yamt #define SCF_RSP_IDX	(1U << 5)
    101  1.1.4.4  yamt #define SCF_CMD_READ	(1U << 6)	/* read command (data expected) */
    102  1.1.4.4  yamt /* non SPI */
    103  1.1.4.4  yamt #define SCF_CMD_AC	(0U << 8)
    104  1.1.4.4  yamt #define SCF_CMD_ADTC	(1U << 8)
    105  1.1.4.4  yamt #define SCF_CMD_BC	(2U << 8)
    106  1.1.4.4  yamt #define SCF_CMD_BCR	(3U << 8)
    107  1.1.4.4  yamt #define SCF_CMD_MASK	(3U << 8)
    108  1.1.4.4  yamt /* SPI */
    109  1.1.4.4  yamt #define SCF_RSP_SPI_S1	(1U << 10)
    110  1.1.4.4  yamt #define SCF_RSP_SPI_S2	(1U << 11)
    111  1.1.4.4  yamt #define SCF_RSP_SPI_B4	(1U << 12)
    112  1.1.4.4  yamt #define SCF_RSP_SPI_BSY	(1U << 13)
    113  1.1.4.2  yamt /* response types */
    114  1.1.4.2  yamt #define SCF_RSP_R0	0	/* none */
    115  1.1.4.2  yamt #define SCF_RSP_R1	(SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX)
    116  1.1.4.2  yamt #define SCF_RSP_R1B	(SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX|SCF_RSP_BSY)
    117  1.1.4.2  yamt #define SCF_RSP_R2	(SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_136)
    118  1.1.4.2  yamt #define SCF_RSP_R3	(SCF_RSP_PRESENT)
    119  1.1.4.2  yamt #define SCF_RSP_R4	(SCF_RSP_PRESENT)
    120  1.1.4.2  yamt #define SCF_RSP_R5	(SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX)
    121  1.1.4.2  yamt #define SCF_RSP_R5B	(SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX|SCF_RSP_BSY)
    122  1.1.4.2  yamt #define SCF_RSP_R6	(SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX)
    123  1.1.4.2  yamt #define SCF_RSP_R7	(SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX)
    124  1.1.4.4  yamt /* SPI */
    125  1.1.4.4  yamt #define SCF_RSP_SPI_R1	(SCF_RSP_SPI_S1)
    126  1.1.4.4  yamt #define SCF_RSP_SPI_R1B	(SCF_RSP_SPI_S1|SCF_RSP_SPI_BSY)
    127  1.1.4.4  yamt #define SCF_RSP_SPI_R2	(SCF_RSP_SPI_S1|SCF_RSP_SPI_S2)
    128  1.1.4.4  yamt #define SCF_RSP_SPI_R3	(SCF_RSP_SPI_S1|SCF_RSP_SPI_B4)
    129  1.1.4.4  yamt #define SCF_RSP_SPI_R4	(SCF_RSP_SPI_S1|SCF_RSP_SPI_B4)
    130  1.1.4.4  yamt #define SCF_RSP_SPI_R5	(SCF_RSP_SPI_S1|SCF_RSP_SPI_S2)
    131  1.1.4.4  yamt #define SCF_RSP_SPI_R7	(SCF_RSP_SPI_S1|SCF_RSP_SPI_B4)
    132  1.1.4.2  yamt 	int		 c_error;	/* errno value on completion */
    133  1.1.4.2  yamt 
    134  1.1.4.2  yamt 	/* Host controller owned fields for data xfer in progress */
    135  1.1.4.2  yamt 	int c_resid;			/* remaining I/O */
    136  1.1.4.2  yamt 	u_char *c_buf;			/* remaining data */
    137  1.1.4.2  yamt };
    138  1.1.4.2  yamt 
    139  1.1.4.2  yamt /*
    140  1.1.4.2  yamt  * Decoded PC Card 16 based Card Information Structure (CIS),
    141  1.1.4.2  yamt  * per card (function 0) and per function (1 and greater).
    142  1.1.4.2  yamt  */
    143  1.1.4.2  yamt struct sdmmc_cis {
    144  1.1.4.2  yamt 	uint16_t	 manufacturer;
    145  1.1.4.2  yamt #define SDMMC_VENDOR_INVALID	0xffff
    146  1.1.4.2  yamt 	uint16_t	 product;
    147  1.1.4.2  yamt #define SDMMC_PRODUCT_INVALID	0xffff
    148  1.1.4.2  yamt 	uint8_t		 function;
    149  1.1.4.2  yamt #define SDMMC_FUNCTION_INVALID	0xff
    150  1.1.4.2  yamt 	u_char		 cis1_major;
    151  1.1.4.2  yamt 	u_char		 cis1_minor;
    152  1.1.4.2  yamt 	char		 cis1_info_buf[256];
    153  1.1.4.2  yamt 	char		*cis1_info[4];
    154  1.1.4.2  yamt };
    155  1.1.4.2  yamt 
    156  1.1.4.2  yamt /*
    157  1.1.4.2  yamt  * Structure describing either an SD card I/O function or a SD/MMC
    158  1.1.4.2  yamt  * memory card from a "stack of cards" that responded to CMD2.  For a
    159  1.1.4.2  yamt  * combo card with one I/O function and one memory card, there will be
    160  1.1.4.2  yamt  * two of these structures allocated.  Each card slot has such a list
    161  1.1.4.2  yamt  * of sdmmc_function structures.
    162  1.1.4.2  yamt  */
    163  1.1.4.2  yamt struct sdmmc_function {
    164  1.1.4.2  yamt 	/* common members */
    165  1.1.4.2  yamt 	struct sdmmc_softc *sc;		/* card slot softc */
    166  1.1.4.2  yamt 	uint16_t rca;			/* relative card address */
    167  1.1.4.5  yamt 	int interface;			/* SD/MMC:0, SDIO:standard interface */
    168  1.1.4.5  yamt 	int width;			/* bus width */
    169  1.1.4.2  yamt 	int flags;
    170  1.1.4.2  yamt #define SFF_ERROR		0x0001	/* function is poo; ignore it */
    171  1.1.4.2  yamt #define SFF_SDHC		0x0002	/* SD High Capacity card */
    172  1.1.4.2  yamt 	SIMPLEQ_ENTRY(sdmmc_function) sf_list;
    173  1.1.4.2  yamt 	/* SD card I/O function members */
    174  1.1.4.2  yamt 	int number;			/* I/O function number or -1 */
    175  1.1.4.2  yamt 	device_t child;			/* function driver */
    176  1.1.4.2  yamt 	struct sdmmc_cis cis;		/* decoded CIS */
    177  1.1.4.2  yamt 	/* SD/MMC memory card members */
    178  1.1.4.2  yamt 	struct sdmmc_csd csd;		/* decoded CSD value */
    179  1.1.4.2  yamt 	struct sdmmc_cid cid;		/* decoded CID value */
    180  1.1.4.2  yamt 	sdmmc_response raw_cid;		/* temp. storage for decoding */
    181  1.1.4.4  yamt 	uint32_t raw_scr[2];
    182  1.1.4.4  yamt 	struct sdmmc_scr scr;		/* decoded CSR value */
    183  1.1.4.5  yamt 
    184  1.1.4.5  yamt 	void *bbuf;			/* bounce buffer */
    185  1.1.4.5  yamt 	bus_dmamap_t bbuf_dmap;		/* DMA map for bounce buffer */
    186  1.1.4.2  yamt };
    187  1.1.4.2  yamt 
    188  1.1.4.2  yamt /*
    189  1.1.4.2  yamt  * Structure describing a single SD/MMC/SDIO card slot.
    190  1.1.4.2  yamt  */
    191  1.1.4.2  yamt struct sdmmc_softc {
    192  1.1.4.2  yamt 	device_t sc_dev;		/* base device */
    193  1.1.4.2  yamt #define SDMMCDEVNAME(sc)	(device_xname(sc->sc_dev))
    194  1.1.4.2  yamt 
    195  1.1.4.2  yamt 	sdmmc_chipset_tag_t sc_sct;	/* host controller chipset tag */
    196  1.1.4.4  yamt 	sdmmc_spi_chipset_tag_t sc_spi_sct;
    197  1.1.4.2  yamt 	sdmmc_chipset_handle_t sc_sch;	/* host controller chipset handle */
    198  1.1.4.2  yamt 	bus_dma_tag_t sc_dmat;
    199  1.1.4.2  yamt 	bus_dmamap_t sc_dmap;
    200  1.1.4.4  yamt #define	SDMMC_MAXNSEGS		17	/* (MAXPHYS / PAGE_SIZE) + 1 */
    201  1.1.4.2  yamt 
    202  1.1.4.2  yamt 	struct kmutex sc_mtx;		/* lock around host controller */
    203  1.1.4.2  yamt 	int sc_dying;			/* bus driver is shutting down */
    204  1.1.4.2  yamt 
    205  1.1.4.2  yamt 	uint32_t sc_flags;
    206  1.1.4.2  yamt #define SMF_INITED		0x0001
    207  1.1.4.2  yamt #define SMF_SD_MODE		0x0002	/* host in SD mode (MMC otherwise) */
    208  1.1.4.2  yamt #define SMF_IO_MODE		0x0004	/* host in I/O mode (SD mode only) */
    209  1.1.4.2  yamt #define SMF_MEM_MODE		0x0008	/* host in memory mode (SD or MMC) */
    210  1.1.4.2  yamt #define SMF_CARD_PRESENT	0x4000	/* card presence noticed */
    211  1.1.4.2  yamt #define SMF_CARD_ATTACHED	0x8000	/* card driver(s) attached */
    212  1.1.4.2  yamt 
    213  1.1.4.2  yamt 	uint32_t sc_caps;		/* host capability */
    214  1.1.4.2  yamt #define SMC_CAPS_AUTO_STOP	0x0001	/* send CMD12 automagically by host */
    215  1.1.4.2  yamt #define SMC_CAPS_4BIT_MODE	0x0002	/* 4-bits data bus width */
    216  1.1.4.2  yamt #define SMC_CAPS_DMA		0x0004	/* DMA transfer */
    217  1.1.4.4  yamt #define SMC_CAPS_SPI_MODE	0x0008	/* SPI mode */
    218  1.1.4.4  yamt #define SMC_CAPS_POLL_CARD_DET	0x0010	/* Polling card detect */
    219  1.1.4.4  yamt #define SMC_CAPS_SINGLE_ONLY	0x0020	/* only single read/write */
    220  1.1.4.5  yamt #define SMC_CAPS_8BIT_MODE	0x0040	/* 8-bits data bus width */
    221  1.1.4.5  yamt #define SMC_CAPS_MULTI_SEG_DMA	0x0080	/* multiple segment DMA transfer */
    222  1.1.4.2  yamt 
    223  1.1.4.2  yamt 	/* function */
    224  1.1.4.2  yamt 	int sc_function_count;		/* number of I/O functions (SDIO) */
    225  1.1.4.2  yamt 	struct sdmmc_function *sc_card;	/* selected card */
    226  1.1.4.2  yamt 	struct sdmmc_function *sc_fn0;	/* function 0, the card itself */
    227  1.1.4.2  yamt 	SIMPLEQ_HEAD(, sdmmc_function) sf_head; /* list of card functions */
    228  1.1.4.2  yamt 
    229  1.1.4.2  yamt 	/* task queue */
    230  1.1.4.2  yamt 	struct lwp *sc_tskq_lwp;	/* asynchronous tasks */
    231  1.1.4.2  yamt 	TAILQ_HEAD(, sdmmc_task) sc_tskq;   /* task thread work queue */
    232  1.1.4.2  yamt 	struct kmutex sc_tskq_mtx;
    233  1.1.4.2  yamt 	struct kcondvar sc_tskq_cv;
    234  1.1.4.2  yamt 
    235  1.1.4.2  yamt 	/* discover task */
    236  1.1.4.2  yamt 	struct sdmmc_task sc_discover_task; /* card attach/detach task */
    237  1.1.4.2  yamt 	struct kmutex sc_discover_task_mtx;
    238  1.1.4.2  yamt 
    239  1.1.4.2  yamt 	/* interrupt task */
    240  1.1.4.2  yamt 	struct sdmmc_task sc_intr_task;	/* card interrupt task */
    241  1.1.4.2  yamt 	struct kmutex sc_intr_task_mtx;
    242  1.1.4.2  yamt 	TAILQ_HEAD(, sdmmc_intr_handler) sc_intrq; /* interrupt handlers */
    243  1.1.4.2  yamt 
    244  1.1.4.2  yamt 	u_int sc_clkmin;		/* host min bus clock */
    245  1.1.4.2  yamt 	u_int sc_clkmax;		/* host max bus clock */
    246  1.1.4.2  yamt 	u_int sc_busclk;		/* host bus clock */
    247  1.1.4.2  yamt 	int sc_buswidth;		/* host bus width */
    248  1.1.4.4  yamt 
    249  1.1.4.4  yamt 	callout_t sc_card_detect_ch;	/* polling card insert/remove */
    250  1.1.4.2  yamt };
    251  1.1.4.2  yamt 
    252  1.1.4.2  yamt /*
    253  1.1.4.2  yamt  * Attach devices at the sdmmc bus.
    254  1.1.4.2  yamt  */
    255  1.1.4.2  yamt struct sdmmc_attach_args {
    256  1.1.4.2  yamt 	uint16_t manufacturer;
    257  1.1.4.2  yamt 	uint16_t product;
    258  1.1.4.5  yamt 	int interface;
    259  1.1.4.2  yamt 	struct sdmmc_function *sf;
    260  1.1.4.2  yamt };
    261  1.1.4.2  yamt 
    262  1.1.4.2  yamt struct sdmmc_product {
    263  1.1.4.2  yamt 	uint16_t	pp_vendor;
    264  1.1.4.2  yamt 	uint16_t	pp_product;
    265  1.1.4.2  yamt 	const char	*pp_cisinfo[4];
    266  1.1.4.2  yamt };
    267  1.1.4.2  yamt 
    268  1.1.4.2  yamt #ifndef	IPL_SDMMC
    269  1.1.4.2  yamt #define IPL_SDMMC	IPL_BIO
    270  1.1.4.2  yamt #endif
    271  1.1.4.2  yamt 
    272  1.1.4.2  yamt #ifndef	splsdmmc
    273  1.1.4.2  yamt #define splsdmmc()	splbio()
    274  1.1.4.2  yamt #endif
    275  1.1.4.2  yamt 
    276  1.1.4.2  yamt #define	SDMMC_LOCK(sc)
    277  1.1.4.2  yamt #define	SDMMC_UNLOCK(sc)
    278  1.1.4.2  yamt 
    279  1.1.4.2  yamt #ifdef SDMMC_DEBUG
    280  1.1.4.2  yamt extern int sdmmcdebug;
    281  1.1.4.2  yamt #endif
    282  1.1.4.2  yamt 
    283  1.1.4.2  yamt void	sdmmc_add_task(struct sdmmc_softc *, struct sdmmc_task *);
    284  1.1.4.2  yamt void	sdmmc_del_task(struct sdmmc_task *);
    285  1.1.4.2  yamt 
    286  1.1.4.2  yamt struct	sdmmc_function *sdmmc_function_alloc(struct sdmmc_softc *);
    287  1.1.4.2  yamt void	sdmmc_function_free(struct sdmmc_function *);
    288  1.1.4.2  yamt int	sdmmc_set_bus_power(struct sdmmc_softc *, uint32_t, uint32_t);
    289  1.1.4.2  yamt int	sdmmc_mmc_command(struct sdmmc_softc *, struct sdmmc_command *);
    290  1.1.4.4  yamt int	sdmmc_app_command(struct sdmmc_softc *, struct sdmmc_function *,
    291  1.1.4.4  yamt 	    struct sdmmc_command *);
    292  1.1.4.2  yamt void	sdmmc_go_idle_state(struct sdmmc_softc *);
    293  1.1.4.2  yamt int	sdmmc_select_card(struct sdmmc_softc *, struct sdmmc_function *);
    294  1.1.4.4  yamt int	sdmmc_set_relative_addr(struct sdmmc_softc *, struct sdmmc_function *);
    295  1.1.4.2  yamt 
    296  1.1.4.2  yamt void	sdmmc_intr_enable(struct sdmmc_function *);
    297  1.1.4.2  yamt void	sdmmc_intr_disable(struct sdmmc_function *);
    298  1.1.4.2  yamt void	*sdmmc_intr_establish(device_t, int (*)(void *), void *, const char *);
    299  1.1.4.2  yamt void	sdmmc_intr_disestablish(void *);
    300  1.1.4.2  yamt void	sdmmc_intr_task(void *);
    301  1.1.4.2  yamt 
    302  1.1.4.2  yamt int	sdmmc_decode_csd(struct sdmmc_softc *, sdmmc_response,
    303  1.1.4.2  yamt 	    struct sdmmc_function *);
    304  1.1.4.2  yamt int	sdmmc_decode_cid(struct sdmmc_softc *, sdmmc_response,
    305  1.1.4.2  yamt 	    struct sdmmc_function *);
    306  1.1.4.2  yamt void	sdmmc_print_cid(struct sdmmc_cid *);
    307  1.1.4.4  yamt #ifdef SDMMC_DUMP_CSD
    308  1.1.4.4  yamt void	sdmmc_print_csd(sdmmc_response, struct sdmmc_csd *);
    309  1.1.4.4  yamt #endif
    310  1.1.4.4  yamt void	sdmmc_dump_data(const char *, void *, size_t);
    311  1.1.4.2  yamt 
    312  1.1.4.2  yamt int	sdmmc_io_enable(struct sdmmc_softc *);
    313  1.1.4.2  yamt void	sdmmc_io_scan(struct sdmmc_softc *);
    314  1.1.4.2  yamt int	sdmmc_io_init(struct sdmmc_softc *, struct sdmmc_function *);
    315  1.1.4.2  yamt uint8_t sdmmc_io_read_1(struct sdmmc_function *, int);
    316  1.1.4.2  yamt uint16_t sdmmc_io_read_2(struct sdmmc_function *, int);
    317  1.1.4.2  yamt uint32_t sdmmc_io_read_4(struct sdmmc_function *, int);
    318  1.1.4.2  yamt int	sdmmc_io_read_multi_1(struct sdmmc_function *, int, u_char *, int);
    319  1.1.4.2  yamt void	sdmmc_io_write_1(struct sdmmc_function *, int, uint8_t);
    320  1.1.4.2  yamt void	sdmmc_io_write_2(struct sdmmc_function *, int, uint16_t);
    321  1.1.4.2  yamt void	sdmmc_io_write_4(struct sdmmc_function *, int, uint32_t);
    322  1.1.4.2  yamt int	sdmmc_io_write_multi_1(struct sdmmc_function *, int, u_char *, int);
    323  1.1.4.2  yamt int	sdmmc_io_function_enable(struct sdmmc_function *);
    324  1.1.4.2  yamt void	sdmmc_io_function_disable(struct sdmmc_function *);
    325  1.1.4.2  yamt 
    326  1.1.4.2  yamt int	sdmmc_read_cis(struct sdmmc_function *, struct sdmmc_cis *);
    327  1.1.4.2  yamt void	sdmmc_print_cis(struct sdmmc_function *);
    328  1.1.4.2  yamt void	sdmmc_check_cis_quirks(struct sdmmc_function *);
    329  1.1.4.2  yamt 
    330  1.1.4.2  yamt int	sdmmc_mem_enable(struct sdmmc_softc *);
    331  1.1.4.2  yamt void	sdmmc_mem_scan(struct sdmmc_softc *);
    332  1.1.4.2  yamt int	sdmmc_mem_init(struct sdmmc_softc *, struct sdmmc_function *);
    333  1.1.4.4  yamt int	sdmmc_mem_send_op_cond(struct sdmmc_softc *, uint32_t, uint32_t *);
    334  1.1.4.4  yamt int	sdmmc_mem_send_if_cond(struct sdmmc_softc *, uint32_t, uint32_t *);
    335  1.1.4.4  yamt int	sdmmc_mem_set_blocklen(struct sdmmc_softc *, struct sdmmc_function *);
    336  1.1.4.2  yamt int	sdmmc_mem_read_block(struct sdmmc_function *, uint32_t, u_char *,
    337  1.1.4.2  yamt 	    size_t);
    338  1.1.4.2  yamt int	sdmmc_mem_write_block(struct sdmmc_function *, uint32_t, u_char *,
    339  1.1.4.2  yamt 	    size_t);
    340  1.1.4.2  yamt 
    341  1.1.4.2  yamt #endif	/* _SDMMCVAR_H_ */
    342