summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/u-boot/u-boot/2011.12/0003-beagleboard-add-support-for-scanning-loop-through-ex.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/u-boot/u-boot/2011.12/0003-beagleboard-add-support-for-scanning-loop-through-ex.patch')
-rw-r--r--recipes-bsp/u-boot/u-boot/2011.12/0003-beagleboard-add-support-for-scanning-loop-through-ex.patch105
1 files changed, 105 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot/2011.12/0003-beagleboard-add-support-for-scanning-loop-through-ex.patch b/recipes-bsp/u-boot/u-boot/2011.12/0003-beagleboard-add-support-for-scanning-loop-through-ex.patch
new file mode 100644
index 00000000..c8bb1309
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot/2011.12/0003-beagleboard-add-support-for-scanning-loop-through-ex.patch
@@ -0,0 +1,105 @@
1From 4422038e69f79993cc21e3649715c9556e68413d Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Sun, 27 Nov 2011 14:53:56 +0100
4Subject: [PATCH 3/5] beagleboard: add support for scanning loop-through expansionboards like the uLCD-lite
5
6Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7---
8 board/ti/beagle/beagle.c | 30 ++++++++++++++++++++++++++----
9 include/configs/omap3_beagle.h | 2 ++
10 2 files changed, 28 insertions(+), 4 deletions(-)
11
12diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
13index 9c2e6d0..5ea50d1 100644
14--- a/board/ti/beagle/beagle.c
15+++ b/board/ti/beagle/beagle.c
16@@ -74,6 +74,7 @@ extern volatile struct ehci_hcor *hcor;
17 #define BBTOYS_WIFI 0x01000B00
18 #define BBTOYS_VGA 0x02000B00
19 #define BBTOYS_LCD 0x03000B00
20+#define BBTOYS_ULCD 0x04000B00
21 #define BEAGLE_NO_EEPROM 0xffffffff
22
23 DECLARE_GLOBAL_DATA_PTR;
24@@ -209,18 +210,18 @@ void get_board_mem_timings(u32 *mcfg, u32 *ctrla, u32 *ctrlb, u32 *rfr_ctrl,
25 * bus 1 for the availability of an AT24C01B serial EEPROM.
26 * returns the device_vendor field from the EEPROM
27 */
28-unsigned int get_expansion_id(void)
29+unsigned int get_expansion_id(int eeprom_address)
30 {
31 i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
32
33 /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */
34- if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
35+ if (i2c_probe(eeprom_address) == 1) {
36 i2c_set_bus_num(TWL4030_I2C_BUS);
37 return BEAGLE_NO_EEPROM;
38 }
39
40 /* read configuration data */
41- i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
42+ i2c_read(eeprom_address, 0, 1, (u8 *)&expansion_config,
43 sizeof(expansion_config));
44
45 i2c_set_bus_num(TWL4030_I2C_BUS);
46@@ -323,7 +324,7 @@ int misc_init_r(void)
47 TWL4030_PM_RECEIVER_DEV_GRP_P1);
48 }
49
50- switch (get_expansion_id()) {
51+ switch (get_expansion_id(EXPANSION_EEPROM_I2C_ADDRESS)) {
52 case TINCANTOOLS_ZIPPY:
53 printf("Recognized Tincantools Zippy board (rev %d %s)\n",
54 expansion_config.revision,
55@@ -402,6 +403,27 @@ int misc_init_r(void)
56 if (expansion_config.content == 1)
57 setenv(expansion_config.env_var, expansion_config.env_setting);
58
59+ /* Scan 0x51 as well for loop-thru boards */
60+ switch (get_expansion_id(EXPANSION_EEPROM_I2C_ADDRESS + 1)) {
61+ case BBTOYS_ULCD:
62+ printf("Recognized BeagleBoardToys uLCD-lite board\n");
63+ setenv("buddy2", "bbtoys-ulcd");
64+ setenv("defaultdisplay", "lcd");
65+ 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");
66+ break;
67+ case BEAGLE_NO_EEPROM:
68+ printf("No EEPROM on expansion board\n");
69+ setenv("buddy2", "none");
70+ break;
71+ default:
72+ printf("Unrecognized expansion board: %x\n",
73+ expansion_config.device_vendor);
74+ setenv("buddy2", "unknown");
75+ }
76+
77+ if (expansion_config.content == 1)
78+ setenv(expansion_config.env_var, expansion_config.env_setting);
79+
80 twl4030_power_init();
81 switch (get_board_revision()) {
82 case REVISION_XM_A:
83diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
84index d4f33d0..04d3eed 100644
85--- a/include/configs/omap3_beagle.h
86+++ b/include/configs/omap3_beagle.h
87@@ -214,6 +214,7 @@
88 "console=ttyO2,115200n8\0" \
89 "mpurate=auto\0" \
90 "buddy=none "\
91+ "buddy2=none "\
92 "optargs=\0" \
93 "camera=none\0" \
94 "vram=12M\0" \
95@@ -240,6 +241,7 @@
96 "${optargs} " \
97 "mpurate=${mpurate} " \
98 "buddy=${buddy} "\
99+ "buddy2=${buddy2} "\
100 "camera=${camera} "\
101 "vram=${vram} " \
102 "omapfb.mode=dvi:${dvimode} " \
103--
1041.7.2.5
105