u-boot 2011.09: probe ddc bus for eeproms as well on beagleboard, add beaconboard...
authorKoen Kooi <koen@dominion.thruhere.net>
Sun, 9 Oct 2011 13:58:43 +0000 (15:58 +0200)
committerKoen Kooi <koen@dominion.thruhere.net>
Sun, 9 Oct 2011 13:58:43 +0000 (15:58 +0200)
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
recipes-bsp/u-boot/u-boot/2011.09/0001-beagleboard-add-support-for-TCT-Beacon-board.patch [new file with mode: 0644]
recipes-bsp/u-boot/u-boot/2011.09/0001-beagleboard-probe-DDC-bus-for-expansionboard-EEPROMS.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-TCT-Beacon-board.patch b/recipes-bsp/u-boot/u-boot/2011.09/0001-beagleboard-add-support-for-TCT-Beacon-board.patch
new file mode 100644 (file)
index 0000000..bf828f6
--- /dev/null
@@ -0,0 +1,39 @@
+From f6ce74793e6341895153e43643460b7fc812dc9d Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Sat, 8 Oct 2011 21:56:35 +0200
+Subject: [PATCH] beagleboard: add support for TCT Beacon board
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ board/ti/beagle/beagle.c |    8 ++++++++
+ 1 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
+index 8cdceaf..be40e96 100644
+--- a/board/ti/beagle/beagle.c
++++ b/board/ti/beagle/beagle.c
+@@ -62,6 +62,7 @@ extern volatile struct ehci_hcor *hcor;
+ #define TINCANTOOLS_ZIPPY2            0x02000100
+ #define TINCANTOOLS_TRAINER           0x04000100
+ #define TINCANTOOLS_SHOWDOG           0x03000100
++#define TINCANTOOLS_BEACON            0x05000100
+ #define KBADC_BEAGLEFPGA              0x01000600
+ #define LW_BEAGLETOUCH                        0x01000700
+ #define BRAINMUX_LCDOG                        0x01000800
+@@ -290,6 +291,13 @@ int misc_init_r(void)
+               setenv("defaultdisplay", "showdoglcd");
+               setenv("buddy", "showdog");
+               break;
++      case TINCANTOOLS_BEACON:
++              printf("Recognized Tincantools Beacon board (rev %d %s)\n",
++                      expansion_config.revision,
++                      expansion_config.fab_revision);
++              /* Place holder for DSS2 definition for showdog lcd */
++              setenv("buddy", "beacon");
++              break;
+       case KBADC_BEAGLEFPGA:
+               printf("Recognized KBADC Beagle FPGA board\n");
+               MUX_KBADC_BEAGLEFPGA();
+-- 
+1.6.6.1
+
diff --git a/recipes-bsp/u-boot/u-boot/2011.09/0001-beagleboard-probe-DDC-bus-for-expansionboard-EEPROMS.patch b/recipes-bsp/u-boot/u-boot/2011.09/0001-beagleboard-probe-DDC-bus-for-expansionboard-EEPROMS.patch
new file mode 100644 (file)
index 0000000..4155d29
--- /dev/null
@@ -0,0 +1,165 @@
+From 559eb0f547267df0706d283974916b88d6b9fb7d Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Sun, 9 Oct 2011 15:55:05 +0200
+Subject: [PATCH] beagleboard: probe DDC bus for expansionboard EEPROMS as well
+
+Add beacon support as well, needs to get split into a seperate patch
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ board/ti/beagle/beagle.c       |   59 ++++++++++++++++++++++++++++++++++++++++
+ board/ti/beagle/beagle.h       |    7 +++++
+ include/configs/omap3_beagle.h |    7 +++++
+ 3 files changed, 73 insertions(+), 0 deletions(-)
+
+diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
+index 8cdceaf..f4e986c 100644
+--- a/board/ti/beagle/beagle.c
++++ b/board/ti/beagle/beagle.c
+@@ -57,11 +57,14 @@ extern volatile struct ehci_hcor *hcor;
+ #define TWL4030_I2C_BUS                       0
+ #define EXPANSION_EEPROM_I2C_BUS      1
+ #define EXPANSION_EEPROM_I2C_ADDRESS  0x50
++#define DVI_EDID_I2C_BUS      2
++#define DVI_EDID_I2C_ADDRESS  0x50
+ #define TINCANTOOLS_ZIPPY             0x01000100
+ #define TINCANTOOLS_ZIPPY2            0x02000100
+ #define TINCANTOOLS_TRAINER           0x04000100
+ #define TINCANTOOLS_SHOWDOG           0x03000100
++#define TINCANTOOLS_BEACON            0x05000100
+ #define KBADC_BEAGLEFPGA              0x01000600
+ #define LW_BEAGLETOUCH                        0x01000700
+ #define BRAINMUX_LCDOG                        0x01000800
+@@ -69,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;
+@@ -82,6 +86,16 @@ static struct {
+       char env_setting[64];
+ } expansion_config;
++static struct {
++    unsigned int device_vendor;
++    unsigned char revision;
++    unsigned char content;
++    char fab_revision[8];
++    char env_var[16];
++    char env_setting[64];
++} edid_config;
++
++
+ /*
+  * Routine: board_init
+  * Description: Early hardware init.
+@@ -165,6 +179,33 @@ unsigned int get_expansion_id(void)
+ }
+ /*
++ * Routine: get_edid
++ * Description: This function checks for expansion board by checking I2C
++ *      bus 2 for the availability of an EEPROM
++ *      returns the device_vendor field from the EEPROM
++ *      The content can be either real EDID data or expansionboard data.
++ *      Only expansionboar data is currently supported
++ */
++unsigned int get_edid(void)
++{
++      i2c_set_bus_num(DVI_EDID_I2C_BUS);
++
++      /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */
++      if (i2c_probe(DVI_EDID_I2C_ADDRESS) == 1) {
++              i2c_set_bus_num(TWL4030_I2C_BUS);
++              return BEAGLE_NO_EEPROM;
++      }
++
++      /* read EEPROM data */
++      i2c_read(DVI_EDID_I2C_ADDRESS, 0, 1, (u8 *)&edid_config,
++              sizeof(edid_config));
++
++      i2c_set_bus_num(TWL4030_I2C_BUS);
++
++      return edid_config.device_vendor;
++}
++
++/*
+  * Configure DSS to display background color on DVID
+  * Configure VENC to display color bar on S-Video
+  */
+@@ -290,6 +331,13 @@ int misc_init_r(void)
+               setenv("defaultdisplay", "showdoglcd");
+               setenv("buddy", "showdog");
+               break;
++      case TINCANTOOLS_BEACON:
++              printf("Recognized Tincantools Beacon board (rev %d %s)\n",
++                      expansion_config.revision,
++                      expansion_config.fab_revision);
++              MUX_TINCANTOOLS_BEACON();
++              setenv("buddy", "beacon");
++              break;
+       case KBADC_BEAGLEFPGA:
+               printf("Recognized KBADC Beagle FPGA board\n");
+               MUX_KBADC_BEAGLEFPGA();
+@@ -331,6 +379,17 @@ int misc_init_r(void)
+       if (expansion_config.content == 1)
+               setenv(expansion_config.env_var, expansion_config.env_setting);
++      switch(get_edid()) {
++      case BBTOYS_ULCD:
++              printf("Recognized BeagleBoardToys universal LCD board on DDC bus\n");
++              setenv("edid", "uLCD");
++              break;
++      default:
++              printf("Unrecognized EEPROM content on DDC bus: %x\n",
++                      edid_config.device_vendor);
++              setenv("edid", "unknown");
++      }
++
+       twl4030_power_init();
+       switch (get_board_revision()) {
+       case REVISION_XM_A:
+diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h
+index 18bfaa8..6a9ad73 100644
+--- a/board/ti/beagle/beagle.h
++++ b/board/ti/beagle/beagle.h
+@@ -456,6 +456,13 @@ const omap3_sysinfo sysinfo = {
+       MUX_VAL(CP(MCBSP3_CLKX),    (IEN  | PTU | EN  | M4)) /*GPIO_141*/\
+       MUX_VAL(CP(MCBSP1_CLKX),    (IEN  | PTU | EN  | M4)) /*GPIO_162*/
++#define MUX_TINCANTOOLS_BEACON() \
++      MUX_VAL(CP(MMC2_DAT3),      (IEN  | PTU | EN  | M4)) /*GPIO_135*/\
++      MUX_VAL(CP(MMC2_DAT4),      (IEN  | PTU | EN  | M4)) /*GPIO_136*/\
++      MUX_VAL(CP(MMC2_DAT5),      (IEN  | PTU | EN  | M4)) /*GPIO_137*/\
++      MUX_VAL(CP(MMC2_DAT6),      (IEN  | PTU | EN  | M4)) /*GPIO_138*/\
++      MUX_VAL(CP(MMC2_DAT7),      (IEN  | PTU | EN  | M4)) /*GPIO_139*/\
++
+ #define MUX_KBADC_BEAGLEFPGA() \
+       MUX_VAL(CP(MCBSP1_CLKR),    (IEN  | PTU | DIS | M1)) /*MCSPI4_CLK*/\
+       MUX_VAL(CP(MCBSP1_DX),      (IDIS | PTU | DIS | M1)) /*MCSPI4_SIMO*/\
+diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
+index 1369c89..73df658 100644
+--- a/include/configs/omap3_beagle.h
++++ b/include/configs/omap3_beagle.h
+@@ -219,6 +224,7 @@
+       "console=ttyS2,115200n8\0" \
+       "mpurate=auto\0" \
+       "buddy=none "\
++      "edid=none "\
+       "optargs=\0" \
+       "camera=none\0" \
+       "vram=12M\0" \
+@@ -235,6 +241,7 @@
+               "${optargs} " \
+               "mpurate=${mpurate} " \
+               "buddy=${buddy} "\
++              "edid=${edid} "\
+               "camera=${camera} "\
+               "vram=${vram} " \
+               "omapfb.mode=dvi:${dvimode} " \
+-- 
+1.6.6.1
+
index dad820f49a5548bf469afe56931e7bd15b75e4b0..d250f71eae0b0a1760257461e21f11aba1f1ade6 100644 (file)
@@ -1,5 +1,7 @@
 require u-boot.inc
 
+PR = "r1"
+
 # No patches for other machines yet
 COMPATIBLE_MACHINE = "(beagleboard)"
 
@@ -7,6 +9,7 @@ SRC_URI = "git://www.denx.de/git/u-boot.git;protocol=git \
            file://2011.09/0001-HACK-beagleboard-config-disable-cache-for-USB.patch \
            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-probe-DDC-bus-for-expansionboard-EEPROMS.patch \
            file://fw_env.config \
           "
 # v2011.09 tag -> 6ceb0135f96d73063ffbaab5be7ce23933367388