summaryrefslogtreecommitdiff
path: root/sys/arch/armv7/omap
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2013-11-12 17:51:53 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2013-11-12 17:51:53 +0000
commit066bea3215e938633178d1b8cac067c5cd41e693 (patch)
tree541a70eb1e9156c5b03b84b6a1080a6bb2b91c01 /sys/arch/armv7/omap
parent308996656abf9595719ce6bb328c6d6b01bbd8f0 (diff)
Implement sd card detection. Fixes the `sdmmc0: can't enable card' on bbb
when there is no card. Tested on pandaboard by patrick@, ok patrick@ and syl@
Diffstat (limited to 'sys/arch/armv7/omap')
-rw-r--r--sys/arch/armv7/omap/ommmc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/arch/armv7/omap/ommmc.c b/sys/arch/armv7/omap/ommmc.c
index ad836827ccc..7eccb4eaf51 100644
--- a/sys/arch/armv7/omap/ommmc.c
+++ b/sys/arch/armv7/omap/ommmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ommmc.c,v 1.10 2013/11/06 19:03:07 syl Exp $ */
+/* $OpenBSD: ommmc.c,v 1.11 2013/11/12 17:51:52 fgsch Exp $ */
/*
* Copyright (c) 2009 Dale Rahn <drahn@openbsd.org>
@@ -43,6 +43,7 @@
#define MMCHS_SYSSTATUS 0x014
#define MMCHS_CSRE 0x024
#define MMCHS_SYSTEST 0x028
+#define MMCHS_SYSTEST_SDCD (1 << 15)
#define MMCHS_CON 0x02C
#define MMCHS_CON_INIT (1<<1)
#define MMCHS_CON_DW8 (1<<5)
@@ -528,13 +529,9 @@ ommmc_host_maxblklen(sdmmc_chipset_handle_t sch)
int
ommmc_card_detect(sdmmc_chipset_handle_t sch)
{
-#if 0
struct ommmc_softc *sc = sch;
- return ISSET(HREAD4(sc, SDHC_PRESENT_STATE), SDHC_CARD_INSERTED) ?
+ return !ISSET(HREAD4(sc, MMCHS_SYSTEST), MMCHS_SYSTEST_SDCD) ?
1 : 0;
-#else
- return (1); /* XXX */
-#endif
}
/*