Checking the dts files turned up some more imx sdhc problems.
authorjsg <jsg@openbsd.org>
Sun, 17 May 2015 12:28:03 +0000 (12:28 +0000)
committerjsg <jsg@openbsd.org>
Sun, 17 May 2015 12:28:03 +0000 (12:28 +0000)
- use the correct CD gpios on phyflex and wandboard usdhc3 (unit 2)
- udoo has just the one sd slot with no CD

sys/arch/armv7/imx/imx.c
sys/arch/armv7/imx/imxesdhc.c

index ea04cf4..28b291d 100644 (file)
@@ -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 },
index 857d47c..4437323 100644 (file)
@@ -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;