aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2011-03-16 20:57:29 +0100
committerKoen Kooi <koen@openembedded.org>2011-03-16 21:01:01 +0100
commitee0409425e05bb1a7bbba830c38ed3921493febe (patch)
tree50c7fc7832ca7cda48eff443c043211f3f3a9077
parente41ded5f413fdc54a526795c2a202484c2796b84 (diff)
downloadopenembedded-ee0409425e05bb1a7bbba830c38ed3921493febe.tar.gz
linux-omap-psp 2.6.32: add support for xM revision C
Signed-off-by: Koen Kooi <koen@openembedded.org>
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0001-omap-Beagle-revision-detection.patch135
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0002-omap-Beagle-only-Cx-boards-use-pin-23-for-write-prot.patch35
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0003-omap-Beagle-no-gpio_wp-pin-connection-on-xM.patch33
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0004-omap3-beaglexm-fix-EHCI-power-up-GPIO-dir.patch42
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0005-omap3-beaglexm-fix-DVI-reset-GPIO.patch48
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0006-omap3-beaglexm-fix-power-on-of-DVI.patch92
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0007-beagleboard-hack-in-support-from-xM-rev-C.patch61
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0008-omap3-beagle-cleaned-up-board-revision-conditions.patch153
-rw-r--r--recipes/linux/linux-omap-psp_2.6.32.bb8
9 files changed, 607 insertions, 0 deletions
diff --git a/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0001-omap-Beagle-revision-detection.patch b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0001-omap-Beagle-revision-detection.patch
new file mode 100644
index 0000000000..f29c9a6d1c
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0001-omap-Beagle-revision-detection.patch
@@ -0,0 +1,135 @@
+From 325afc09116e11e28265b648ef33d8c0306c61f1 Mon Sep 17 00:00:00 2001
+From: Robert Nelson <robertcnelson@gmail.com>
+Date: Thu, 23 Sep 2010 18:22:47 -0700
+Subject: [PATCH 01/10] omap: Beagle: revision detection
+
+Due to the omap3530 ES3.0 Silicon being used on both the
+B5/B6 and C1/2/3 Beagle we can't use the cpu_is_omap34xx()
+routines to differentiate the Beagle Boards.
+
+However gpio pins 171,172,173 where setup for this prupose, so
+lets use them.
+
+Changes:
+for older U-Boot's, use omap_mux_init_gpio()
+keep Beagle Rev in board-omap3beagle.c
+gpio_free on gpio request failure
+
+Tested on Beagle Revisions: B5, C2, C4, and xMA
+
+Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
+Acked-by: Jarkko Nikula <jhnikula@gmail.com>
+Signed-off-by: Tony Lindgren <tony@atomide.com>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 88 +++++++++++++++++++++++++++++++
+ 1 files changed, 88 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 2677b41..7ca2b3b 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -175,6 +175,93 @@ static void __init omap3beagle_ks8851_init(void)
+ static inline void __init omap3beagle_ks8851_init(void) { return; }
+ #endif
+
++/*
++ * OMAP3 Beagle revision
++ * Run time detection of Beagle revision is done by reading GPIO.
++ * GPIO ID -
++ * 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
++ */
++enum {
++ OMAP3BEAGLE_BOARD_UNKN = 0,
++ OMAP3BEAGLE_BOARD_AXBX,
++ OMAP3BEAGLE_BOARD_C1_3,
++ OMAP3BEAGLE_BOARD_C4,
++ OMAP3BEAGLE_BOARD_XM,
++};
++
++static u8 omap3_beagle_version;
++
++static u8 omap3_beagle_get_rev(void)
++{
++ return omap3_beagle_version;
++}
++
++static void __init omap3_beagle_init_rev(void)
++{
++ int ret;
++ u16 beagle_rev = 0;
++
++ omap_mux_init_gpio(171, OMAP_PIN_INPUT_PULLUP);
++ omap_mux_init_gpio(172, OMAP_PIN_INPUT_PULLUP);
++ omap_mux_init_gpio(173, OMAP_PIN_INPUT_PULLUP);
++
++ ret = gpio_request(171, "rev_id_0");
++ if (ret < 0)
++ goto fail0;
++
++ ret = gpio_request(172, "rev_id_1");
++ if (ret < 0)
++ goto fail1;
++
++ ret = gpio_request(173, "rev_id_2");
++ if (ret < 0)
++ goto fail2;
++
++ gpio_direction_input(171);
++ gpio_direction_input(172);
++ gpio_direction_input(173);
++
++ beagle_rev = gpio_get_value(171) | (gpio_get_value(172) << 1)
++ | (gpio_get_value(173) << 2);
++
++ switch (beagle_rev) {
++ case 7:
++ printk(KERN_INFO "OMAP3 Beagle Rev: Ax/Bx\n");
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_AXBX;
++ break;
++ case 6:
++ printk(KERN_INFO "OMAP3 Beagle Rev: C1/C2/C3\n");
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_C1_3;
++ break;
++ case 5:
++ printk(KERN_INFO "OMAP3 Beagle Rev: C4\n");
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_C4;
++ break;
++ case 0:
++ printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
++ break;
++ default:
++ printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
++ }
++
++ return;
++
++fail2:
++ gpio_free(172);
++fail1:
++ gpio_free(171);
++fail0:
++ printk(KERN_ERR "Unable to get revision detection GPIO pins\n");
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
++
++ return;
++}
++
+ static struct mtd_partition omap3beagle_nand_partitions[] = {
+ /* All the partition sizes are listed in terms of NAND block size */
+ {
+@@ -853,6 +940,7 @@ static int __init cameraboard_setup(char *str)
+ 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()) {
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0002-omap-Beagle-only-Cx-boards-use-pin-23-for-write-prot.patch b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0002-omap-Beagle-only-Cx-boards-use-pin-23-for-write-prot.patch
new file mode 100644
index 0000000000..f8512867ee
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0002-omap-Beagle-only-Cx-boards-use-pin-23-for-write-prot.patch
@@ -0,0 +1,35 @@
+From 34d88746a9aa4aedb67e32579e559cbeb91de20f Mon Sep 17 00:00:00 2001
+From: Robert Nelson <robertcnelson@gmail.com>
+Date: Thu, 23 Sep 2010 18:22:48 -0700
+Subject: [PATCH 02/10] omap: Beagle: only Cx boards use pin 23 for write protect
+
+system_rev comes from u-boot and is a constant 0x20, so
+Bx boards also fall in this 'if' and will get setup with the
+wrong gpio_wp pin. Switch to using the Beagle revision routine
+to correcly set pin 23 only for C1/2/3 and C4 Boards. Bx boards
+will then use the correct default pin setting.
+
+Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
+Acked-by: Jarkko Nikula <jhnikula@gmail.com>
+Signed-off-by: Tony Lindgren <tony@atomide.com>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 7ca2b3b..beb877c 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -444,7 +444,8 @@ 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 ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
++ (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
+ omap_mux_init_gpio(23, OMAP_PIN_INPUT);
+ mmc[0].gpio_wp = 23;
+ } else {
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0003-omap-Beagle-no-gpio_wp-pin-connection-on-xM.patch b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0003-omap-Beagle-no-gpio_wp-pin-connection-on-xM.patch
new file mode 100644
index 0000000000..d7d3fefed4
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0003-omap-Beagle-no-gpio_wp-pin-connection-on-xM.patch
@@ -0,0 +1,33 @@
+From 037ef3add42d61dcd86438dc4b9378f154caa426 Mon Sep 17 00:00:00 2001
+From: Robert Nelson <robertcnelson@gmail.com>
+Date: Thu, 23 Sep 2010 18:22:48 -0700
+Subject: [PATCH 03/10] omap: Beagle: no gpio_wp pin connection on xM
+
+The omap3630 based BeagleBoard xM uses a MicroSD card slot with
+no write protection.
+
+Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
+Acked-by: Jarkko Nikula <jhnikula@gmail.com>
+Signed-off-by: Tony Lindgren <tony@atomide.com>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index beb877c..247a426 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -444,7 +444,9 @@ static struct gpio_led gpio_leds[];
+ static int beagle_twl_gpio_setup(struct device *dev,
+ unsigned gpio, unsigned ngpio)
+ {
+- if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
++ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
++ mmc[0].gpio_wp = -EINVAL;
++ } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
+ (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
+ omap_mux_init_gpio(23, OMAP_PIN_INPUT);
+ mmc[0].gpio_wp = 23;
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0004-omap3-beaglexm-fix-EHCI-power-up-GPIO-dir.patch b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0004-omap3-beaglexm-fix-EHCI-power-up-GPIO-dir.patch
new file mode 100644
index 0000000000..e646d3ebae
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0004-omap3-beaglexm-fix-EHCI-power-up-GPIO-dir.patch
@@ -0,0 +1,42 @@
+From 62db06de896c221cfa2231a53a933d6b3e81d66d Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@beagleboard.org>
+Date: Tue, 11 Jan 2011 17:13:35 +0000
+Subject: [PATCH 04/10] omap3: beaglexm: fix EHCI power up GPIO dir
+
+EHCI enable power pin is inverted (active high) in comparison
+to vanilla beagle which is active low. Handle this case conditionally.
+
+Without this fix, Beagle XM 4 port EHCI will not function and no
+networking will be available
+
+[nm@ti.com: split up, added descriptive changelogs]
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Koen Kooi <koen@beagleboard.org>
+Signed-off-by: Tony Lindgren <tony@atomide.com>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 247a426..7cfa2c8 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -487,6 +487,15 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+ }
+
++ /*
++ * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
++ * high / others active low)
++ */
++ gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
++ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
++ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
++ else
++ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+
+ /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0005-omap3-beaglexm-fix-DVI-reset-GPIO.patch b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0005-omap3-beaglexm-fix-DVI-reset-GPIO.patch
new file mode 100644
index 0000000000..6e6ab41b36
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0005-omap3-beaglexm-fix-DVI-reset-GPIO.patch
@@ -0,0 +1,48 @@
+From 3d93d0b8974c867db70cb4a8681615113ac6113d Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@beagleboard.org>
+Date: Tue, 11 Jan 2011 17:13:36 +0000
+Subject: [PATCH 05/10] omap3: beaglexm: fix DVI reset GPIO
+
+GPIO reset line for Beagle XM is different from vanilla beagle
+so we populate it as part of gpio update routine.
+
+This in part fixes the issue of display not functioning on beagle XM
+platform.
+
+[nm@ti.com: split up, added descriptive changelogs]
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Koen Kooi <koen@beagleboard.org>
+Signed-off-by: Tony Lindgren <tony@atomide.com>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 7cfa2c8..939de5a 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -336,7 +336,7 @@ static struct omap_dss_device beagle_dvi_device = {
+ .name = "dvi",
+ .driver_name = "generic_panel",
+ .phy.dpi.data_lines = 24,
+- .reset_gpio = 170,
++ .reset_gpio = -EINVAL,
+ .platform_enable = beagle_enable_dvi,
+ .platform_disable = beagle_disable_dvi,
+ };
+@@ -497,6 +497,12 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ else
+ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+
++ /* DVI reset GPIO is different between beagle revisions */
++ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
++ beagle_dvi_device.reset_gpio = 129;
++ else
++ beagle_dvi_device.reset_gpio = 170;
++
+ /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0006-omap3-beaglexm-fix-power-on-of-DVI.patch b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0006-omap3-beaglexm-fix-power-on-of-DVI.patch
new file mode 100644
index 0000000000..ba74284b90
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0006-omap3-beaglexm-fix-power-on-of-DVI.patch
@@ -0,0 +1,92 @@
+From 7ad849e3d54d897614a74ad225392bd243e07d2e Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@beagleboard.org>
+Date: Wed, 12 Jan 2011 00:23:29 +0000
+Subject: [PATCH 06/10] omap3: beaglexm: fix power on of DVI
+
+TFP410 DVI chip is used to provide display out.
+This chip is controlled by 2 lines:
+LDO which supplies the power is controlled over gpio + 2
+and the enable of the chip itself is done over gpio + 1
+NOTE: the LDO is necessary for LED, serial blocks as well.
+
+gpio + 1 was used to sense USB overcurrent in vanilla beagle.
+
+Without this fix, the display would not function as the LDO
+remains shut down.
+
+[nm@ti.com: split up, added descriptive changelogs]
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Koen Kooi <koen@beagleboard.org>
+Signed-off-by: Tony Lindgren <tony@atomide.com>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 40 +++++++++++++++++++++++++++++++
+ 1 files changed, 40 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 939de5a..9880c5c 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -444,6 +444,8 @@ static struct gpio_led gpio_leds[];
+ static int beagle_twl_gpio_setup(struct device *dev,
+ unsigned gpio, unsigned ngpio)
+ {
++ int r;
++
+ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+ mmc[0].gpio_wp = -EINVAL;
+ } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
+@@ -465,6 +467,17 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ * power switch and overcurrent detect
+ */
+
++ if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
++ r = gpio_request(gpio + 1, "EHCI_nOC");
++ if (!r) {
++ r = gpio_direction_input(gpio + 1);
++ if (r)
++ gpio_free(gpio + 1);
++ }
++ if (r)
++ pr_err("%s: unable to configure EHCI_nOC\n", __func__);
++ }
++
+ if (cpu_is_omap3630()) {
+ /* Power on DVI, Serial and PWR led */
+ gpio_request(gpio + 1, "nDVI_PWR_EN");
+@@ -506,6 +519,33 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+
++ /*
++ * gpio + 1 on Xm controls the TFP410's enable line (active low)
++ * gpio + 2 control varies depending on the board rev as follows:
++ * P7/P8 revisions(prototype): Camera EN
++ * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
++ */
++ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
++ r = gpio_request(gpio + 1, "nDVI_PWR_EN");
++ if (!r) {
++ r = gpio_direction_output(gpio + 1, 0);
++ if (r)
++ gpio_free(gpio + 1);
++ }
++ if (r)
++ pr_err("%s: unable to configure nDVI_PWR_EN\n",
++ __func__);
++ r = gpio_request(gpio + 2, "DVI_LDO_EN");
++ if (!r) {
++ r = gpio_direction_output(gpio + 2, 1);
++ if (r)
++ gpio_free(gpio + 2);
++ }
++ if (r)
++ pr_err("%s: unable to configure DVI_LDO_EN\n",
++ __func__);
++ }
++
+ return 0;
+ }
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0007-beagleboard-hack-in-support-from-xM-rev-C.patch b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0007-beagleboard-hack-in-support-from-xM-rev-C.patch
new file mode 100644
index 0000000000..0181f15208
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0007-beagleboard-hack-in-support-from-xM-rev-C.patch
@@ -0,0 +1,61 @@
+From b241e679f550f38062923eb7800a5c57a41fe95d Mon Sep 17 00:00:00 2001
+From: Jason Kridner <jkridner@beagleboard.org>
+Date: Thu, 10 Mar 2011 13:15:38 +0100
+Subject: [PATCH 07/10] beagleboard: hack in support from xM rev C
+
+Based on patch by Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 20 ++++++++++++++++----
+ 1 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 9880c5c..4bde54b 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -182,7 +182,9 @@ static inline void __init omap3beagle_ks8851_init(void) { return; }
+ * 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,
+@@ -190,6 +192,7 @@ enum {
+ OMAP3BEAGLE_BOARD_C1_3,
+ OMAP3BEAGLE_BOARD_C4,
+ OMAP3BEAGLE_BOARD_XM,
++ OMAP3BEAGLE_BOARD_XMC,
+ };
+
+ static u8 omap3_beagle_version;
+@@ -241,12 +244,21 @@ static void __init omap3_beagle_init_rev(void)
+ omap3_beagle_version = OMAP3BEAGLE_BOARD_C4;
+ break;
+ case 0:
+- printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
++ printk(KERN_INFO "OMAP3 Beagle Rev: xM A\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;
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0008-omap3-beagle-cleaned-up-board-revision-conditions.patch b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0008-omap3-beagle-cleaned-up-board-revision-conditions.patch
new file mode 100644
index 0000000000..513a1019c2
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0008-omap3-beagle-cleaned-up-board-revision-conditions.patch
@@ -0,0 +1,153 @@
+From 8bd3ffb5755c49aaffecb20b9bd43f955ac26251 Mon Sep 17 00:00:00 2001
+From: Jason Kridner <jkridner@beagleboard.org>
+Date: Wed, 16 Mar 2011 09:21:06 -0500
+Subject: [PATCH 08/10] omap3: beagle: cleaned up board revision conditions
+
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 70 ++++++++++++++-----------------
+ 1 files changed, 32 insertions(+), 38 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 4bde54b..664a9c6 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -191,7 +191,7 @@ enum {
+ OMAP3BEAGLE_BOARD_AXBX,
+ OMAP3BEAGLE_BOARD_C1_3,
+ OMAP3BEAGLE_BOARD_C4,
+- OMAP3BEAGLE_BOARD_XM,
++ OMAP3BEAGLE_BOARD_XMAB,
+ OMAP3BEAGLE_BOARD_XMC,
+ };
+
+@@ -245,11 +245,11 @@ static void __init omap3_beagle_init_rev(void)
+ break;
+ case 0:
+ printk(KERN_INFO "OMAP3 Beagle Rev: xM A\n");
+- omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_XMAB;
+ break;
+ case 1:
+ printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n");
+- omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_XMAB;
+ break;
+ case 2:
+ printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
+@@ -458,13 +458,18 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ {
+ int r;
+
+- if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
++ switch(omap3_beagle_get_rev())
++ {
++ case OMAP3BEAGLE_BOARD_XMAB:
++ case OMAP3BEAGLE_BOARD_XMC:
+ mmc[0].gpio_wp = -EINVAL;
+- } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
+- (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
++ break;
++ case OMAP3BEAGLE_BOARD_C1_3:
++ case OMAP3BEAGLE_BOARD_C4:
+ omap_mux_init_gpio(23, OMAP_PIN_INPUT);
+ mmc[0].gpio_wp = 23;
+- } else {
++ break;
++ default:
+ omap_mux_init_gpio(29, OMAP_PIN_INPUT);
+ }
+ /* gpio + 0 is "mmc0_cd" (input/IRQ) */
+@@ -479,7 +484,8 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ * power switch and overcurrent detect
+ */
+
+- if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
++ if ((omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMAB) &&
++ (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMC)) {
+ r = gpio_request(gpio + 1, "EHCI_nOC");
+ if (!r) {
+ r = gpio_direction_input(gpio + 1);
+@@ -490,54 +496,41 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ pr_err("%s: unable to configure EHCI_nOC\n", __func__);
+ }
+
+- if (cpu_is_omap3630()) {
+- /* Power on DVI, Serial and PWR led */
+- gpio_request(gpio + 1, "nDVI_PWR_EN");
+- gpio_direction_output(gpio + 1, 0);
+-
+- /* Power on camera interface */
+- gpio_request(gpio + 2, "CAM_EN");
+- gpio_direction_output(gpio + 2, 1);
+-
+- /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
+- gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
+- gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
+- }
+- else {
+- gpio_request(gpio + 1, "EHCI_nOC");
+- gpio_direction_input(gpio + 1);
+-
+- /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
+- gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
+- gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+- }
+-
+ /*
+- * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
++ * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, xM Ax/Bx active
+ * high / others active low)
+ */
+ gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
+- if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
++ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMAB)
+ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
+ else
+ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+
+ /* DVI reset GPIO is different between beagle revisions */
+- if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
+- beagle_dvi_device.reset_gpio = 129;
+- else
++ switch(omap3_beagle_get_rev())
++ {
++ case OMAP3BEAGLE_BOARD_AXBX:
++ case OMAP3BEAGLE_BOARD_C1_3:
++ case OMAP3BEAGLE_BOARD_C4:
+ beagle_dvi_device.reset_gpio = 170;
++ break;
++ case OMAP3BEAGLE_BOARD_XMAB:
++ case OMAP3BEAGLE_BOARD_XMC:
++ default:
++ beagle_dvi_device.reset_gpio = 129;
++ }
+
+ /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+
+ /*
+- * 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 follows:
+ * P7/P8 revisions(prototype): Camera EN
+ * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
+ */
+- if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
++ if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMAB) ||
++ (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC)) {
+ r = gpio_request(gpio + 1, "nDVI_PWR_EN");
+ if (!r) {
+ r = gpio_direction_output(gpio + 1, 0);
+@@ -1013,7 +1006,8 @@ static void __init omap3_beagle_init(void)
+ omap3_beagle_init_rev();
+ omap3_beagle_i2c_init();
+
+- if (cpu_is_omap3630()) {
++ if ((omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMAB) &&
++ (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMC)) {
+ gpio_buttons[0].gpio = 4;
+ }
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp_2.6.32.bb b/recipes/linux/linux-omap-psp_2.6.32.bb
index b6bf6656f9..b62adb4334 100644
--- a/recipes/linux/linux-omap-psp_2.6.32.bb
+++ b/recipes/linux/linux-omap-psp_2.6.32.bb
@@ -141,6 +141,14 @@ SRC_URI = "git://arago-project.org/git/projects/linux-omap3.git;protocol=http;br
file://defconfig"
SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
+ file://beagleboard-xmc/0001-omap-Beagle-revision-detection.patch \
+ file://beagleboard-xmc/0002-omap-Beagle-only-Cx-boards-use-pin-23-for-write-prot.patch \
+ file://beagleboard-xmc/0003-omap-Beagle-no-gpio_wp-pin-connection-on-xM.patch \
+ file://beagleboard-xmc/0004-omap3-beaglexm-fix-EHCI-power-up-GPIO-dir.patch \
+ file://beagleboard-xmc/0005-omap3-beaglexm-fix-DVI-reset-GPIO.patch \
+ file://beagleboard-xmc/0006-omap3-beaglexm-fix-power-on-of-DVI.patch \
+ file://beagleboard-xmc/0007-beagleboard-hack-in-support-from-xM-rev-C.patch \
+ file://beagleboard-xmc/0008-omap3-beagle-cleaned-up-board-revision-conditions.patch \
"
SRC_URI_append_omap3-touchbook = " \