From a164723f6f8b8b1d47ed368ef78ec52008db0d44 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Thu, 16 Sep 2010 20:44:52 -0700 Subject: [PATCH] overo: handle board revision detection for fab revisions <= R2410 Revisions < R2410 connect gpio112 to the 4030 irq_1 line. Since gpio112 is now used for board revision, this could lead to an erroneous board revision results depending on the state of the irq. This patch forces a 4030 RTC interrupt, which pulls irq_1 low, giving a low level on gpio112 on these boards. This gives a proper revision 0 result for these boards. --- board/overo/overo.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/board/overo/overo.c b/board/overo/overo.c index 4ca1ecf..68ee13c 100644 --- a/board/overo/overo.c +++ b/board/overo/overo.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -350,6 +351,16 @@ u32 cpu_is_3410(void) int get_board_revision(void) { int revision; + unsigned char data; + + /* board revisions <= R2410 connect 4030 irq_1 to gpio112 */ + /* these boards should return a revision number of 0 */ + /* the code below forces a 4030 RTC irq to ensure that gpio112 is low */ + data = 0x01; + i2c_write(0x4B, 0x29, 1, &data, 1); + data = 0x0c; + i2c_write(0x4B, 0x2b, 1, &data, 1); + i2c_read(0x4B, 0x2a, 1, &data, 1); if (!omap_request_gpio(112) && !omap_request_gpio(113) && -- 2.39.5