All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 01/13] mmc: tmio: Simplify pinmux handling
@ 2018-10-31 17:15 Marek Vasut
  2018-10-31 17:15 ` [U-Boot] [PATCH 02/13] mmc: tmio: Switch to clock framework Marek Vasut
                   ` (12 more replies)
  0 siblings, 13 replies; 33+ messages in thread
From: Marek Vasut @ 2018-10-31 17:15 UTC (permalink / raw)
  To: u-boot

The SD UHS SDR12, SDR25, SDR50, SDR104, DDR50 and MMC HS200, HS400
modes all use 1.8V signaling, while all the legacy modes use 3.3V
signaling. While there are extra modes which use 1.2V signaling,
the existing hardware does not support those.

Simplify the pinmux such that 3.3V signaling implies legacy mode
pinmux and the rest implies UHS mode pinmux. This prevents the
massive case statement from growing further. Moreover, it fixes
an edge case where during SD 1.8V switch, the bus mode is still
set to default while the signaling is already set to 1.8V, which
results in an attempt to communicate with a 1.8V card using pins
in 3.3V mode and thus communication failure.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
---
 drivers/mmc/tmio-common.c | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/drivers/mmc/tmio-common.c b/drivers/mmc/tmio-common.c
index 138de59470..5f927c6150 100644
--- a/drivers/mmc/tmio-common.c
+++ b/drivers/mmc/tmio-common.c
@@ -622,26 +622,10 @@ static void tmio_sd_set_pins(struct udevice *dev)
 #endif
 
 #ifdef CONFIG_PINCTRL
-	switch (mmc->selected_mode) {
-	case MMC_LEGACY:
-	case SD_LEGACY:
-	case MMC_HS:
-	case SD_HS:
-	case MMC_HS_52:
-	case MMC_DDR_52:
-		pinctrl_select_state(dev, "default");
-		break;
-	case UHS_SDR12:
-	case UHS_SDR25:
-	case UHS_SDR50:
-	case UHS_DDR50:
-	case UHS_SDR104:
-	case MMC_HS_200:
+	if (mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
 		pinctrl_select_state(dev, "state_uhs");
-		break;
-	default:
-		break;
-	}
+	else
+		pinctrl_select_state(dev, "default");
 #endif
 }
 
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2018-11-02 14:43 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31 17:15 [U-Boot] [PATCH 01/13] mmc: tmio: Simplify pinmux handling Marek Vasut
2018-10-31 17:15 ` [U-Boot] [PATCH 02/13] mmc: tmio: Switch to clock framework Marek Vasut
2018-11-01  9:38   ` [U-Boot] [PATCH V2 " Marek Vasut
2018-11-01 11:38     ` Masahiro Yamada
2018-11-02  2:19       ` Masahiro Yamada
2018-11-02 14:42         ` Marek Vasut
2018-11-02  2:24     ` Masahiro Yamada
2018-11-02 14:43       ` Marek Vasut
2018-10-31 17:15 ` [U-Boot] [PATCH 03/13] mmc: tmio: Do not set divider to 1 in DDR mode Marek Vasut
2018-11-01 11:39   ` Masahiro Yamada
2018-11-01 12:09     ` Marek Vasut
2018-10-31 17:15 ` [U-Boot] [PATCH 04/13] mmc: tmio: Configure clock before any other IOS Marek Vasut
2018-10-31 17:15 ` [U-Boot] [PATCH 05/13] mmc: tmio: Keep generating clock when clock are enabled Marek Vasut
2018-11-01 11:46   ` Masahiro Yamada
2018-11-01 12:10     ` Marek Vasut
2018-10-31 17:15 ` [U-Boot] [PATCH 06/13] mmc: tmio: Preinitialize regulator to 3.3V Marek Vasut
2018-10-31 17:16 ` [U-Boot] [PATCH 07/13] mmc: tmio: Improve error handling Marek Vasut
2018-11-01 11:43   ` Masahiro Yamada
2018-10-31 17:16 ` [U-Boot] [PATCH 08/13] mmc: tmio: Silence transfer errors when tuning Marek Vasut
2018-11-01 11:42   ` Masahiro Yamada
2018-11-01 12:11     ` Marek Vasut
2018-11-02  3:59       ` Masahiro Yamada
2018-11-02 14:27         ` Marek Vasut
2018-10-31 17:16 ` [U-Boot] [PATCH 09/13] mmc: tmio: sdhi: Touch SCC only when UHS capable Marek Vasut
2018-10-31 17:16 ` [U-Boot] [PATCH 10/13] mmc: tmio: sdhi: Clear HS400 settings when reseting SCC Marek Vasut
2018-10-31 17:16 ` [U-Boot] [PATCH 11/13] mmc: tmio: sdhi: Implement waiting for DAT0 line state Marek Vasut
2018-10-31 17:16 ` [U-Boot] [PATCH 12/13] mmc: tmio: sdhi: Switch CPG settings in UHS modes Marek Vasut
2018-10-31 17:16 ` [U-Boot] [PATCH 13/13] mmc: tmio: sdhi: Merge DTCNTL access into single register write Marek Vasut
2018-11-01 11:38 ` [U-Boot] [PATCH 01/13] mmc: tmio: Simplify pinmux handling Masahiro Yamada
2018-11-01 12:12   ` Marek Vasut
2018-11-02  3:58     ` Masahiro Yamada
2018-11-02 14:20       ` Marek Vasut
2018-11-02 14:35         ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.