overo: handle board revision detection for fab revisions <= R2410
authorSteve Sakoman <steve@sakoman.com>
Fri, 17 Sep 2010 03:44:52 +0000 (20:44 -0700)
committerSteve Sakoman <steve@sakoman.com>
Fri, 17 Sep 2010 03:44:52 +0000 (20:44 -0700)
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

index 4ca1ecf..68ee13c 100644 (file)
@@ -30,6 +30,7 @@
 #include <command.h>
 #include <part.h>
 #include <fat.h>
+#include <i2c.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/bits.h>
 #include <asm/arch/gpio.h>
@@ -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) &&