From decf58f0430193f8d82c7ccfc7c84687fe63b64c Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 28 Nov 2008 10:16:42 +0000 Subject: [PATCH] qi-gta03-get-dynamic-board-rev.patch Signed-off-by: Andy Green --- qiboot/src/cpu/s3c6410/gta03.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/qiboot/src/cpu/s3c6410/gta03.c b/qiboot/src/cpu/s3c6410/gta03.c index 167746f..b8beb83 100644 --- a/qiboot/src/cpu/s3c6410/gta03.c +++ b/qiboot/src/cpu/s3c6410/gta03.c @@ -369,15 +369,15 @@ void port_init_gta03(void) /* ---------------------------- Port I ---------------------------- */ __REG(GPICON) = - (2 << 0) | /* GPI0 - LCD_VD0 */ - (2 << 2) | /* GPI1 - LCD_VD1 */ + (0 << 0) | /* GPI0 - INPUT version b0 */ + (0 << 2) | /* GPI1 - INPUT version b1 */ (2 << 4) | /* GPI2 - LCD_VD2 */ (2 << 6) | /* GPI3 - LCD_VD3 */ (2 << 8) | /* GPI4 - LCD_VD4 */ (2 << 10) | /* GPI5 - LCD_VD5 */ (2 << 12) | /* GPI6 - LCD_VD6 */ (2 << 14) | /* GPI7 - LCD_VD7 */ - (2 << 16) | /* GPI8 - LCD_VD8 */ + (0 << 16) | /* GPI8 - INPUT version b2 */ (2 << 18) | /* GPI9 - LCD_VD9 */ (2 << 20) | /* GPI10 - LCD_VD10 */ (2 << 22) | /* GPI11 - LCD_VD11 */ @@ -777,15 +777,14 @@ void port_init_gta03(void) } -/** - * returns PCB revision information in b0, d8, d9 - * GTA03 EVB returns 0x000 - * GTA03 returns 0x001 - */ - int gta03_get_pcb_revision(void) { - return 0; /* always SMDK right now */ + u32 v = __REG(GPIDAT); + + return (v & (1 << 8)) >> (8 - 2) | + (v & (1 << 1)) >> 0 | + (v & (1 << 0)) >> 0 + ; } const struct board_variant const * get_board_variant_gta03(void)