public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* Setting MMC_CAP_POWER_OFF_CARD on mmc2 leads to filesystem problems on mmc1
@ 2011-01-21 14:18 Koen Kooi
  2011-01-21 14:49 ` Luciano Coelho
  0 siblings, 1 reply; 8+ messages in thread
From: Koen Kooi @ 2011-01-21 14:18 UTC (permalink / raw)
  To: l-o List, linux-mmc; +Cc: madhu.cr, cjb, Luciano Coelho

[-- Attachment #1: Type: text/plain, Size: 1772 bytes --]

Hi,

I'm trying to bring up a wl1271 sdio expansion board on beagle with 2.6.37 and I'm running into a weird problem when enabling MMC_CAP_POWER_OFF_CARD.

My patch basically does:

--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -270,7 +270,7 @@ static struct omap2_hsmmc_info mmc[] = {
       {
               .name           = "wl1271",
               .mmc            = 2,
-               .caps           = MMC_CAP_4_BIT_DATA,
+               .caps           = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,

And does NOT touch mmc1. But after adding MMC_CAP_POWER_OFF_CARD I get tons of:

[   22.259490] mmcblk0: error -110 sending status comand
[   22.264617] mmcblk0: error -110 sending read/write command, response 0x0, card status 0x0
[   22.273345] mmcblk0: error -110 transferring data, sector 2338228, nr 3, card status 0x0
[   22.281799] end_request: I/O error, dev mmcblk0, sector 2338228
[   22.288055] mmcblk0: error -110 sending status comand
[   22.293151] mmcblk0: error -110 sending read/write command, response 0x0, card status 0x0
[   22.301879] mmcblk0: error -110 transferring data, sector 2338229, nr 2, card status 0x0
[   22.310363] end_request: I/O error, dev mmcblk0, sector 2338229

When using mmcblk0p2 as rootfs. Attached is the complete patch. It looks a bit weird because it's using the expansionboard infrastucture I hacked together.

I suspect that mmc2 is turning off the shared regulator, but I have various people claiming this code (minus the expansionboard detection) works with the same regulator setup, so I'm extremely puzzled.

The CC: list was partially generated with the get_maintainer.pl script, apologies if I screwed it up.

regards,

Koen


[-- Attachment #2: 0001-omap3-beagleboard-add-WIP-support-for-beagleboardtoy.patch --]
[-- Type: application/octet-stream, Size: 3434 bytes --]

From b3e1e2b9793b9afa286a1a195b739587fbf85c8c Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@beagleboard.org>
Date: Mon, 20 Dec 2010 11:57:56 +0100
Subject: [PATCH] omap3: beagleboard: add WIP support for beagleboardtoys WL12xx board

Based on a patch by Luciano Coelho <luciano.coelho@nokia.com>

Signed-off-by: Koen Kooi <koen@beagleboard.org>
---
 arch/arm/mach-omap2/board-omap3beagle.c |   76 +++++++++++++++++++++++++++++++
 1 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 64a181e..9285ae7 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -146,6 +146,67 @@ fail0:
 
 char expansionboard_name[16];
 
+#if defined(CONFIG_WL1271) || defined(CONFIG_WL1271_MODULE)
+#include <linux/regulator/fixed.h>
+#include <linux/wl12xx.h>
+
+#define OMAP_BEAGLE_WLAN_EN_GPIO    (139)
+#define OMAP_BEAGLE_WLAN_IRQ_GPIO   (137)
+
+struct wl12xx_platform_data omap_beagle_wlan_data __initdata = {
+	.irq = OMAP_GPIO_IRQ(OMAP_BEAGLE_WLAN_IRQ_GPIO),
+	.board_ref_clock = 2, /* 38.4 MHz */
+};
+
+ static struct omap2_hsmmc_info mmcbbt[] = {
+ 	{
+ 		.mmc		= 1,
+ 		.caps		= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
+ 		.gpio_wp	= 29,
+ 	},
+	{
+		.name		= "wl1271",
+		.mmc		= 2,
+		.caps		= MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
+		.gpio_wp	= -EINVAL,
+		.gpio_cd	= -EINVAL,
+		.nonremovable	= true,
+	},
+ 	{}	/* Terminator */
+ };
+
+static struct regulator_consumer_supply beagle_vmmc2_supply = {
+	.supply         = "vmmc",
+	.dev_name       = "mmci-omap-hs.1",
+};
+
+static struct regulator_init_data beagle_vmmc2 = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies = 1,
+	.consumer_supplies = &beagle_vmmc2_supply,
+};
+
+static struct fixed_voltage_config beagle_vwlan = {
+	.supply_name = "vwl1271",
+	.microvolts = 1800000,  /* 1.8V */
+	.gpio = OMAP_BEAGLE_WLAN_EN_GPIO,
+	.startup_delay = 70000, /* 70ms */
+	.enable_high = 1,
+	.enabled_at_boot = 0,
+	.init_data = &beagle_vmmc2,
+};
+
+static struct platform_device omap_vwlan_device = {
+	.name           = "reg-fixed-voltage",
+	.id             = 1,
+	.dev = {
+		.platform_data = &beagle_vwlan,
+	},
+};
+#endif
+
 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
 
 #include <plat/mcspi.h>
@@ -384,7 +445,14 @@ static int beagle_twl_gpio_setup(struct device *dev,
 	}
 	/* gpio + 0 is "mmc0_cd" (input/IRQ) */
 	mmc[0].gpio_cd = gpio + 0;
+#if defined(CONFIG_WL1271) || defined(CONFIG_WL1271_MODULE)
+	if(!strcmp(expansionboard_name, "fixme-beagletoy")) 
+		omap2_hsmmc_init(mmcbbt);
+	else
+		omap2_hsmmc_init(mmc);
+#else
 	omap2_hsmmc_init(mmc);
+#endif
 
 	/* link regulators to MMC adapters */
 	beagle_vmmc1_supply.dev = mmc[0].dev;
@@ -788,6 +856,14 @@ static void __init omap3_beagle_init(void)
 		gpio_export(162, 1);
 	}
 
+	if(!strcmp(expansionboard_name, "fixme-beagletoy"))
+	{
+		if (wl12xx_set_platform_data(&omap_beagle_wlan_data))
+			pr_err("error setting wl12xx data\n");
+		printk(KERN_INFO "Beagle expansionboard: registering wl12xx platform device\n");
+		platform_device_register(&omap_vwlan_device);
+	}
+
 	usb_musb_init(&musb_board_data);
 	usb_ehci_init(&ehci_pdata);
 	omap3beagle_flash_init();
-- 
1.6.6.1


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

end of thread, other threads:[~2011-02-03  1:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-21 14:18 Setting MMC_CAP_POWER_OFF_CARD on mmc2 leads to filesystem problems on mmc1 Koen Kooi
2011-01-21 14:49 ` Luciano Coelho
2011-01-22 10:36   ` Ohad Ben-Cohen
2011-01-22 15:30     ` Koen Kooi
2011-01-22 15:47       ` Ohad Ben-Cohen
2011-02-02  0:11         ` Tony Lindgren
2011-02-02  8:01           ` Ohad Ben-Cohen
2011-02-03  1:08             ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox