[U-Boot] [PATCH] beagle: enable DVI_PUP

Peter Meerwald pmeerw at pmeerw.net
Wed Feb 8 16:24:26 CET 2012


From: Peter Meerwald <p.meerwald at bct-electronic.com>

this patch addresses the issue that there is no DVI output on beagleboard-xm in
u-boot; the TFP410 is not powered on, DVI_PUP needs to be set high

this is done differently on beagleboard-xm rev. B/C versus earlier boards:
beagleboard-xm B/C need to set GPIO2 of the TWL4030
earlier boards need to set GPIO170

note that the change occured somewhere inbetween beagleboard-xm rev. A2 and A3

note that beagleboard-xm rev. A and rev. B cannot be distinguished using 
get_board_revision(), REVISION_XM_A/REVISION_XM_B is bogus

due to this glitch, the patch cannot work correctly on some beagleboard-xm 
rev A/B boards

tested on beagleboard-xm rev. C (you should see orange color on a monitor)


note that the framebuffer is NOT yet set up, this could be done along the 
lines below (for 800x480 resolution and RGB24) before calling omap3_dss_enable()

static void configure_frame_buffer() {
	writel(0x80500000, (uint *) 0x48050480); // address
	writel(0x80500000, (uint *) 0x48050484);
	writel(0x01df031f, (uint *) 0x4805048c); // size
	writel(0x00000091, (uint *) 0x480504a0); // RGB24
}

Signed-off-by: Peter Meerwald <p.meerwald at bct-electronic.com>

---
 board/ti/beagle/beagle.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 5c04b34..79f7f44 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -249,6 +249,38 @@ void beagle_display_init(void)
 }
 
 /*
+ * Enable DVI power
+ */
+static void beagle_dvi_pup() {
+	uchar val;
+
+	switch (get_board_revision()) {
+	case REVISION_AXBX:
+	case REVISION_CX:
+	case REVISION_C4:
+	case REVISION_XM_A:
+		gpio_request(170, "");
+		gpio_direction_output(170, 0);
+		gpio_set_value(170, 1);
+		break;
+	case REVISION_XM_B:
+	case REVISION_XM_C:
+	default:
+		#define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3)
+		#define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6)
+
+		i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
+		val |= 4;
+		i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
+
+		i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
+		val |= 4;
+		i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
+		break;
+	}
+}
+
+/*
  * Routine: misc_init_r
  * Description: Configure board specific parts
  */
@@ -419,6 +451,8 @@ int misc_init_r(void)
 		GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe);
 
 	dieid_num_r();
+
+	beagle_dvi_pup();
 	beagle_display_init();
 	omap3_dss_enable();
 
-- 
1.7.4.1



More information about the U-Boot mailing list