From 079ba0c1ef8c276c2c4747d2543881b6c37cc6a3 Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 17 May 2015 12:28:03 +0000 Subject: [PATCH] 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 --- sys/arch/armv7/imx/imx.c | 3 +-- sys/arch/armv7/imx/imxesdhc.c | 28 ++++++++++++---------------- 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 * Copyright (c) 2012-2013 Patrick Wildt @@ -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 * Copyright (c) 2006 Uwe Stuehler @@ -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; -- 2.20.1