Skip to contentSkip to conversation

ARM: OMAP: Beagle: support MMC gpio_wp differences on xM

PATCH In review Robert Nelson 2 participants 3 messages Aug 10, 2010 – Aug 11, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: OMAP: Beagle: support MMC gpio_wp differences on xM

The omap3630 based BeagleBoard xM uses a MicroSD card slot with no write protection.

---
 arch/arm/mach-omap2/board-omap3beagle.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +3 -1
index 87969c7..15929be 100644
@@ -185,7 +185,9 @@ static struct gpio_led gpio_leds[];
 static int beagle_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
-	if (system_rev >= 0x20 && system_rev <= 0x34301000) {
+	if (cpu_is_omap3630()) {
+		mmc[0].gpio_wp = -EINVAL;
+	} else if (system_rev >= 0x20 && system_rev <= 0x34301000) {
 		omap_mux_init_gpio(23, OMAP_PIN_INPUT);
 		mmc[0].gpio_wp = 23;
 	} else {
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 24 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Robert Nelson
Sent: Tuesday, August 10, 2010 8:10 PM
To: [email protected]
Cc: [email protected]; Robert Nelson
Subject: [PATCH] ARM: OMAP: Beagle: support MMC gpio_wp differences on xM

The omap3630 based BeagleBoard xM uses a MicroSD card slot with no write protection.

---
 arch/arm/mach-omap2/board-omap3beagle.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/board-omap3beagle.c +0 -0

omap2/board-omap3beagle.c
index 87969c7..15929be 100644

arch/arm/mach-omap2/board-omap3beagle.c static struct gpio_led gpio_leds[]; · line 190

Quoted 7 lines
arch/arm/mach-omap2/board-omap3beagle.c +3 -1
@@ -185,7 +185,9 @@ static struct gpio_led gpio_leds[];
 static int beagle_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
-	if (system_rev >= 0x20 && system_rev <= 0x34301000) {
+	if (cpu_is_omap3630()) {
+		mmc[0].gpio_wp = -EINVAL;
+	} else if (system_rev >= 0x20 && system_rev <= 0x34301000) {

[Ghorai] it's an old code. But I think we can replace the hardcode value to use omap_rev() as you are changing the same! Or default for all omap34xx?

Quoted 10 lines
arch/arm/mach-omap2/board-omap3beagle.c +0 -1
 		omap_mux_init_gpio(23, OMAP_PIN_INPUT);
 		mmc[0].gpio_wp = 23;
 	} else {
--

1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 5 lines
Quoted 4 lines

-     if (system_rev >= 0x20 && system_rev <= 0x34301000) {
+     if (cpu_is_omap3630()) {
+             mmc[0].gpio_wp = -EINVAL;
+     } else if (system_rev >= 0x20 && system_rev <= 0x34301000) {

[Ghorai] it's an old code. But I think we can replace the hardcode value to use omap_rev() as you are changing the same! Or default for all omap34xx?

It's actually broken too. ;)

My Bx board falls into that "Cx" if.. (and explains why the write-protect lever on my sd card is ignored on that test system)

Looking at mainline u-boot, where system_rev is defined and passed to the kernel, it is a constant 0x20...

I'm going to try using gpio pins 171/172/173 which were used to identify what Beagle Hardware Rev (Ax/Bx, C2/C3, C4, xM)

Quoted 4 lines
Quoted 4 lines

              omap_mux_init_gpio(23, OMAP_PIN_INPUT); mmc[0].gpio_wp = 23;
      } else {

Regards,

Signature · 6 lines
Robert Nelson
http://www.rcn-ee.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html