u-boot 2011.09: add support for loop-through expansion boards on beagle and switch...
authorKoen Kooi <koen@dominion.thruhere.net>
Tue, 11 Oct 2011 14:12:29 +0000 (16:12 +0200)
committerKoen Kooi <koen@dominion.thruhere.net>
Tue, 11 Oct 2011 14:33:23 +0000 (16:33 +0200)
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
recipes-bsp/u-boot/u-boot/2011.09/0001-beagleboard-add-support-for-scanning-loop-through-ex.patch [new file with mode: 0644]
recipes-bsp/u-boot/u-boot/2011.09/0002-beagleboard-switch-to-ttyO2.patch [new file with mode: 0644]
recipes-bsp/u-boot/u-boot_2011.09.bb

diff --git a/recipes-bsp/u-boot/u-boot/2011.09/0001-beagleboard-add-support-for-scanning-loop-through-ex.patch b/recipes-bsp/u-boot/u-boot/2011.09/0001-beagleboard-add-support-for-scanning-loop-through-ex.patch
new file mode 100644 (file)
index 0000000..fdd6200
--- /dev/null
@@ -0,0 +1,105 @@
+From d6dd7efc7a74e6bdcbcbda204f66d4ad23fd0f53 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 11 Oct 2011 13:05:32 +0200
+Subject: [PATCH 1/2] beagleboard: add support for scanning loop-through expansionboards like the uLCD-lite
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ board/ti/beagle/beagle.c       |   30 ++++++++++++++++++++++++++----
+ include/configs/omap3_beagle.h |    2 ++
+ 2 files changed, 28 insertions(+), 4 deletions(-)
+
+diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
+index 96fac51..51a90a0 100644
+--- a/board/ti/beagle/beagle.c
++++ b/board/ti/beagle/beagle.c
+@@ -72,6 +72,7 @@ extern volatile struct ehci_hcor *hcor;
+ #define BBTOYS_WIFI                   0x01000B00
+ #define BBTOYS_VGA                    0x02000B00
+ #define BBTOYS_LCD                    0x03000B00
++#define BBTOYS_ULCD                   0x04000B00
+ #define BEAGLE_NO_EEPROM              0xffffffff
+ DECLARE_GLOBAL_DATA_PTR;
+@@ -148,18 +149,18 @@ int get_board_revision(void)
+  *            bus 1 for the availability of an AT24C01B serial EEPROM.
+  *            returns the device_vendor field from the EEPROM
+  */
+-unsigned int get_expansion_id(void)
++unsigned int get_expansion_id(int eeprom_address)
+ {
+       i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
+       /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */
+-      if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
++      if (i2c_probe(eeprom_address) == 1) {
+               i2c_set_bus_num(TWL4030_I2C_BUS);
+               return BEAGLE_NO_EEPROM;
+       }
+       /* read configuration data */
+-      i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
++      i2c_read(eeprom_address, 0, 1, (u8 *)&expansion_config,
+                sizeof(expansion_config));
+       i2c_set_bus_num(TWL4030_I2C_BUS);
+@@ -262,7 +263,7 @@ int misc_init_r(void)
+                                       TWL4030_PM_RECEIVER_DEV_GRP_P1);
+       }
+-      switch (get_expansion_id()) {
++      switch (get_expansion_id(EXPANSION_EEPROM_I2C_ADDRESS)) {
+       case TINCANTOOLS_ZIPPY:
+               printf("Recognized Tincantools Zippy board (rev %d %s)\n",
+                       expansion_config.revision,
+@@ -341,6 +342,27 @@ int misc_init_r(void)
+       if (expansion_config.content == 1)
+               setenv(expansion_config.env_var, expansion_config.env_setting);
++      /* Scan 0x51 as well for loop-thru boards */
++      switch (get_expansion_id(EXPANSION_EEPROM_I2C_ADDRESS + 1)) {
++      case BBTOYS_ULCD:
++              printf("Recognized BeagleBoardToys uLCD-lite board\n");
++              setenv("buddy2", "bbtoys-ulcd");
++              setenv("defaultdisplay", "lcd");
++              setenv("uenvcmd", "i2c dev 1 ; i2c mw 40 00 00; i2c mw 40 04 80; i2c mw 40 0d 05; i2c mw 40 0d 15");
++              break;
++      case BEAGLE_NO_EEPROM:
++              printf("No EEPROM on expansion board\n");
++              setenv("buddy2", "none");
++              break;
++      default:
++              printf("Unrecognized expansion board: %x\n",
++                      expansion_config.device_vendor);
++              setenv("buddy2", "unknown");
++      }
++
++      if (expansion_config.content == 1)
++              setenv(expansion_config.env_var, expansion_config.env_setting);
++
+       twl4030_power_init();
+       switch (get_board_revision()) {
+       case REVISION_XM_A:
+diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
+index dbe682a..23f19f6 100644
+--- a/include/configs/omap3_beagle.h
++++ b/include/configs/omap3_beagle.h
+@@ -223,6 +223,7 @@
+       "console=ttyS2,115200n8\0" \
+       "mpurate=auto\0" \
+       "buddy=none "\
++      "buddy2=none "\
+       "optargs=\0" \
+       "camera=none\0" \
+       "vram=12M\0" \
+@@ -239,6 +240,7 @@
+               "${optargs} " \
+               "mpurate=${mpurate} " \
+               "buddy=${buddy} "\
++              "buddy2=${buddy2} "\
+               "camera=${camera} "\
+               "vram=${vram} " \
+               "omapfb.mode=dvi:${dvimode} " \
+-- 
+1.6.6.1
+
diff --git a/recipes-bsp/u-boot/u-boot/2011.09/0002-beagleboard-switch-to-ttyO2.patch b/recipes-bsp/u-boot/u-boot/2011.09/0002-beagleboard-switch-to-ttyO2.patch
new file mode 100644 (file)
index 0000000..bc7cf06
--- /dev/null
@@ -0,0 +1,26 @@
+From d901c32c1bd9343a932f8bdd96f3ec539407b42b Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 11 Oct 2011 13:53:21 +0200
+Subject: [PATCH 2/2] beagleboard: switch to ttyO2
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ include/configs/omap3_beagle.h |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
+index 23f19f6..04c2188 100644
+--- a/include/configs/omap3_beagle.h
++++ b/include/configs/omap3_beagle.h
+@@ -220,7 +220,7 @@
+       "rdaddr=0x81000000\0" \
+       "usbtty=cdc_acm\0" \
+       "bootfile=uImage.beagle\0" \
+-      "console=ttyS2,115200n8\0" \
++      "console=ttyO2,115200n8\0" \
+       "mpurate=auto\0" \
+       "buddy=none "\
+       "buddy2=none "\
+-- 
+1.6.6.1
+
index 10e02691a5502f9a8096d189a87172ecb096121d..223ccb90861fff5acccec654f9a3660dd6593579 100644 (file)
@@ -1,6 +1,6 @@
 require u-boot.inc
 
-PR = "r2"
+PR = "r3"
 
 # No patches for other machines yet
 COMPATIBLE_MACHINE = "(beagleboard)"
@@ -10,6 +10,8 @@ SRC_URI = "git://www.denx.de/git/u-boot.git;protocol=git \
            file://2011.09/0002-beagleboard-config-enable-gpio-command.patch \
            file://2011.09/0003-Increased-some-timeout-durations-for-MMC-and-EHCI.patch \
            file://2011.09/0001-beagleboard-add-support-for-TCT-Beacon-board.patch \
+           file://2011.09/0001-beagleboard-add-support-for-scanning-loop-through-ex.patch \
+           file://2011.09/0002-beagleboard-switch-to-ttyO2.patch \
            file://fw_env.config \
           "