summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-05-17 12:28:04 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-05-17 12:28:04 +0000
commit2e3347b82ec22ec307df3536707501f2eab1bb2d (patch)
tree70fad539a12f41ad492e163542b7f0761de133c6 /sys/arch
parent7bd76046c439a611dc2360ec9b59b027c85c1564 (diff)
Checking the dts files turned up some more imx sdhc problems.
- use the correct CD gpios on phyflex and wandboard usdhc3 (unit 2) - udoo has just the one sd slot with no CD
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/armv7/imx/imx.c3
-rw-r--r--sys/arch/armv7/imx/imxesdhc.c28
2 files changed, 13 insertions, 18 deletions
diff --git a/sys/arch/armv7/imx/imx.c b/sys/arch/armv7/imx/imx.c
index ea04cf4c8c4..28b291de81c 100644
--- a/sys/arch/armv7/imx/imx.c
+++ b/sys/arch/armv7/imx/imx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imx.c,v 1.5 2015/05/15 17:01:18 jsg Exp $ */
+/* $OpenBSD: imx.c,v 1.6 2015/05/17 12:28:03 jsg Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
@@ -132,7 +132,6 @@ struct board_dev udoo_devs[] = {
{ "imxgpio", 5 },
{ "imxgpio", 6 },
{ "imxesdhc", 2 },
- { "imxesdhc", 3 },
{ "ehci", 0 },
{ "imxenet", 0 },
{ "ahci", 0 },
diff --git a/sys/arch/armv7/imx/imxesdhc.c b/sys/arch/armv7/imx/imxesdhc.c
index 857d47c9076..4437323cfb9 100644
--- a/sys/arch/armv7/imx/imxesdhc.c
+++ b/sys/arch/armv7/imx/imxesdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imxesdhc.c,v 1.9 2015/05/17 11:18:05 jsg Exp $ */
+/* $OpenBSD: imxesdhc.c,v 1.10 2015/05/17 12:28:03 jsg Exp $ */
/*
* Copyright (c) 2009 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -437,17 +437,22 @@ imxesdhc_card_detect(sdmmc_chipset_handle_t sch)
{
case BOARD_ID_IMX6_CUBOXI:
case BOARD_ID_IMX6_HUMMINGBOARD:
- gpio = 0*32 + 4;
+ switch (sc->unit) {
+ case 1:
+ gpio = 0*32 + 4;
+ break;
+ default:
+ return 0;
+ }
imxgpio_set_dir(gpio, IMXGPIO_DIR_IN);
return imxgpio_get_bit(gpio) ? 0 : 1;
- break;
case BOARD_ID_IMX6_PHYFLEX:
switch (sc->unit) {
case 1:
- gpio = 0*32 + 2;
+ gpio = 0*32 + 4;
break;
case 2:
- gpio = 4*32 + 22;
+ gpio = 0*32 + 27;
break;
default:
return 0;
@@ -484,20 +489,11 @@ imxesdhc_card_detect(sdmmc_chipset_handle_t sch)
return imxgpio_get_bit(gpio) ? 0 : 1;
case BOARD_ID_IMX6_UDOO:
switch (sc->unit) {
- /*
- * One of these is the SD card, another the wifi
- * the third is not connected (?)
- */
- case 0:
- case 1:
case 2:
- case 3:
- gpio = 3*32 + 9;
- break;
+ return 1;
default:
return 0;
}
- return 1;
case BOARD_ID_IMX6_UTILITE:
switch (sc->unit) {
case 2:
@@ -527,7 +523,7 @@ imxesdhc_card_detect(sdmmc_chipset_handle_t sch)
gpio = 0*32 + 2;
break;
case 2:
- gpio = 3*32 + 9;
+ gpio = 2*32 + 9;
break;
default:
return 0;