Annotation of src/sys/dev/sdmmc/sdhcvar.h, Revision 1.14
1.14 ! jakllsch 1: /* $NetBSD: sdhcvar.h,v 1.13 2013/01/10 17:19:33 jmcneill Exp $ */
1.1 nonaka 2: /* $OpenBSD: sdhcvar.h,v 1.3 2007/09/06 08:01:01 jsg Exp $ */
3:
4: /*
5: * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
6: *
7: * Permission to use, copy, modify, and distribute this software for any
8: * purpose with or without fee is hereby granted, provided that the above
9: * copyright notice and this permission notice appear in all copies.
10: *
11: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18: */
19:
20: #ifndef _SDHCVAR_H_
21: #define _SDHCVAR_H_
22:
23: #include <sys/bus.h>
24: #include <sys/device.h>
25: #include <sys/pmf.h>
26:
27: struct sdhc_host;
1.14 ! jakllsch 28: struct sdmmc_command;
1.1 nonaka 29:
30: struct sdhc_softc {
31: device_t sc_dev;
32:
33: struct sdhc_host **sc_host;
34: int sc_nhosts;
35:
36: bus_dma_tag_t sc_dmat;
37:
38: uint32_t sc_flags;
39: #define SDHC_FLAG_USE_DMA 0x0001
40: #define SDHC_FLAG_FORCE_DMA 0x0002
1.6 matt 41: #define SDHC_FLAG_NO_PWR0 0x0004 /* Freescale ESDHC */
42: #define SDHC_FLAG_HAVE_DVS 0x0008 /* Freescale ESDHC */
43: #define SDHC_FLAG_32BIT_ACCESS 0x0010 /* Freescale ESDHC */
44: #define SDHC_FLAG_ENHANCED 0x0020 /* Freescale ESDHC */
45: #define SDHC_FLAG_8BIT_MODE 0x0040 /* MMC 8bit mode is supported */
46: #define SDHC_FLAG_HAVE_CGM 0x0080 /* Netlogic XLP */
1.7 matt 47: #define SDHC_FLAG_NO_LED_ON 0x0100 /* LED_ON unsupported in HOST_CTL */
1.8 skrll 48: #define SDHC_FLAG_HOSTCAPS 0x0200 /* No device provided capabilities */
1.9 kiyohara 49: #define SDHC_FLAG_RSP136_CRC 0x0400 /* Resp 136 with CRC and end-bit */
50: #define SDHC_FLAG_SINGLE_ONLY 0x0800 /* Single transfer only */
1.11 riastrad 51: #define SDHC_FLAG_WAIT_RESET 0x1000 /* Wait for soft resets to start */
1.13 jmcneill 52: #define SDHC_FLAG_NO_HS_BIT 0x2000 /* Don't set SDHC_HIGH_SPEED bit */
1.14 ! jakllsch 53: #define SDHC_FLAG_EXTERNAL_DMA 0x4000
1.8 skrll 54:
1.5 matt 55: uint32_t sc_clkbase;
1.9 kiyohara 56: int sc_clkmsk; /* Mask for SDCLK */
1.8 skrll 57: uint32_t sc_caps;/* attachment provided capabilities */
1.9 kiyohara 58:
59: int (*sc_vendor_rod)(struct sdhc_softc *, int);
60: int (*sc_vendor_write_protect)(struct sdhc_softc *);
61: int (*sc_vendor_card_detect)(struct sdhc_softc *);
1.10 matt 62: int (*sc_vendor_bus_clock)(struct sdhc_softc *, int);
1.14 ! jakllsch 63: int (*sc_vendor_transfer_data_dma)(struct sdhc_host *, struct sdmmc_command *);
1.1 nonaka 64: };
65:
66: /* Host controller functions called by the attachment driver. */
67: int sdhc_host_found(struct sdhc_softc *, bus_space_tag_t,
68: bus_space_handle_t, bus_size_t);
69: int sdhc_intr(void *);
1.12 jakllsch 70: int sdhc_detach(struct sdhc_softc *, int);
1.4 nonaka 71: bool sdhc_suspend(device_t, const pmf_qual_t *);
72: bool sdhc_resume(device_t, const pmf_qual_t *);
73: bool sdhc_shutdown(device_t, int);
1.1 nonaka 74:
75: #endif /* _SDHCVAR_H_ */
CVSweb <webmaster@jp.NetBSD.org>