u-boot git: sync i2c and button patch with http://gitorious.org/beagleboard-validatio...
authorKoen Kooi <koen@openembedded.org>
Sat, 24 Jul 2010 11:06:57 +0000 (13:06 +0200)
committerKoen Kooi <koen@openembedded.org>
Sat, 24 Jul 2010 11:40:42 +0000 (13:40 +0200)
u-boot git: change default env for beagle to run user.scr or ramdisk when the USER button is pressed

recipes/u-boot/u-boot-git/beagleboard/0001-OMAP3-enable-i2c-bus-switching-for-Beagle-and-Overo.patch
recipes/u-boot/u-boot-git/beagleboard/0042-BeagleBoard-New-command-for-status-of-USER-button.patch
recipes/u-boot/u-boot-git/beagleboard/0044-Beagleboard-Adjust-boot.patch [new file with mode: 0644]
recipes/u-boot/u-boot_git.bb

index 921ca10..c718191 100644 (file)
@@ -1,19 +1,24 @@
-From fc313d72cbfd788f23a7623d0b8cd9c2af329b7b Mon Sep 17 00:00:00 2001
-From: Steve Sakoman <steve@sakoman.com>
-Date: Wed, 10 Feb 2010 13:39:40 -0800
-Subject: [PATCH 01/37] OMAP3: enable i2c bus switching for Beagle and Overo
+From 9c1581dd7f6057d5d25d6b2dcf8bacef95d526d2 Mon Sep 17 00:00:00 2001
+From: Syed Mohammed Khasim <khasim@ti.com>
+Date: Mon, 18 Jan 2010 18:11:14 +0530
+Subject: [PATCH] Enable I2C bus switching
 
+OMAP3 supports Multiple I2C channels, this patch allows
+us to use i2c dev <bus no> command to switch between busses.
+
+Signed-off-by: Syed Mohammed Khasim <khasim@ti.com>
+Acked-by: Heiko Schocher <hs@denx.de>
+(cherry picked from commit 9bb1c3501c8f098dac6e224c99e409ebf92b0ab9)
 ---
- drivers/i2c/omap24xx_i2c.c     |    6 ++++++
- include/configs/omap3_beagle.h |    1 +
- include/configs/omap3_overo.h  |    1 +
- 3 files changed, 8 insertions(+), 0 deletions(-)
+ drivers/i2c/omap24xx_i2c.c     |    5 +++++
+ include/configs/omap3_beagle.h |    6 ++++++
+ 2 files changed, 11 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
-index ff18991..30a8b4c 100644
+index f00468d..0af230d 100644
 --- a/drivers/i2c/omap24xx_i2c.c
 +++ b/drivers/i2c/omap24xx_i2c.c
-@@ -435,3 +435,9 @@ int i2c_set_bus_num(unsigned int bus)
+@@ -435,3 +435,8 @@ int i2c_set_bus_num(unsigned int bus)
  
        return 0;
  }
@@ -22,31 +27,23 @@ index ff18991..30a8b4c 100644
 +{
 +      return (int) current_bus;
 +}
-+
 diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
-index 08d79ac..87e3dd0 100644
+index ad73a66..1a76004 100644
 --- a/include/configs/omap3_beagle.h
 +++ b/include/configs/omap3_beagle.h
-@@ -146,6 +146,7 @@
- #define CONFIG_SYS_I2C_BUS            0
- #define CONFIG_SYS_I2C_BUS_SELECT     1
- #define CONFIG_DRIVER_OMAP34XX_I2C    1
-+#define CONFIG_I2C_MULTI_BUS          1
+@@ -113,6 +113,12 @@
+ /* DDR - I use Micron DDR */
+ #define CONFIG_OMAP3_MICRON_DDR               1
  
- /*
-  * TWL4030
-diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
-index a43500b..0d24758 100644
---- a/include/configs/omap3_overo.h
-+++ b/include/configs/omap3_overo.h
-@@ -117,6 +117,7 @@
- #define CONFIG_SYS_I2C_BUS            0
- #define CONFIG_SYS_I2C_BUS_SELECT     1
- #define CONFIG_DRIVER_OMAP34XX_I2C    1
++/* Enable Multi Bus support for I2C */
 +#define CONFIG_I2C_MULTI_BUS          1
- /*
-  * TWL4030
++
++/* Probe all devices */
++#define CONFIG_SYS_I2C_NOPROBES               {0x0, 0x0}
++
+ /* USB */
+ #define CONFIG_MUSB_UDC                       1
+ #define CONFIG_USB_OMAP3              1
 -- 
-1.6.6.1
+1.6.1
 
index c038104..9a704a8 100644 (file)
@@ -1,22 +1,42 @@
-From 7d56d5aa2b3258c493f038abd6d18c7533ea734b Mon Sep 17 00:00:00 2001
-From: Greg Turner <gregturner@ti.com>
-Date: Tue, 25 May 2010 09:19:06 -0500
-Subject: [PATCH] BeagleBoard: New command for status of USER button
+From c053723cc5a73781a4954e6c93d280436623e3d6 Mon Sep 17 00:00:00 2001
+From: Jason Kridner <jkridner@beagleboard.org>
+Date: Wed, 21 Jul 2010 07:41:25 -0500
+Subject: [PATCH] BeagleBoard: Added userbutton command
 
-Modified bootcmd to check the staus at boot time and set filename of the boot script.
+Based on commit f1099c7c43caf5bac3bf6a65aa266fade4747072
+    Author: Greg Turner <gregturner@ti.com>
+    Date:   Tue May 25 09:19:06 2010 -0500
 
-Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+    New u-boot command for status of USER button on BeagleBoard-xM
+
+         Modified bootcmd to check the staus at boot time and set
+        filename of the boot script.
+
+* Moved to a BeagleBoard specific file.
+* Removed changes to default boot command from adding userbutton
+  command.
+* Made to handle pre-xM boards.
+* Flipped polarity of the return value to avoid confusion.  Success (0)
+  is when the button is pressed.  Failure (1) is when the button is NOT
+  pressed.
 ---
- common/cmd_boot.c              |   45 ++++++++++++++++++++++++++++++++++++++++
- include/configs/omap3_beagle.h |   11 +++++++++
- 2 files changed, 56 insertions(+), 0 deletions(-)
+ board/ti/beagle/beagle.c |   54 ++++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 54 insertions(+), 0 deletions(-)
 
-diff --git a/common/cmd_boot.c b/common/cmd_boot.c
-index bfc1db2..4caf674 100644
---- a/common/cmd_boot.c
-+++ b/common/cmd_boot.c
-@@ -35,6 +35,51 @@ unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
-       return entry (argc, argv);
+diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
+index a6a4961..66df719 100644
+--- a/board/ti/beagle/beagle.c
++++ b/board/ti/beagle/beagle.c
+@@ -40,6 +40,7 @@
+ #include <asm/arch/gpio.h>
+ #include <asm/mach-types.h>
+ #include "beagle.h"
++#include <command.h>
+ static struct {
+       unsigned int device_vendor;
+@@ -290,3 +291,56 @@ void set_muxconf_regs(void)
+       MUX_BEAGLE();
  }
  
 +/*
@@ -28,69 +48,50 @@ index bfc1db2..4caf674 100644
 +int do_userbutton (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 +{
 +      int     button = 0;
-+
-+      //printf ("## Return Status of User button\n");
++      int     gpio;
 +
 +      /*
 +       * pass address parameter as argv[0] (aka command name),
 +       * and all remaining args
 +       */
-+      omap_request_gpio(4);
-+      omap_set_gpio_direction(4, 1);
++      switch (beagle_revision) {
++      case REVISION_AXBX:
++      case REVISION_CX:
++      case REVISION_C4:
++              gpio = 7;
++              break;
++      case REVISION_XM:
++      default:
++              gpio = 4;
++              break;
++      }
++      omap_request_gpio(gpio);
++      omap_set_gpio_direction(gpio, 1);
 +      printf("The user button is currently ");
-+      if(omap_get_gpio_datain(4))
++      if(omap_get_gpio_datain(gpio))
 +      {
 +              button = 1;
++              printf("PRESSED.\n");
 +      }
 +      else
 +      {
 +              button = 0;
-+              printf("NOT ");
++              printf("NOT pressed.\n");
 +      }
 +
-+      printf("pressed.\n");
++      omap_free_gpio(gpio);
 +
-+      omap_free_gpio(4);
-+
-+      return button;
++      return !button;
 +}
 +
 +/* -------------------------------------------------------------------- */
 +
 +U_BOOT_CMD(
 +      userbutton, CONFIG_SYS_MAXARGS, 1,      do_userbutton,
-+      "Return the status of the user button",
++      "Return the status of the BeagleBoard USER button",
 +      ""
 +);
 +
-+
- int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
- {
-       ulong   addr, rc;
-diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
-index eaa8779..555b350 100644
---- a/include/configs/omap3_beagle.h
-+++ b/include/configs/omap3_beagle.h
-@@ -254,8 +254,19 @@
-               "run ramargs; " \
-               "bootm ${loadaddr}\0" \
-+/*
-+ * The default bootcmd checks the status of the user button
-+ * and sets the boot script accordingly.
-+ * If the user button is NOT pressed: bootscr = boot.scr
-+ * If the user button is pressed:     bootscr = user.scr
-+ */
- #define CONFIG_BOOTCOMMAND \
-       "if mmc init ${mmcdev}; then " \
-+              "if userbutton; then " \
-+                      "setenv bootscr boot.scr; " \
-+              "else " \
-+                      "setenv bootscr user.scr;" \
-+              "fi;" \
-               "if run loadbootscript; then " \
-                       "run bootscript; " \
-               "else " \
 -- 
-1.5.6.4
+1.6.1
 
diff --git a/recipes/u-boot/u-boot-git/beagleboard/0044-Beagleboard-Adjust-boot.patch b/recipes/u-boot/u-boot-git/beagleboard/0044-Beagleboard-Adjust-boot.patch
new file mode 100644 (file)
index 0000000..19b4ab7
--- /dev/null
@@ -0,0 +1,115 @@
+From c8d52ff17d71be0c632f20092d96e9530088c786 Mon Sep 17 00:00:00 2001
+From: Jason Kridner <jkridner@beagleboard.org>
+Date: Wed, 21 Jul 2010 08:47:59 -0500
+Subject: [PATCH] BeagleBoard: Adjust boot command on USER button
+
+When the USER button is pressed, the default boot command will attempt
+to load user.scr.  If that fails, it will try to load a ramdisk image.
+
+This version also sets the rootfstype and assumes that the userbutton
+command returns success (0) when the button is pressed.  It also really
+attempts to load the user.scr file.
+---
+ include/configs/omap3_beagle.h |   51 ++++++++++++++++++++++++++++++++++-----
+ 1 files changed, 44 insertions(+), 7 deletions(-)
+
+diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
+index f372de2..6d1166f 100644
+--- a/include/configs/omap3_beagle.h
++++ b/include/configs/omap3_beagle.h
+@@ -195,9 +195,12 @@
+ #define CONFIG_BOOTDELAY              3
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+-      "loadaddr=0x82000000\0" \
++      "loadaddr=0x80200000\0" \
++      "rdaddr=0x81600000\0" \
+       "usbtty=cdc_acm\0" \
+       "console=ttyS2,115200n8\0" \
++      "optargs=\0" \
++      "bootscr=boot.scr\0" \
+       "mpurate=500\0" \
+       "buddy=none\0" \
+       "vram=12M\0" \
+@@ -208,7 +211,10 @@
+       "mmcrootfstype=ext3 rootwait\0" \
+       "nandroot=/dev/mtdblock4 rw\0" \
+       "nandrootfstype=jffs2\0" \
++      "ramroot=/dev/ram0 rw\0" \
++      "ramrootfstype=ext2\0" \
+       "mmcargs=setenv bootargs console=${console} " \
++              "${optargs} " \
+               "mpurate=${mpurate} " \
+               "buddy=${buddy} "\
+               "vram=${vram} " \
+@@ -217,6 +223,7 @@
+               "root=${mmcroot} " \
+               "rootfstype=${mmcrootfstype}\0" \
+       "nandargs=setenv bootargs console=${console} " \
++              "${optargs} " \
+               "mpurate=${mpurate} " \
+               "buddy=${buddy} "\
+               "vram=${vram} " \
+@@ -224,7 +231,18 @@
+               "omapdss.def_disp=${defaultdisplay} " \
+               "root=${nandroot} " \
+               "rootfstype=${nandrootfstype}\0" \
+-      "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
++      "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} ${bootscr}\0" \
++      "ramargs=setenv bootargs console=${console} " \
++              "${optargs} " \
++              "mpurate=${mpurate} " \
++              "buddy=${buddy} "\
++              "vram=${vram} " \
++              "omapfb.mode=dvi:${dvimode} " \
++              "omapdss.def_disp=${defaultdisplay} " \
++              "root=${ramroot} rw ramdisk_size=65536 " \
++              "initrd=${rdaddr},64M " \
++              "rootfstype=${ramrootfstype}\0" \
++      "loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
+       "bootscript=echo Running bootscript from mmc ...; " \
+               "source ${loadaddr}\0" \
+       "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+@@ -235,15 +253,34 @@
+               "run nandargs; " \
+               "nand read ${loadaddr} 280000 400000; " \
+               "bootm ${loadaddr}\0" \
++      "ramboot=echo Booting from ramdisk ...; " \
++              "run ramargs; " \
++              "bootm ${loadaddr}\0" \
+ #define CONFIG_BOOTCOMMAND \
+       "if mmc init ${mmcdev}; then " \
+-              "if run loadbootscript; then " \
+-                      "run bootscript; " \
++              "if userbutton; then " \
++                      "setenv bootscr user.scr;" \
++                      "if run loadbootscript; then " \
++                              "run bootscript; " \
++                      "else " \
++                              "if run loaduimage; then " \
++                                      "if run loadramdisk; then " \
++                                              "run ramboot; " \
++                                      "else " \
++                                              "run mmcboot; " \
++                                      "fi; " \
++                              "fi; " \
++                      "fi; " \
+               "else " \
+-                      "if run loaduimage; then " \
+-                              "run mmcboot; " \
+-                      "else run nandboot; " \
++                      "setenv bootscr boot.scr; " \
++                      "if run loadbootscript; then " \
++                              "run bootscript; " \
++                      "else " \
++                              "if run loaduimage; then " \
++                                      "run mmcboot; " \
++                              "else run nandboot; " \
++                              "fi; " \
+                       "fi; " \
+               "fi; " \
+       "else run nandboot; fi"
+-- 
+1.6.1
+
index 29e7319..bc4ab19 100644 (file)
@@ -1,5 +1,5 @@
 require u-boot.inc
-PR ="r58"
+PR ="r59"
 
 FILESPATHPKG =. "u-boot-git:"
 
@@ -62,11 +62,13 @@ SRC_URI_beagleboard = "git://www.denx.de/git/u-boot.git;protocol=git \
                        file://0038-Added-configurations-for-xM-Rev-A-board.patch \
                        file://0039-OMAP3-beagle-setenv-beaglerev-for-AxBx-Cx-xMA-for-be.patch \
                        file://0001-OMAP-mmc-add-support-for-second-and-third-mmc-chan.patch \
-                      file://0001-OMAP3-Beagle-enable-support-for-second-and-third-m.patch \
-                      file://0038-BeagleBoard-Added-LED-driver.patch \
-                      file://0039-Add-led-command.patch \
-                      file://0041-BeagleBoard-Enabled-LEDs.patch \
-                      file://0043-BeagleBoard-Add-CONFIG_SYS_MEMTEST_SCRATCH.patch \
+                       file://0001-OMAP3-Beagle-enable-support-for-second-and-third-m.patch \
+                       file://0038-BeagleBoard-Added-LED-driver.patch \
+                       file://0039-Add-led-command.patch \
+                       file://0041-BeagleBoard-Enabled-LEDs.patch \
+                       file://0042-BeagleBoard-New-command-for-status-of-USER-button.patch \
+                       file://0043-BeagleBoard-Add-CONFIG_SYS_MEMTEST_SCRATCH.patch \
+                       file://0044-Beagleboard-Adjust-boot.patch \
                        file://fw_env.config \
 "
 SRCREV_beagleboard = "ca6e1c136ddb720c3bb2cc043b99f7f06bc46c55"