From 4258aa62fbf4e001314624d09bcc94b3027c5670 Mon Sep 17 00:00:00 2001
From: Peter Meerwald
Date: Wed, 8 Feb 2012 05:24:26 +0000
Subject: [PATCH] beagle: enable DVI_PUP
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
---
board/ti/beagle/beagle.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 87578763bb..c09c833980 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -251,6 +251,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
@@ -422,6 +454,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();
--
2.34.1