From 008f50c7847a2aaa4fc26e82faf77630d380dc85 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 11 Oct 2011 16:12:29 +0200 Subject: [PATCH] u-boot 2011.09: add support for loop-through expansion boards on beagle and switch to ttyO2 Signed-off-by: Koen Kooi --- ...support-for-scanning-loop-through-ex.patch | 105 ++++++++++++++++++ .../0002-beagleboard-switch-to-ttyO2.patch | 26 +++++ recipes-bsp/u-boot/u-boot_2011.09.bb | 4 +- 3 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 recipes-bsp/u-boot/u-boot/2011.09/0001-beagleboard-add-support-for-scanning-loop-through-ex.patch create mode 100644 recipes-bsp/u-boot/u-boot/2011.09/0002-beagleboard-switch-to-ttyO2.patch 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 index 00000000..fdd62004 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.09/0001-beagleboard-add-support-for-scanning-loop-through-ex.patch @@ -0,0 +1,105 @@ +From d6dd7efc7a74e6bdcbcbda204f66d4ad23fd0f53 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +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 +--- + 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 index 00000000..bc7cf06c --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.09/0002-beagleboard-switch-to-ttyO2.patch @@ -0,0 +1,26 @@ +From d901c32c1bd9343a932f8bdd96f3ec539407b42b Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Tue, 11 Oct 2011 13:53:21 +0200 +Subject: [PATCH 2/2] beagleboard: switch to ttyO2 + +Signed-off-by: Koen Kooi +--- + 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 + diff --git a/recipes-bsp/u-boot/u-boot_2011.09.bb b/recipes-bsp/u-boot/u-boot_2011.09.bb index 10e02691..223ccb90 100644 --- a/recipes-bsp/u-boot/u-boot_2011.09.bb +++ b/recipes-bsp/u-boot/u-boot_2011.09.bb @@ -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 \ "