]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch
2bd76c3ceccd6013c2173fde798fcbe1e6cdb8a8
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-omap-2.6.39 / beagle / 0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch
1 From 812ef26f4be80d12facd62adce971ec9fe64a144 Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Fri, 20 May 2011 12:48:37 +0200
4 Subject: [PATCH 1/5] OMAP3: beagle: add support for beagleboard xM revision C
6 The USB enable GPIO has been inverted and the USER button moved.
8 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
9 ---
10  arch/arm/mach-omap2/board-omap3beagle.c |   34 +++++++++++++++++++++++-------
11  1 files changed, 26 insertions(+), 8 deletions(-)
13 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
14 index 2de4b02..77bafa8 100644
15 --- a/arch/arm/mach-omap2/board-omap3beagle.c
16 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
17 @@ -62,7 +62,9 @@
18   *     AXBX    = GPIO173, GPIO172, GPIO171: 1 1 1
19   *     C1_3    = GPIO173, GPIO172, GPIO171: 1 1 0
20   *     C4      = GPIO173, GPIO172, GPIO171: 1 0 1
21 - *     XM      = GPIO173, GPIO172, GPIO171: 0 0 0
22 + *     XMA     = GPIO173, GPIO172, GPIO171: 0 0 0
23 + *     XMB     = GPIO173, GPIO172, GPIO171: 0 0 1
24 + *  XMC = GPIO173, GPIO172, GPIO171: 0 1 0
25   */
26  enum {
27         OMAP3BEAGLE_BOARD_UNKN = 0,
28 @@ -70,6 +72,7 @@ enum {
29         OMAP3BEAGLE_BOARD_C1_3,
30         OMAP3BEAGLE_BOARD_C4,
31         OMAP3BEAGLE_BOARD_XM,
32 +       OMAP3BEAGLE_BOARD_XMC,
33  };
34  
35  static u8 omap3_beagle_version;
36 @@ -124,9 +127,18 @@ static void __init omap3_beagle_init_rev(void)
37                 printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
38                 omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
39                 break;
40 +       case 1:
41 +               printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n");
42 +               omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
43 +               break;
44 +       case 2:
45 +               printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
46 +               omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
47 +               break;
48         default:
49 -               printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
50 -               omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
51 +               printk(KERN_INFO 
52 +               "OMAP3 Beagle Rev: unknown %hd, assuming xM C or newer\n", beagle_rev);
53 +               omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
54         }
55  
56         return;
57 @@ -278,7 +290,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
58  {
59         int r;
60  
61 -       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
62 +       if (cpu_is_omap3630()) {
63                 mmc[0].gpio_wp = -EINVAL;
64         } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
65                 (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
66 @@ -298,7 +310,8 @@ static int beagle_twl_gpio_setup(struct device *dev,
67         /* REVISIT: need ehci-omap hooks for external VBUS
68          * power switch and overcurrent detect
69          */
70 -       if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
71 +       if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM 
72 +               && omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMC) {
73                 r = gpio_request(gpio + 1, "EHCI_nOC");
74                 if (!r) {
75                         r = gpio_direction_input(gpio + 1);
76 @@ -320,7 +333,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
77                 gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
78  
79         /* DVI reset GPIO is different between beagle revisions */
80 -       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
81 +       if (cpu_is_omap3630()) 
82                 beagle_dvi_device.reset_gpio = 129;
83         else
84                 beagle_dvi_device.reset_gpio = 170;
85 @@ -334,7 +347,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
86          * P7/P8 revisions(prototype): Camera EN
87          * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
88          */
89 -       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
90 +       if (cpu_is_omap3630()) {
91                 r = gpio_request(gpio + 1, "nDVI_PWR_EN");
92                 if (!r) {
93                         r = gpio_direction_output(gpio + 1, 0);
94 @@ -625,7 +638,7 @@ static void __init beagle_opp_init(void)
95         }
96  
97         /* Custom OPP enabled for XM */
98 -       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
99 +       if (cpu_is_omap3630()) {
100                 struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
101                 struct omap_hwmod *dh = omap_hwmod_lookup("iva");
102                 struct device *dev;
103 @@ -665,6 +678,11 @@ static void __init omap3_beagle_init(void)
104         omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
105         omap3_beagle_init_rev();
106         omap3_beagle_i2c_init();
108 +       if (cpu_is_omap3630()) {
109 +               gpio_buttons[0].gpio = 4;
110 +       }
112         platform_add_devices(omap3_beagle_devices,
113                         ARRAY_SIZE(omap3_beagle_devices));
114         omap_display_init(&beagle_dss_data);
115 -- 
116 1.6.6.1