Skip to contentSkip to conversation

drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX

RFC PATCH Superseded Adam Ford 2 participants 2 messages Jan 11, 2017 – Jan 19, 2017 MMC, SD and SDIO

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

RFC PATCH v2 1/1 drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX

On the OMAP36xx (and 37xx) the CONTROL_WKUP_CTRL register has a field (bit 6) named GPIO_IO_PWRDNZ. If 0, the IO buffers which are related to the MMC are disabled. After the PBIAS is configured, this bit should be set high to enable the MMC port.

V2: Make this feature a config option and add it to the MMC section
of the Kconfig. This allows the precompiler to only include it in a small handfull of OMAP36XX and 37XX boards using MMC1.

V1: Original submission

configs/omap3_logic_defconfig +1 -0
index ac1a6a3..bd5f1a8 100644
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
+CONFIG_MMC_OMAP36XX_PINS=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_FPGA is not set
drivers/mmc/Kconfig +11 -0
index c3462ab..d6fcf7f 100644
@@ -204,6 +204,17 @@ config MMC_SDHCI_SPEAR
 
 	  If unsure, say N.
 
+config MMC_OMAP36XX_PINS
+	bool "Enable MMC1 on OMAP36XX/37XX"
+	depends on OMAP34XX
+	help
+	  This enables extended-drain in the MMC/SD/SDIO1I/O and 
+	  GPIO-associated I/O cells (gpio_126, gpio_127, and gpio_129)
+	  specific to the OMAP36XX/37XX using MMC1
+
+	  If you have a controller with this interface, say Y here.
+
+	  If unsure, say N.
 endif
 
 endmenu
drivers/mmc/omap_hsmmc.c +8 -0
index 0a1ee40..a4720e1 100644
@@ -38,6 +38,7 @@
 #include <asm/arch/sys_proto.h>
 #endif
 #include <dm.h>
+#include <asm/arch-omap3/mux.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -115,6 +116,13 @@ static unsigned char mmc_board_init(struct mmc *mmc)
 		PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
 		&t2_base->pbias_lite);
 
+#ifdef CONFIG_MMC_OMAP36XX_PINS
+	if (get_cpu_family() == CPU_OMAP36XX)
+		writel(readl(OMAP34XX_CTRL_WKUP_CTRL) |
+				OMAP34XX_CTRL_WKUP_CTRL_GPIO_IO_PWRDNZ,
+				OMAP34XX_CTRL_WKUP_CTRL);
+#endif
+
 	writel(readl(&t2_base->devconf0) | MMCSDIO1ADPCLKISEL,
 		&t2_base->devconf0);
 
Signature · 1 line
2.7.4
#1 lore raw

RFC PATCH v2 1/1 drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX

Hi Adam,

Quoted 5 lines · Adam Ford

On the OMAP36xx (and 37xx) the CONTROL_WKUP_CTRL register has a field (bit 6) named GPIO_IO_PWRDNZ. If 0, the IO buffers which are related to the MMC are disabled. After the PBIAS is configured, this bit should be set high to enable the MMC port.

Quoted 7 lines

V2: Make this feature a config option and add it to the MMC section
of the Kconfig. This allows the precompiler to only include it in a small handfull of OMAP36XX and 37XX boards using MMC1.

V1: Original submission

Sorry for late, Could you resend the patch on latest? Current patch has conflict..

Best Regards,
Jaehoon Chung

Quoted 62 lines
configs/omap3_logic_defconfig +1 -0
index ac1a6a3..bd5f1a8 100644
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
+CONFIG_MMC_OMAP36XX_PINS=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_FPGA is not set
drivers/mmc/Kconfig +11 -0
index c3462ab..d6fcf7f 100644
@@ -204,6 +204,17 @@ config MMC_SDHCI_SPEAR
 
 	  If unsure, say N.
 
+config MMC_OMAP36XX_PINS
+	bool "Enable MMC1 on OMAP36XX/37XX"
+	depends on OMAP34XX
+	help
+	  This enables extended-drain in the MMC/SD/SDIO1I/O and 
+	  GPIO-associated I/O cells (gpio_126, gpio_127, and gpio_129)
+	  specific to the OMAP36XX/37XX using MMC1
+
+	  If you have a controller with this interface, say Y here.
+
+	  If unsure, say N.
 endif
 
 endmenu
drivers/mmc/omap_hsmmc.c +8 -0
index 0a1ee40..a4720e1 100644
@@ -38,6 +38,7 @@
 #include <asm/arch/sys_proto.h>
 #endif
 #include <dm.h>
+#include <asm/arch-omap3/mux.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -115,6 +116,13 @@ static unsigned char mmc_board_init(struct mmc *mmc)
 		PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
 		&t2_base->pbias_lite);
 
+#ifdef CONFIG_MMC_OMAP36XX_PINS
+	if (get_cpu_family() == CPU_OMAP36XX)
+		writel(readl(OMAP34XX_CTRL_WKUP_CTRL) |
+				OMAP34XX_CTRL_WKUP_CTRL_GPIO_IO_PWRDNZ,
+				OMAP34XX_CTRL_WKUP_CTRL);
+#endif
+
 	writel(readl(&t2_base->devconf0) | MMCSDIO1ADPCLKISEL,
 		&t2_base->devconf0);