linux-omap-pm: make u-boot flashable from within linux, first attempt at making ehci...
authorKoen Kooi <koen@openembedded.org>
Thu, 30 Jul 2009 11:24:46 +0000 (13:24 +0200)
committerKoen Kooi <koen@openembedded.org>
Thu, 30 Jul 2009 11:24:46 +0000 (13:24 +0200)
recipes/linux/linux-omap-pm/beagle-writable-uboot.diff [new file with mode: 0644]
recipes/linux/linux-omap-pm/beagleboard/ehci.patch
recipes/linux/linux-omap-pm_git.bb

diff --git a/recipes/linux/linux-omap-pm/beagle-writable-uboot.diff b/recipes/linux/linux-omap-pm/beagle-writable-uboot.diff
new file mode 100644 (file)
index 0000000..7c5a36d
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/arch/arm/mach-omap2/board-omap3beagle.c  2009-07-08 16:30:01.000000000 -0700
++++ b/arch/arm/mach-omap2/board-omap3beagle.c  2009-07-13 13:56:37.000000000 -0700
+@@ -68,7 +68,6 @@ static struct mtd_partition omap3beagle_
+               .name           = "U-Boot",
+               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
+               .size           = 15 * NAND_BLOCK_SIZE,
+-              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
+       },
+       {
+               .name           = "U-Boot Env",
index 5a8c844..c55ff60 100644 (file)
-Index: git/arch/arm/mach-omap2/board-omap3beagle.c
-===================================================================
---- git.orig/arch/arm/mach-omap2/board-omap3beagle.c
-+++ git/arch/arm/mach-omap2/board-omap3beagle.c
-@@ -154,6 +154,7 @@ static int beagle_twl_gpio_setup(struct
+From f8f10f496bce396416d7156da876222c6ce8c341 Mon Sep 17 00:00:00 2001
+From: Steven Kipisz <skipisz@beagleboard.org>
+Date: Wed, 9 Jan 2009 12:01:11 -0600
+Subject: [PATCH-USB] Omap3 beagleboard: add support for EHCI in revision C1 boards
+
+Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c |   10 +---------
+ arch/arm/mach-omap2/usb-ehci.c          |    4 +---
+ drivers/usb/host/ehci-omap.c            |   26 ++++++++++++++++++++++++++
+ 3 files changed, 28 insertions(+), 12 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index fe97bab..de81153 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -140,15 +140,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
         * power switch and overcurrent detect
         */
  
-+#if 0 /* TODO: This needs to be modified to not rely on u-boot */
-       gpio_request(gpio + 1, "EHCI_nOC");
-       gpio_direction_input(gpio + 1);
-@@ -163,7 +164,7 @@ static int beagle_twl_gpio_setup(struct
-       /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
-       gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+-      gpio_request(gpio + 1, "EHCI_nOC");
+-      gpio_direction_input(gpio + 1);
 -
-+#endif
+-      /* 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);
+-
+-      /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+-      gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
++        /* TODO: This needs to be modified to not rely on u-boot */
        return 0;
  }
+--- /tmp/usb-ehci.c    2009-07-30 13:14:34.000000000 +0200
++++ git/arch/arm/mach-omap2/usb-ehci.c 2009-07-30 13:16:03.000000000 +0200
+@@ -170,9 +170,7 @@
  
-Index: git/arch/arm/mach-omap2/usb-ehci.c
-===================================================================
---- git.orig/arch/arm/mach-omap2/usb-ehci.c
-+++ git/arch/arm/mach-omap2/usb-ehci.c
-@@ -147,9 +147,11 @@ static void setup_ehci_io_mux(void)
+       platform_device_add_data(&ehci_device, &pdata, sizeof(pdata));
  
- void __init usb_ehci_init(void)
- {
-+#if 0 /* TODO: Setup Pin IO MUX for EHCI - moved this temporarily to U-boot */
-       /* Setup Pin IO MUX for EHCI */
-       if (cpu_is_omap34xx())
-               setup_ehci_io_mux();
-+#endif
+-      /* Setup Pin IO MUX for EHCI */
+-      if (cpu_is_omap34xx())
+-              setup_ehci_io_mux();
++      /* TODO: Setup Pin IO MUX for EHCI - moved this temporarily to U-boot */
  
        if (platform_device_register(&ehci_device) < 0) {
                printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
-Index: git/drivers/usb/host/ehci-omap.c
-===================================================================
---- git.orig/drivers/usb/host/ehci-omap.c
-+++ git/drivers/usb/host/ehci-omap.c
-@@ -48,16 +48,25 @@
-  *            to get the PHY state machine in working state
-  */
- #define EXTERNAL_PHY_RESET
-+#ifdef CONFIG_MACH_OMAP3_BEAGLE
-+#define        EXT_PHY_RESET_GPIO_PORT2        (147)
-+#else
- #define       EXT_PHY_RESET_GPIO_PORT1        (57)
- #define       EXT_PHY_RESET_GPIO_PORT2        (61)
-+#endif
- #define       EXT_PHY_RESET_DELAY             (10)
-+#define PHY_STP_PULLUP_ENABLE           (0x10)
-+#define PHY_STP_PULLUP_DISABLE          (0x90)
-+
- /* ISSUE2:
-  * USBHOST supports External charge pump PHYs only
-  * Use the VBUS from Port1 to power VBUS of Port2 externally
-  * So use Port2 as the working ULPI port
-  */
-+#ifndef CONFIG_MACH_OMAP3_BEAGLE
- #define VBUS_INTERNAL_CHARGEPUMP_HACK
-+#endif
- #endif /* CONFIG_OMAP_EHCI_PHY_MODE */
-@@ -225,14 +234,43 @@ static int omap_start_ehc(struct platfor
- #ifdef EXTERNAL_PHY_RESET
-       /* Refer: ISSUE1 */
-+#ifndef CONFIG_MACH_OMAP3_BEAGLE
-       gpio_request(EXT_PHY_RESET_GPIO_PORT1, "USB1 PHY reset");
-       gpio_direction_output(EXT_PHY_RESET_GPIO_PORT1, 0);
-+#endif
-       gpio_request(EXT_PHY_RESET_GPIO_PORT2, "USB2 PHY reset");
-       gpio_direction_output(EXT_PHY_RESET_GPIO_PORT2, 0);
-+      gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 0);
-       /* Hold the PHY in RESET for enough time till DIR is high */
-       udelay(EXT_PHY_RESET_DELAY);
- #endif
-+        /*
-+         * The PHY register 0x7 - Interface Control register is
-+         * configured to disable the integrated STP pull-up resistor
-+         * used for interface protection.
-+        *
-+        * May not need to be here.
-+         */
-+        omap_writel((0x7 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* interface reg */
-+                (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/*   Write */
-+                (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
-+                (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
-+                (PHY_STP_PULLUP_DISABLE),
-+                EHCI_INSNREG05_ULPI);
-+
-+        while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
-+
-+        /* Force PHY to HS */
-+        omap_writel((0x4 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* function ctrl */
-+                (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/*   Write */
-+                (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
-+                (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
-+                (0x40),
-+                EHCI_INSNREG05_ULPI);
-+
-+        while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
-+
-       /* Configure TLL for 60Mhz clk for ULPI */
-       ehci_clocks->usbtll_fck_clk = clk_get(&dev->dev, USBHOST_TLL_FCLK);
-       if (IS_ERR(ehci_clocks->usbtll_fck_clk))
-@@ -307,7 +345,9 @@ static int omap_start_ehc(struct platfor
-        * Hold the PHY in RESET for enough time till PHY is settled and ready
-        */
-       udelay(EXT_PHY_RESET_DELAY);
-+#ifndef CONFIG_MACH_OMAP3_BEAGLE
-       gpio_set_value(EXT_PHY_RESET_GPIO_PORT1, 1);
-+#endif
-       gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 1);
- #endif
-@@ -393,7 +433,9 @@ static void omap_stop_ehc(struct platfor
- #ifdef EXTERNAL_PHY_RESET
-+#ifndef CONFIG_MACH_OMAP3_BEAGLE
-       gpio_free(EXT_PHY_RESET_GPIO_PORT1);
-+#endif
-       gpio_free(EXT_PHY_RESET_GPIO_PORT2);
- #endif
index 43527cd..574e0a3 100644 (file)
@@ -23,6 +23,7 @@ SRC_URI_append = " \
            file://fix-install.patch;patch=1 \
            file://fix-musb-oops.diff;patch=1 \
            file://fix-mtd.diff;patch=1 \
+           file://ehci.patch;patch=1 \
            file://dss2/0001-OMAPFB-move-omapfb.h-to-include-linux.patch;patch=1 \
            file://dss2/0002-DSS2-OMAP2-3-Display-Subsystem-driver.patch;patch=1 \
            file://dss2/0003-DSS2-OMAP-framebuffer-driver.patch;patch=1 \
@@ -172,6 +173,7 @@ SRC_URI_append = " \
 "
 
 SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
+           file://beagle-writable-uboot.diff;patch=1 \
                             "
 
 SRC_URI_append_omap3evm = " \