From patchwork Tue Jul 20 15:25:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 59334 X-Patchwork-Delegate: leann.ogasawara@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id A6F1FB6F04 for ; Wed, 21 Jul 2010 01:25:26 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1ObEh1-0002qK-US; Tue, 20 Jul 2010 16:25:15 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1ObEgz-0002px-NZ for kernel-team@lists.ubuntu.com; Tue, 20 Jul 2010 16:25:13 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1ObEgz-0004BQ-LI for ; Tue, 20 Jul 2010 16:25:13 +0100 Received: from [193.85.232.179] (helo=[10.155.2.100]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1ObEgz-0007Oq-IT for kernel-team@lists.ubuntu.com; Tue, 20 Jul 2010 16:25:13 +0100 Message-ID: <4C45BFD7.3060800@canonical.com> Date: Tue, 20 Jul 2010 17:25:11 +0200 From: Lee Jones User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 MIME-Version: 1.0 To: kernel-team Subject: [Maverick][PATCH] UBUNTU: SAUCE: Enable USB and Ethernet on the XM X-Enigmail-Version: 1.0.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From a2f11a44e5834d75611c88af69036cfe26eddf05 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 20 Jul 2010 16:54:12 +0200 Subject: [PATCH] UBUNTU: SAUCE: Enable USB and Ethernet on the XM Provide the required setup to enable USB Ethernet (usb0) and USB host on the XM Beagleboard (A rev). Signed-off-by: Lee Jones Signed-off-by: Steve Sakoman --- arch/arm/mach-omap2/board-omap3beagle.c | 32 +++++++++++------ arch/arm/plat-omap/include/plat/cpu.h | 56 +++++++++++++++++++++++++++++++ drivers/video/omap2/dss/dispc.c | 4 +- drivers/video/omap2/dss/dpi.c | 7 +++- 4 files changed, 85 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 32565dc..7a1b351 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -171,6 +171,11 @@ static void __init beagle_display_init(void) { int r; + if (cpu_is_omap3630()) + beagle_dvi_device.reset_gpio = 129; + else + beagle_dvi_device.reset_gpio = 170; + r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset"); if (r < 0) { printk(KERN_ERR "Unable to get DVI reset GPIO\n"); @@ -222,12 +227,22 @@ static int beagle_twl_gpio_setup(struct device *dev, * power switch and overcurrent detect */ - 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); + if (cpu_is_omap3630()) { + gpio_request(gpio + 1, "nDVI_PWR_EN"); + gpio_direction_output(gpio + 1, 0); + + /* 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 + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; @@ -492,11 +507,6 @@ static void __init omap3_beagle_init(void) ARRAY_SIZE(omap3_beagle_devices)); omap_serial_init(); - omap_mux_init_gpio(170, OMAP_PIN_INPUT); - gpio_request(170, "DVI_nPD"); - /* REVISIT leave DVI powered down until it's needed ... */ - gpio_direction_output(170, true); - usb_musb_init(&musb_board_data); usb_ehci_init(&ehci_pdata); omap3beagle_flash_init(); diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index 7514174..5e76126 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h @@ -389,6 +389,62 @@ IS_OMAP_TYPE(3517, 0x3517) #define OMAP4430_REV_ES1_0 0x44300044 /* + * Silicon revisions + */ +#define OMAP_ES_1_0 0x00 +#define OMAP_ES_2_0 0x10 +#define OMAP_ES_2_1 0x20 +#define OMAP_ES_3_0 0x30 +#define OMAP_ES_3_1 0x40 + +#define OMAP_REV_MASK 0x0000ff00 +#define OMAP_REV_BITS ((omap_rev() & OMAP_REV_MASK) >> 8) + +#define OMAP_REV_IS(revid) \ +static inline u8 omap_rev_is_ ##revid (void) \ +{ \ + return (OMAP_REV_BITS == OMAP_ES_ ##revid) ? 1 : 0; \ +} + +#define OMAP_REV_LT(revid) \ +static inline u8 omap_rev_lt_ ##revid (void) \ +{ \ + return (OMAP_REV_BITS < OMAP_ES_ ##revid) ? 1 : 0; \ +} + +#define OMAP_REV_LE(revid) \ +static inline u8 omap_rev_le_ ##revid (void) \ +{ \ + return (OMAP_REV_BITS <= OMAP_ES_ ##revid) ? 1 : 0; \ +} + +#define OMAP_REV_GT(revid) \ +static inline u8 omap_rev_gt_ ##revid (void) \ +{ \ + return (OMAP_REV_BITS > OMAP_ES_ ##revid) ? 1 : 0; \ +} + +#define OMAP_REV_GE(revid) \ +static inline u8 omap_rev_ge_ ##revid (void) \ +{ \ + return (OMAP_REV_BITS >= OMAP_ES_ ##revid) ? 1 : 0; \ +} + +#define OMAP_REV_FUNCTIONS(revid) \ + OMAP_REV_IS(revid) \ + OMAP_REV_LT(revid) \ + OMAP_REV_LE(revid) \ + OMAP_REV_GT(revid) \ + OMAP_REV_GE(revid) + +OMAP_REV_FUNCTIONS(1_0) +OMAP_REV_FUNCTIONS(2_0) +OMAP_REV_FUNCTIONS(2_1) +OMAP_REV_FUNCTIONS(3_0) +OMAP_REV_FUNCTIONS(3_1) + +/* + * omap_chip bits * * CHIP_IS_OMAP{2420,2430,3430} indicate that a particular structure is diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index e777e35..6ba87d8 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -2111,7 +2111,7 @@ void dispc_set_parallel_interface_mode(enum omap_parallel_interface_mode mode) static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp, int vsw, int vfp, int vbp) { - if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) { + if (cpu_is_omap24xx() || (cpu_is_omap34xx() && omap_rev_lt_3_0())) { if (hsw < 1 || hsw > 64 || hfp < 1 || hfp > 256 || hbp < 1 || hbp > 256 || @@ -2144,7 +2144,7 @@ static void _dispc_set_lcd_timings(int hsw, int hfp, int hbp, { u32 timing_h, timing_v; - if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) { + if (cpu_is_omap24xx() || (cpu_is_omap34xx() && omap_rev_lt_3_0())) { timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) | FLD_VAL(hbp-1, 27, 20); diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 960e977..23047b6 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -177,7 +177,12 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev) #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL dss_clk_enable(DSS_CLK_FCK2); - r = dsi_pll_init(dssdev, 0, 1); + + if (cpu_is_omap3630()) + r = dsi_pll_init(dssdev, 1, 1); + else + r = dsi_pll_init(dssdev, 0, 1); + if (r) goto err3; #endif