All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
@ 2011-05-20 10:50 Koen Kooi
  2011-05-20 11:00 ` Koen Kooi
  0 siblings, 1 reply; 12+ messages in thread
From: Koen Kooi @ 2011-05-20 10:50 UTC (permalink / raw)
  To: linux-omap; +Cc: jkridner, Koen Kooi

The USB enable GPIO has been inverted and the USER button moved.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 arch/arm/mach-omap2/board-omap3beagle.c |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 2de4b02..05c5bab 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -62,7 +62,9 @@
  *	AXBX	= GPIO173, GPIO172, GPIO171: 1 1 1
  *	C1_3	= GPIO173, GPIO172, GPIO171: 1 1 0
  *	C4	= GPIO173, GPIO172, GPIO171: 1 0 1
- *	XM	= GPIO173, GPIO172, GPIO171: 0 0 0
+ *	XMA	= GPIO173, GPIO172, GPIO171: 0 0 0
+ *	XMB	= GPIO173, GPIO172, GPIO171: 0 0 1
+ *  XMC = GPIO173, GPIO172, GPIO171: 0 1 0
  */
 enum {
 	OMAP3BEAGLE_BOARD_UNKN = 0,
@@ -70,6 +72,7 @@ enum {
 	OMAP3BEAGLE_BOARD_C1_3,
 	OMAP3BEAGLE_BOARD_C4,
 	OMAP3BEAGLE_BOARD_XM,
+	OMAP3BEAGLE_BOARD_XMC,
 };
 
 static u8 omap3_beagle_version;
@@ -124,9 +127,17 @@ static void __init omap3_beagle_init_rev(void)
 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
 		break;
+	case 1:
+		printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n");
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
+		break;
+	case 2:
+		printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
+		break;
 	default:
-		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
-		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
+		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd, assuming xM C or newer\n", beagle_rev);
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
 	}
 
 	return;
@@ -298,7 +309,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
 	/* REVISIT: need ehci-omap hooks for external VBUS
 	 * power switch and overcurrent detect
 	 */
-	if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
+	if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM && omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMC) {
 		r = gpio_request(gpio + 1, "EHCI_nOC");
 		if (!r) {
 			r = gpio_direction_input(gpio + 1);
@@ -625,7 +636,7 @@ static void __init beagle_opp_init(void)
 	}
 
 	/* Custom OPP enabled for XM */
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM || omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC) {
 		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
 		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
 		struct device *dev;
@@ -665,6 +676,11 @@ static void __init omap3_beagle_init(void)
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap3_beagle_init_rev();
 	omap3_beagle_i2c_init();
+
+	if (cpu_is_omap3630()) {
+		gpio_buttons[0].gpio = 4;
+	}
+
 	platform_add_devices(omap3_beagle_devices,
 			ARRAY_SIZE(omap3_beagle_devices));
 	omap_display_init(&beagle_dss_data);
-- 
1.6.6.1


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

* Re: [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
  2011-05-20 10:50 [PATCH] OMAP3: beagle: add support for beagleboard xM revision C Koen Kooi
@ 2011-05-20 11:00 ` Koen Kooi
  0 siblings, 0 replies; 12+ messages in thread
From: Koen Kooi @ 2011-05-20 11:00 UTC (permalink / raw)
  To: OMAP-KML List; +Cc: Jason Kridner

Drat, I had a git add -i fail, ignore this one.

Op 20 mei 2011, om 12:50 heeft Koen Kooi het volgende geschreven:

> The USB enable GPIO has been inverted and the USER button moved.
> 
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> ---
> arch/arm/mach-omap2/board-omap3beagle.c |   26 +++++++++++++++++++++-----
> 1 files changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index 2de4b02..05c5bab 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -62,7 +62,9 @@
>  *	AXBX	= GPIO173, GPIO172, GPIO171: 1 1 1
>  *	C1_3	= GPIO173, GPIO172, GPIO171: 1 1 0
>  *	C4	= GPIO173, GPIO172, GPIO171: 1 0 1
> - *	XM	= GPIO173, GPIO172, GPIO171: 0 0 0
> + *	XMA	= GPIO173, GPIO172, GPIO171: 0 0 0
> + *	XMB	= GPIO173, GPIO172, GPIO171: 0 0 1
> + *  XMC = GPIO173, GPIO172, GPIO171: 0 1 0
>  */
> enum {
> 	OMAP3BEAGLE_BOARD_UNKN = 0,
> @@ -70,6 +72,7 @@ enum {
> 	OMAP3BEAGLE_BOARD_C1_3,
> 	OMAP3BEAGLE_BOARD_C4,
> 	OMAP3BEAGLE_BOARD_XM,
> +	OMAP3BEAGLE_BOARD_XMC,
> };
> 
> static u8 omap3_beagle_version;
> @@ -124,9 +127,17 @@ static void __init omap3_beagle_init_rev(void)
> 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
> 		break;
> +	case 1:
> +		printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n");
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
> +		break;
> +	case 2:
> +		printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> +		break;
> 	default:
> -		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
> -		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
> +		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd, assuming xM C or newer\n", beagle_rev);
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> 	}
> 
> 	return;
> @@ -298,7 +309,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
> 	/* REVISIT: need ehci-omap hooks for external VBUS
> 	 * power switch and overcurrent detect
> 	 */
> -	if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
> +	if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM && omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMC) {
> 		r = gpio_request(gpio + 1, "EHCI_nOC");
> 		if (!r) {
> 			r = gpio_direction_input(gpio + 1);
> @@ -625,7 +636,7 @@ static void __init beagle_opp_init(void)
> 	}
> 
> 	/* Custom OPP enabled for XM */
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> +	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM || omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC) {
> 		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
> 		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
> 		struct device *dev;
> @@ -665,6 +676,11 @@ static void __init omap3_beagle_init(void)
> 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> 	omap3_beagle_init_rev();
> 	omap3_beagle_i2c_init();
> +
> +	if (cpu_is_omap3630()) {
> +		gpio_buttons[0].gpio = 4;
> +	}
> +
> 	platform_add_devices(omap3_beagle_devices,
> 			ARRAY_SIZE(omap3_beagle_devices));
> 	omap_display_init(&beagle_dss_data);
> -- 
> 1.6.6.1
> 


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

* Re: [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
  2011-05-31 18:13     ` Koen Kooi
@ 2011-06-01  6:43       ` Tony Lindgren
  -1 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2011-06-01  6:43 UTC (permalink / raw)
  To: Koen Kooi
  Cc: linux-omap List, Jason Kridner, linux-arm-kernel, Joel A Fernandes

* Koen Kooi <koen@dominion.thruhere.net> [110531 21:09]:
> 
> Op 30 mei 2011, om 16:34 heeft Tony Lindgren het volgende geschreven:
> 
> > Hi,
> > 
> > * Koen Kooi <koen@dominion.thruhere.net> [110527 06:28]:
> >> 
> >> @@ -123,9 +126,13 @@ static void __init omap3_beagle_init_rev(void)
> >> 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> >> 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
> >> 		break;
> >> +	case 2:
> >> +		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> >> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> >> +		break;
> >> 	default:
> >> 		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
> >> -		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
> >> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> >> 	}
> >> }
> > 
> > Maybe just set up static struct omap3_beagle that contains the
> > various things to initialize. Then initialize it in omap3_beagle_init_rev
> > above.
> > 
> > Otherwise we'll end up adding more and more omap3_beagle_get_rev and
> > cpu_is_omap tests to this file and it will become hard to maintain.
> > 
> >> @@ -253,7 +260,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
> >> {
> >> 	int r, usb_pwr_level;
> >> 
> >> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> >> +	if (cpu_is_omap3630()) {
> >> 		mmc[0].gpio_wp = -EINVAL;
> >> 	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
> >> 		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
> > 
> > This would become:
> > 
> > 	mmc[0].gpio_wp = beagle.gpio_wp;
> > 
> >> @@ -275,11 +282,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
> >> 	 * high / others active low)
> >> 	 * DVI reset GPIO is different between beagle revisions
> >> 	 */
> >> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> >> -		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
> >> +	if (cpu_is_omap3630()) {
> >> 		beagle_dvi_device.reset_gpio = 129;
> >> 		/*
> >> -		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
> >> +		 * gpio + 1 on xM controls the TFP410's enable line (active low)
> >> 		 * gpio + 2 control varies depending on the board rev as below:
> >> 		 * P7/P8 revisions(prototype): Camera EN
> >> 		 * A2+ revisions (production): LDO (DVI, serial, led blocks)
> > 
> > This would be just:
> > 
> > 	usb_pwr_level = beagle.usb_pwr_level;
> > 
> > And so on.
> 
> Tony, thanks for the feedback! The change you want is a bit too much for my C knowledge, but Joel will but picking it up from here.

Hmm, not much there to it actually :) I'm sure you too can do it
little help from Joel.

Tony

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

* [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
@ 2011-06-01  6:43       ` Tony Lindgren
  0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2011-06-01  6:43 UTC (permalink / raw)
  To: linux-arm-kernel

* Koen Kooi <koen@dominion.thruhere.net> [110531 21:09]:
> 
> Op 30 mei 2011, om 16:34 heeft Tony Lindgren het volgende geschreven:
> 
> > Hi,
> > 
> > * Koen Kooi <koen@dominion.thruhere.net> [110527 06:28]:
> >> 
> >> @@ -123,9 +126,13 @@ static void __init omap3_beagle_init_rev(void)
> >> 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> >> 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
> >> 		break;
> >> +	case 2:
> >> +		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> >> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> >> +		break;
> >> 	default:
> >> 		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
> >> -		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
> >> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> >> 	}
> >> }
> > 
> > Maybe just set up static struct omap3_beagle that contains the
> > various things to initialize. Then initialize it in omap3_beagle_init_rev
> > above.
> > 
> > Otherwise we'll end up adding more and more omap3_beagle_get_rev and
> > cpu_is_omap tests to this file and it will become hard to maintain.
> > 
> >> @@ -253,7 +260,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
> >> {
> >> 	int r, usb_pwr_level;
> >> 
> >> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> >> +	if (cpu_is_omap3630()) {
> >> 		mmc[0].gpio_wp = -EINVAL;
> >> 	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
> >> 		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
> > 
> > This would become:
> > 
> > 	mmc[0].gpio_wp = beagle.gpio_wp;
> > 
> >> @@ -275,11 +282,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
> >> 	 * high / others active low)
> >> 	 * DVI reset GPIO is different between beagle revisions
> >> 	 */
> >> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> >> -		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
> >> +	if (cpu_is_omap3630()) {
> >> 		beagle_dvi_device.reset_gpio = 129;
> >> 		/*
> >> -		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
> >> +		 * gpio + 1 on xM controls the TFP410's enable line (active low)
> >> 		 * gpio + 2 control varies depending on the board rev as below:
> >> 		 * P7/P8 revisions(prototype): Camera EN
> >> 		 * A2+ revisions (production): LDO (DVI, serial, led blocks)
> > 
> > This would be just:
> > 
> > 	usb_pwr_level = beagle.usb_pwr_level;
> > 
> > And so on.
> 
> Tony, thanks for the feedback! The change you want is a bit too much for my C knowledge, but Joel will but picking it up from here.

Hmm, not much there to it actually :) I'm sure you too can do it
little help from Joel.

Tony

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

* Re: [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
  2011-05-30 14:34   ` Tony Lindgren
@ 2011-05-31 18:13     ` Koen Kooi
  -1 siblings, 0 replies; 12+ messages in thread
From: Koen Kooi @ 2011-05-31 18:13 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap List, Jason Kridner, linux-arm-kernel, Joel A Fernandes


Op 30 mei 2011, om 16:34 heeft Tony Lindgren het volgende geschreven:

> Hi,
> 
> * Koen Kooi <koen@dominion.thruhere.net> [110527 06:28]:
>> 
>> @@ -123,9 +126,13 @@ static void __init omap3_beagle_init_rev(void)
>> 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
>> 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
>> 		break;
>> +	case 2:
>> +		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
>> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
>> +		break;
>> 	default:
>> 		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
>> -		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
>> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
>> 	}
>> }
> 
> Maybe just set up static struct omap3_beagle that contains the
> various things to initialize. Then initialize it in omap3_beagle_init_rev
> above.
> 
> Otherwise we'll end up adding more and more omap3_beagle_get_rev and
> cpu_is_omap tests to this file and it will become hard to maintain.
> 
>> @@ -253,7 +260,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
>> {
>> 	int r, usb_pwr_level;
>> 
>> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
>> +	if (cpu_is_omap3630()) {
>> 		mmc[0].gpio_wp = -EINVAL;
>> 	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
>> 		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
> 
> This would become:
> 
> 	mmc[0].gpio_wp = beagle.gpio_wp;
> 
>> @@ -275,11 +282,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
>> 	 * high / others active low)
>> 	 * DVI reset GPIO is different between beagle revisions
>> 	 */
>> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
>> -		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
>> +	if (cpu_is_omap3630()) {
>> 		beagle_dvi_device.reset_gpio = 129;
>> 		/*
>> -		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
>> +		 * gpio + 1 on xM controls the TFP410's enable line (active low)
>> 		 * gpio + 2 control varies depending on the board rev as below:
>> 		 * P7/P8 revisions(prototype): Camera EN
>> 		 * A2+ revisions (production): LDO (DVI, serial, led blocks)
> 
> This would be just:
> 
> 	usb_pwr_level = beagle.usb_pwr_level;
> 
> And so on.

Tony, thanks for the feedback! The change you want is a bit too much for my C knowledge, but Joel will but picking it up from here.

regards,

Koen

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

* [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
@ 2011-05-31 18:13     ` Koen Kooi
  0 siblings, 0 replies; 12+ messages in thread
From: Koen Kooi @ 2011-05-31 18:13 UTC (permalink / raw)
  To: linux-arm-kernel


Op 30 mei 2011, om 16:34 heeft Tony Lindgren het volgende geschreven:

> Hi,
> 
> * Koen Kooi <koen@dominion.thruhere.net> [110527 06:28]:
>> 
>> @@ -123,9 +126,13 @@ static void __init omap3_beagle_init_rev(void)
>> 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
>> 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
>> 		break;
>> +	case 2:
>> +		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
>> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
>> +		break;
>> 	default:
>> 		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
>> -		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
>> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
>> 	}
>> }
> 
> Maybe just set up static struct omap3_beagle that contains the
> various things to initialize. Then initialize it in omap3_beagle_init_rev
> above.
> 
> Otherwise we'll end up adding more and more omap3_beagle_get_rev and
> cpu_is_omap tests to this file and it will become hard to maintain.
> 
>> @@ -253,7 +260,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
>> {
>> 	int r, usb_pwr_level;
>> 
>> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
>> +	if (cpu_is_omap3630()) {
>> 		mmc[0].gpio_wp = -EINVAL;
>> 	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
>> 		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
> 
> This would become:
> 
> 	mmc[0].gpio_wp = beagle.gpio_wp;
> 
>> @@ -275,11 +282,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
>> 	 * high / others active low)
>> 	 * DVI reset GPIO is different between beagle revisions
>> 	 */
>> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
>> -		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
>> +	if (cpu_is_omap3630()) {
>> 		beagle_dvi_device.reset_gpio = 129;
>> 		/*
>> -		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
>> +		 * gpio + 1 on xM controls the TFP410's enable line (active low)
>> 		 * gpio + 2 control varies depending on the board rev as below:
>> 		 * P7/P8 revisions(prototype): Camera EN
>> 		 * A2+ revisions (production): LDO (DVI, serial, led blocks)
> 
> This would be just:
> 
> 	usb_pwr_level = beagle.usb_pwr_level;
> 
> And so on.

Tony, thanks for the feedback! The change you want is a bit too much for my C knowledge, but Joel will but picking it up from here.

regards,

Koen

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

* Re: [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
  2011-05-27 13:32 ` Koen Kooi
@ 2011-05-30 14:34   ` Tony Lindgren
  -1 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2011-05-30 14:34 UTC (permalink / raw)
  To: Koen Kooi; +Cc: linux-omap, jkridner, linux-arm-kernel

Hi,

* Koen Kooi <koen@dominion.thruhere.net> [110527 06:28]:
>
> @@ -123,9 +126,13 @@ static void __init omap3_beagle_init_rev(void)
>  		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
>  		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
>  		break;
> +	case 2:
> +		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> +		break;
>  	default:
>  		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
> -		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
>  	}
>  }

Maybe just set up static struct omap3_beagle that contains the
various things to initialize. Then initialize it in omap3_beagle_init_rev
above.

Otherwise we'll end up adding more and more omap3_beagle_get_rev and
cpu_is_omap tests to this file and it will become hard to maintain.
  
> @@ -253,7 +260,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
>  {
>  	int r, usb_pwr_level;
>  
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> +	if (cpu_is_omap3630()) {
>  		mmc[0].gpio_wp = -EINVAL;
>  	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
>  		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {

This would become:

	mmc[0].gpio_wp = beagle.gpio_wp;

> @@ -275,11 +282,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
>  	 * high / others active low)
>  	 * DVI reset GPIO is different between beagle revisions
>  	 */
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> -		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
> +	if (cpu_is_omap3630()) {
>  		beagle_dvi_device.reset_gpio = 129;
>  		/*
> -		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
> +		 * gpio + 1 on xM controls the TFP410's enable line (active low)
>  		 * gpio + 2 control varies depending on the board rev as below:
>  		 * P7/P8 revisions(prototype): Camera EN
>  		 * A2+ revisions (production): LDO (DVI, serial, led blocks)

This would be just:

	usb_pwr_level = beagle.usb_pwr_level;

And so on.

Regards,

Tony

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

* [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
@ 2011-05-30 14:34   ` Tony Lindgren
  0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2011-05-30 14:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

* Koen Kooi <koen@dominion.thruhere.net> [110527 06:28]:
>
> @@ -123,9 +126,13 @@ static void __init omap3_beagle_init_rev(void)
>  		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
>  		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
>  		break;
> +	case 2:
> +		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> +		break;
>  	default:
>  		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
> -		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
>  	}
>  }

Maybe just set up static struct omap3_beagle that contains the
various things to initialize. Then initialize it in omap3_beagle_init_rev
above.

Otherwise we'll end up adding more and more omap3_beagle_get_rev and
cpu_is_omap tests to this file and it will become hard to maintain.
  
> @@ -253,7 +260,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
>  {
>  	int r, usb_pwr_level;
>  
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> +	if (cpu_is_omap3630()) {
>  		mmc[0].gpio_wp = -EINVAL;
>  	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
>  		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {

This would become:

	mmc[0].gpio_wp = beagle.gpio_wp;

> @@ -275,11 +282,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
>  	 * high / others active low)
>  	 * DVI reset GPIO is different between beagle revisions
>  	 */
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> -		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
> +	if (cpu_is_omap3630()) {
>  		beagle_dvi_device.reset_gpio = 129;
>  		/*
> -		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
> +		 * gpio + 1 on xM controls the TFP410's enable line (active low)
>  		 * gpio + 2 control varies depending on the board rev as below:
>  		 * P7/P8 revisions(prototype): Camera EN
>  		 * A2+ revisions (production): LDO (DVI, serial, led blocks)

This would be just:

	usb_pwr_level = beagle.usb_pwr_level;

And so on.

Regards,

Tony

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

* Re: [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
  2011-05-27 13:32 ` Koen Kooi
@ 2011-05-27 13:33   ` Koen Kooi
  -1 siblings, 0 replies; 12+ messages in thread
From: Koen Kooi @ 2011-05-27 13:33 UTC (permalink / raw)
  To: OMAP-KML List; +Cc: Jason Kridner, Tony Lindgren, l-a

That was meant to say '[PATCH v3]', sorry about that.

Op 27 mei 2011, om 15:32 heeft Koen Kooi het volgende geschreven:

> The USB enable GPIO has been inverted again and the USER button moved
> 
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> ---
> Changes since v2:
>    * fixed indentation error checkpatch missed
> 
> Changes since v1:
>    * updated against mainline to take Igors gpio cleanup into account
>    * removed xM rev B checks, no boards with that ID were ever produced, rev B boards show up as rev A
>    * double checked whitespace:
> 
>        total: 0 errors, 0 warnings, 89 lines checked
>        patches/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch has no obvious style problems and is ready for submission.
> 
> arch/arm/mach-omap2/board-omap3beagle.c |   31 +++++++++++++++++++++++--------
> 1 files changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index be71426..81fff9d 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -63,7 +63,9 @@
>  *	AXBX	= GPIO173, GPIO172, GPIO171: 1 1 1
>  *	C1_3	= GPIO173, GPIO172, GPIO171: 1 1 0
>  *	C4	= GPIO173, GPIO172, GPIO171: 1 0 1
> - *	XM	= GPIO173, GPIO172, GPIO171: 0 0 0
> + *	XMA	= GPIO173, GPIO172, GPIO171: 0 0 0
> + *	XMB	= GPIO173, GPIO172, GPIO171: 0 0 1 - unused
> + *	XMC = GPIO173, GPIO172, GPIO171: 0 1 0
>  */
> enum {
> 	OMAP3BEAGLE_BOARD_UNKN = 0,
> @@ -71,6 +73,7 @@ enum {
> 	OMAP3BEAGLE_BOARD_C1_3,
> 	OMAP3BEAGLE_BOARD_C4,
> 	OMAP3BEAGLE_BOARD_XM,
> +	OMAP3BEAGLE_BOARD_XMC,
> };
> 
> static u8 omap3_beagle_version;
> @@ -123,9 +126,13 @@ static void __init omap3_beagle_init_rev(void)
> 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
> 		break;
> +	case 2:
> +		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> +		break;
> 	default:
> 		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
> -		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> 	}
> }
> 
> @@ -253,7 +260,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
> {
> 	int r, usb_pwr_level;
> 
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> +	if (cpu_is_omap3630()) {
> 		mmc[0].gpio_wp = -EINVAL;
> 	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
> 		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
> @@ -275,11 +282,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
> 	 * high / others active low)
> 	 * DVI reset GPIO is different between beagle revisions
> 	 */
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> -		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
> +	if (cpu_is_omap3630()) {
> 		beagle_dvi_device.reset_gpio = 129;
> 		/*
> -		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
> +		 * gpio + 1 on xM controls the TFP410's enable line (active low)
> 		 * gpio + 2 control varies depending on the board rev as below:
> 		 * P7/P8 revisions(prototype): Camera EN
> 		 * A2+ revisions (production): LDO (DVI, serial, led blocks)
> @@ -295,7 +301,6 @@ static int beagle_twl_gpio_setup(struct device *dev,
> 			pr_err("%s: unable to configure DVI_LDO_EN\n",
> 				__func__);
> 	} else {
> -		usb_pwr_level = GPIOF_OUT_INIT_LOW;
> 		beagle_dvi_device.reset_gpio = 170;
> 		/*
> 		 * REVISIT: need ehci-omap hooks for external VBUS
> @@ -305,6 +310,12 @@ static int beagle_twl_gpio_setup(struct device *dev,
> 			pr_err("%s: unable to configure EHCI_nOC\n", __func__);
> 	}
> 
> +	/* Only xM rev A and xM rev B use active high */
> +	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
> +		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
> +	else
> +		usb_pwr_level = GPIOF_OUT_INIT_LOW;
> +
> 	gpio_request_one(gpio + TWL4030_GPIO_MAX, usb_pwr_level, "nEN_USB_PWR");
> 
> 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
> @@ -525,7 +536,7 @@ static void __init beagle_opp_init(void)
> 	}
> 
> 	/* Custom OPP enabled for XM */
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> +	if (cpu_is_omap3630()) {
> 		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
> 		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
> 		struct device *dev;
> @@ -565,6 +576,10 @@ static void __init omap3_beagle_init(void)
> 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> 	omap3_beagle_init_rev();
> 	omap3_beagle_i2c_init();
> +
> +	if (cpu_is_omap3630())
> +		gpio_buttons[0].gpio = 4;
> +
> 	platform_add_devices(omap3_beagle_devices,
> 			ARRAY_SIZE(omap3_beagle_devices));
> 	omap_display_init(&beagle_dss_data);
> -- 
> 1.6.6.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
@ 2011-05-27 13:33   ` Koen Kooi
  0 siblings, 0 replies; 12+ messages in thread
From: Koen Kooi @ 2011-05-27 13:33 UTC (permalink / raw)
  To: linux-arm-kernel

That was meant to say '[PATCH v3]', sorry about that.

Op 27 mei 2011, om 15:32 heeft Koen Kooi het volgende geschreven:

> The USB enable GPIO has been inverted again and the USER button moved
> 
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> ---
> Changes since v2:
>    * fixed indentation error checkpatch missed
> 
> Changes since v1:
>    * updated against mainline to take Igors gpio cleanup into account
>    * removed xM rev B checks, no boards with that ID were ever produced, rev B boards show up as rev A
>    * double checked whitespace:
> 
>        total: 0 errors, 0 warnings, 89 lines checked
>        patches/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch has no obvious style problems and is ready for submission.
> 
> arch/arm/mach-omap2/board-omap3beagle.c |   31 +++++++++++++++++++++++--------
> 1 files changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index be71426..81fff9d 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -63,7 +63,9 @@
>  *	AXBX	= GPIO173, GPIO172, GPIO171: 1 1 1
>  *	C1_3	= GPIO173, GPIO172, GPIO171: 1 1 0
>  *	C4	= GPIO173, GPIO172, GPIO171: 1 0 1
> - *	XM	= GPIO173, GPIO172, GPIO171: 0 0 0
> + *	XMA	= GPIO173, GPIO172, GPIO171: 0 0 0
> + *	XMB	= GPIO173, GPIO172, GPIO171: 0 0 1 - unused
> + *	XMC = GPIO173, GPIO172, GPIO171: 0 1 0
>  */
> enum {
> 	OMAP3BEAGLE_BOARD_UNKN = 0,
> @@ -71,6 +73,7 @@ enum {
> 	OMAP3BEAGLE_BOARD_C1_3,
> 	OMAP3BEAGLE_BOARD_C4,
> 	OMAP3BEAGLE_BOARD_XM,
> +	OMAP3BEAGLE_BOARD_XMC,
> };
> 
> static u8 omap3_beagle_version;
> @@ -123,9 +126,13 @@ static void __init omap3_beagle_init_rev(void)
> 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
> 		break;
> +	case 2:
> +		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> +		break;
> 	default:
> 		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
> -		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
> +		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
> 	}
> }
> 
> @@ -253,7 +260,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
> {
> 	int r, usb_pwr_level;
> 
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> +	if (cpu_is_omap3630()) {
> 		mmc[0].gpio_wp = -EINVAL;
> 	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
> 		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
> @@ -275,11 +282,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
> 	 * high / others active low)
> 	 * DVI reset GPIO is different between beagle revisions
> 	 */
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> -		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
> +	if (cpu_is_omap3630()) {
> 		beagle_dvi_device.reset_gpio = 129;
> 		/*
> -		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
> +		 * gpio + 1 on xM controls the TFP410's enable line (active low)
> 		 * gpio + 2 control varies depending on the board rev as below:
> 		 * P7/P8 revisions(prototype): Camera EN
> 		 * A2+ revisions (production): LDO (DVI, serial, led blocks)
> @@ -295,7 +301,6 @@ static int beagle_twl_gpio_setup(struct device *dev,
> 			pr_err("%s: unable to configure DVI_LDO_EN\n",
> 				__func__);
> 	} else {
> -		usb_pwr_level = GPIOF_OUT_INIT_LOW;
> 		beagle_dvi_device.reset_gpio = 170;
> 		/*
> 		 * REVISIT: need ehci-omap hooks for external VBUS
> @@ -305,6 +310,12 @@ static int beagle_twl_gpio_setup(struct device *dev,
> 			pr_err("%s: unable to configure EHCI_nOC\n", __func__);
> 	}
> 
> +	/* Only xM rev A and xM rev B use active high */
> +	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
> +		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
> +	else
> +		usb_pwr_level = GPIOF_OUT_INIT_LOW;
> +
> 	gpio_request_one(gpio + TWL4030_GPIO_MAX, usb_pwr_level, "nEN_USB_PWR");
> 
> 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
> @@ -525,7 +536,7 @@ static void __init beagle_opp_init(void)
> 	}
> 
> 	/* Custom OPP enabled for XM */
> -	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
> +	if (cpu_is_omap3630()) {
> 		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
> 		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
> 		struct device *dev;
> @@ -565,6 +576,10 @@ static void __init omap3_beagle_init(void)
> 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> 	omap3_beagle_init_rev();
> 	omap3_beagle_i2c_init();
> +
> +	if (cpu_is_omap3630())
> +		gpio_buttons[0].gpio = 4;
> +
> 	platform_add_devices(omap3_beagle_devices,
> 			ARRAY_SIZE(omap3_beagle_devices));
> 	omap_display_init(&beagle_dss_data);
> -- 
> 1.6.6.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
@ 2011-05-27 13:32 ` Koen Kooi
  0 siblings, 0 replies; 12+ messages in thread
From: Koen Kooi @ 2011-05-27 13:32 UTC (permalink / raw)
  To: linux-omap; +Cc: jkridner, linux-arm-kernel, tony, Koen Kooi

The USB enable GPIO has been inverted again and the USER button moved

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
Changes since v2:
    * fixed indentation error checkpatch missed

Changes since v1:
    * updated against mainline to take Igors gpio cleanup into account
    * removed xM rev B checks, no boards with that ID were ever produced, rev B boards show up as rev A
    * double checked whitespace:

        total: 0 errors, 0 warnings, 89 lines checked
        patches/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch has no obvious style problems and is ready for submission.

 arch/arm/mach-omap2/board-omap3beagle.c |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index be71426..81fff9d 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -63,7 +63,9 @@
  *	AXBX	= GPIO173, GPIO172, GPIO171: 1 1 1
  *	C1_3	= GPIO173, GPIO172, GPIO171: 1 1 0
  *	C4	= GPIO173, GPIO172, GPIO171: 1 0 1
- *	XM	= GPIO173, GPIO172, GPIO171: 0 0 0
+ *	XMA	= GPIO173, GPIO172, GPIO171: 0 0 0
+ *	XMB	= GPIO173, GPIO172, GPIO171: 0 0 1 - unused
+ *	XMC = GPIO173, GPIO172, GPIO171: 0 1 0
  */
 enum {
 	OMAP3BEAGLE_BOARD_UNKN = 0,
@@ -71,6 +73,7 @@ enum {
 	OMAP3BEAGLE_BOARD_C1_3,
 	OMAP3BEAGLE_BOARD_C4,
 	OMAP3BEAGLE_BOARD_XM,
+	OMAP3BEAGLE_BOARD_XMC,
 };
 
 static u8 omap3_beagle_version;
@@ -123,9 +126,13 @@ static void __init omap3_beagle_init_rev(void)
 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
 		break;
+	case 2:
+		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
+		break;
 	default:
 		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
-		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
 	}
 }
 
@@ -253,7 +260,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
 {
 	int r, usb_pwr_level;
 
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+	if (cpu_is_omap3630()) {
 		mmc[0].gpio_wp = -EINVAL;
 	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
 		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
@@ -275,11 +282,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
 	 * high / others active low)
 	 * DVI reset GPIO is different between beagle revisions
 	 */
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
-		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
+	if (cpu_is_omap3630()) {
 		beagle_dvi_device.reset_gpio = 129;
 		/*
-		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
+		 * gpio + 1 on xM controls the TFP410's enable line (active low)
 		 * gpio + 2 control varies depending on the board rev as below:
 		 * P7/P8 revisions(prototype): Camera EN
 		 * A2+ revisions (production): LDO (DVI, serial, led blocks)
@@ -295,7 +301,6 @@ static int beagle_twl_gpio_setup(struct device *dev,
 			pr_err("%s: unable to configure DVI_LDO_EN\n",
 				__func__);
 	} else {
-		usb_pwr_level = GPIOF_OUT_INIT_LOW;
 		beagle_dvi_device.reset_gpio = 170;
 		/*
 		 * REVISIT: need ehci-omap hooks for external VBUS
@@ -305,6 +310,12 @@ static int beagle_twl_gpio_setup(struct device *dev,
 			pr_err("%s: unable to configure EHCI_nOC\n", __func__);
 	}
 
+	/* Only xM rev A and xM rev B use active high */
+	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
+		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
+	else
+		usb_pwr_level = GPIOF_OUT_INIT_LOW;
+
 	gpio_request_one(gpio + TWL4030_GPIO_MAX, usb_pwr_level, "nEN_USB_PWR");
 
 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
@@ -525,7 +536,7 @@ static void __init beagle_opp_init(void)
 	}
 
 	/* Custom OPP enabled for XM */
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+	if (cpu_is_omap3630()) {
 		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
 		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
 		struct device *dev;
@@ -565,6 +576,10 @@ static void __init omap3_beagle_init(void)
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap3_beagle_init_rev();
 	omap3_beagle_i2c_init();
+
+	if (cpu_is_omap3630())
+		gpio_buttons[0].gpio = 4;
+
 	platform_add_devices(omap3_beagle_devices,
 			ARRAY_SIZE(omap3_beagle_devices));
 	omap_display_init(&beagle_dss_data);
-- 
1.6.6.1


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

* [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
@ 2011-05-27 13:32 ` Koen Kooi
  0 siblings, 0 replies; 12+ messages in thread
From: Koen Kooi @ 2011-05-27 13:32 UTC (permalink / raw)
  To: linux-arm-kernel

The USB enable GPIO has been inverted again and the USER button moved

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
Changes since v2:
    * fixed indentation error checkpatch missed

Changes since v1:
    * updated against mainline to take Igors gpio cleanup into account
    * removed xM rev B checks, no boards with that ID were ever produced, rev B boards show up as rev A
    * double checked whitespace:

        total: 0 errors, 0 warnings, 89 lines checked
        patches/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch has no obvious style problems and is ready for submission.

 arch/arm/mach-omap2/board-omap3beagle.c |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index be71426..81fff9d 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -63,7 +63,9 @@
  *	AXBX	= GPIO173, GPIO172, GPIO171: 1 1 1
  *	C1_3	= GPIO173, GPIO172, GPIO171: 1 1 0
  *	C4	= GPIO173, GPIO172, GPIO171: 1 0 1
- *	XM	= GPIO173, GPIO172, GPIO171: 0 0 0
+ *	XMA	= GPIO173, GPIO172, GPIO171: 0 0 0
+ *	XMB	= GPIO173, GPIO172, GPIO171: 0 0 1 - unused
+ *	XMC = GPIO173, GPIO172, GPIO171: 0 1 0
  */
 enum {
 	OMAP3BEAGLE_BOARD_UNKN = 0,
@@ -71,6 +73,7 @@ enum {
 	OMAP3BEAGLE_BOARD_C1_3,
 	OMAP3BEAGLE_BOARD_C4,
 	OMAP3BEAGLE_BOARD_XM,
+	OMAP3BEAGLE_BOARD_XMC,
 };
 
 static u8 omap3_beagle_version;
@@ -123,9 +126,13 @@ static void __init omap3_beagle_init_rev(void)
 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
 		break;
+	case 2:
+		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
+		break;
 	default:
 		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
-		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
 	}
 }
 
@@ -253,7 +260,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
 {
 	int r, usb_pwr_level;
 
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+	if (cpu_is_omap3630()) {
 		mmc[0].gpio_wp = -EINVAL;
 	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
 		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
@@ -275,11 +282,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
 	 * high / others active low)
 	 * DVI reset GPIO is different between beagle revisions
 	 */
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
-		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
+	if (cpu_is_omap3630()) {
 		beagle_dvi_device.reset_gpio = 129;
 		/*
-		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
+		 * gpio + 1 on xM controls the TFP410's enable line (active low)
 		 * gpio + 2 control varies depending on the board rev as below:
 		 * P7/P8 revisions(prototype): Camera EN
 		 * A2+ revisions (production): LDO (DVI, serial, led blocks)
@@ -295,7 +301,6 @@ static int beagle_twl_gpio_setup(struct device *dev,
 			pr_err("%s: unable to configure DVI_LDO_EN\n",
 				__func__);
 	} else {
-		usb_pwr_level = GPIOF_OUT_INIT_LOW;
 		beagle_dvi_device.reset_gpio = 170;
 		/*
 		 * REVISIT: need ehci-omap hooks for external VBUS
@@ -305,6 +310,12 @@ static int beagle_twl_gpio_setup(struct device *dev,
 			pr_err("%s: unable to configure EHCI_nOC\n", __func__);
 	}
 
+	/* Only xM rev A and xM rev B use active high */
+	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
+		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
+	else
+		usb_pwr_level = GPIOF_OUT_INIT_LOW;
+
 	gpio_request_one(gpio + TWL4030_GPIO_MAX, usb_pwr_level, "nEN_USB_PWR");
 
 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
@@ -525,7 +536,7 @@ static void __init beagle_opp_init(void)
 	}
 
 	/* Custom OPP enabled for XM */
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+	if (cpu_is_omap3630()) {
 		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
 		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
 		struct device *dev;
@@ -565,6 +576,10 @@ static void __init omap3_beagle_init(void)
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap3_beagle_init_rev();
 	omap3_beagle_i2c_init();
+
+	if (cpu_is_omap3630())
+		gpio_buttons[0].gpio = 4;
+
 	platform_add_devices(omap3_beagle_devices,
 			ARRAY_SIZE(omap3_beagle_devices));
 	omap_display_init(&beagle_dss_data);
-- 
1.6.6.1

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

end of thread, other threads:[~2011-06-01  6:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20 10:50 [PATCH] OMAP3: beagle: add support for beagleboard xM revision C Koen Kooi
2011-05-20 11:00 ` Koen Kooi
2011-05-27 13:32 Koen Kooi
2011-05-27 13:32 ` Koen Kooi
2011-05-27 13:33 ` Koen Kooi
2011-05-27 13:33   ` Koen Kooi
2011-05-30 14:34 ` Tony Lindgren
2011-05-30 14:34   ` Tony Lindgren
2011-05-31 18:13   ` Koen Kooi
2011-05-31 18:13     ` Koen Kooi
2011-06-01  6:43     ` Tony Lindgren
2011-06-01  6:43       ` Tony Lindgren

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.