Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: OMAP3: Add support for configuring MMC pins as GPIO pins

Some devices are using the MMC1 pins 4..8 as GPIO pins, and in
this case they need to be configured for 1.8V IO voltage if not
done by the bootloader as otherwise some devices like smsc911x
won't work properly.

Let's also make sure this register is saved and restored for
idle.

Cc: Tim Nordell <tim.nordell@logicpd.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

+28
+3
arch/arm/mach-omap2/control.c
··· 112 112 u32 csirxfe; 113 113 u32 iva2_bootaddr; 114 114 u32 iva2_bootmod; 115 + u32 wkup_ctrl; 115 116 u32 debobs_0; 116 117 u32 debobs_1; 117 118 u32 debobs_2; ··· 456 455 omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTADDR); 457 456 control_context.iva2_bootmod = 458 457 omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTMOD); 458 + control_context.wkup_ctrl = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL); 459 459 control_context.debobs_0 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(0)); 460 460 control_context.debobs_1 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(1)); 461 461 control_context.debobs_2 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(2)); ··· 514 512 OMAP343X_CONTROL_IVA2_BOOTADDR); 515 513 omap_ctrl_writel(control_context.iva2_bootmod, 516 514 OMAP343X_CONTROL_IVA2_BOOTMOD); 515 + omap_ctrl_writel(control_context.wkup_ctrl, OMAP34XX_CONTROL_WKUP_CTRL); 517 516 omap_ctrl_writel(control_context.debobs_0, OMAP343X_CONTROL_DEBOBS(0)); 518 517 omap_ctrl_writel(control_context.debobs_1, OMAP343X_CONTROL_DEBOBS(1)); 519 518 omap_ctrl_writel(control_context.debobs_2, OMAP343X_CONTROL_DEBOBS(2));
+3
arch/arm/mach-omap2/control.h
··· 231 231 #define OMAP343X_PADCONF_ETK_D15 OMAP343X_PADCONF_ETK(17) 232 232 233 233 /* 34xx GENERAL_WKUP register offsets */ 234 + #define OMAP34XX_CONTROL_WKUP_CTRL (OMAP343X_CONTROL_GENERAL_WKUP - 0x4) 235 + #define OMAP36XX_GPIO_IO_PWRDNZ BIT(6) 236 + 234 237 #define OMAP343X_CONTROL_WKUP_DEBOBSMUX(i) (OMAP343X_CONTROL_GENERAL_WKUP + \ 235 238 0x008 + (i)) 236 239 #define OMAP343X_CONTROL_WKUP_DEBOBS0 (OMAP343X_CONTROL_GENERAL_WKUP + 0x008)
+22
arch/arm/mach-omap2/pdata-quirks.c
··· 44 44 #endif 45 45 46 46 #ifdef CONFIG_ARCH_OMAP3 47 + /* 48 + * Configures GPIOs 126, 127 and 129 to 1.8V mode instead of 3.0V 49 + * mode for MMC1 in case bootloader did not configure things. 50 + * Note that if the pins are used for MMC1, pbias-regulator 51 + * manages the IO voltage. 52 + */ 53 + static void __init omap3_gpio126_127_129(void) 54 + { 55 + u32 reg; 56 + 57 + reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE); 58 + reg &= ~OMAP343X_PBIASLITEVMODE1; 59 + reg |= OMAP343X_PBIASLITEPWRDNZ1; 60 + omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE); 61 + if (cpu_is_omap3630()) { 62 + reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL); 63 + reg |= OMAP36XX_GPIO_IO_PWRDNZ; 64 + omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL); 65 + } 66 + } 67 + 47 68 static void __init hsmmc2_internal_input_clk(void) 48 69 { 49 70 u32 reg; ··· 377 356 { "nokia,omap3-n950", hsmmc2_internal_input_clk, }, 378 357 { "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, }, 379 358 { "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, }, 359 + { "logicpd,dm3730-torpedo-devkit", omap3_gpio126_127_129, }, 380 360 { "ti,omap3-evm-37xx", omap3_evm_legacy_init, }, 381 361 { "ti,am3517-evm", am3517_evm_legacy_init, }, 382 362 { "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },