From 63f42400e50c7ebede2974b421db765324ad8c8e Mon Sep 17 00:00:00 2001 From: Sanjeev Premi Date: Thu, 4 Nov 2010 16:02:29 -0400 Subject: omap3evm: Wrap function under CONFIG_USB_OMAP3 The function omap3_evm_need_extvbus() is required only when USB support is configured. Wrapped this function in #ifdef CONFIG_USB_OMAP3. Signed-off-by: Sanjeev Premi Signed-off-by: Sandeep Paulraj --- board/ti/evm/evm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'board/ti/evm/evm.c') diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index 9948b9c..73330db 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -64,6 +64,7 @@ static void omap3_evm_get_revision(void) } } +#ifdef CONFIG_USB_OMAP3 /* * MUSB port on OMAP3EVM Rev >= E requires extvbus programming. */ @@ -76,6 +77,7 @@ u8 omap3_evm_need_extvbus(void) return retval; } +#endif /* * Routine: board_init -- cgit v1.1 From 76ee9a2c3ba0b642e61ad282386953fcdfc659c7 Mon Sep 17 00:00:00 2001 From: Sanjeev Premi Date: Thu, 4 Nov 2010 16:02:32 -0400 Subject: omap3evm: Fix mechanism to identify board revision Function omap3_evm_get_revision() - to identify the board revision was called at end of setup_net_chip(). Board revision can be ascertained only by identifying the Ethernet chipset - but combining setup operations with revision detection isn't a good idea. So, moved the function after call to setup_net_chip(). Function setup_net_chip() should be ideally be called only when CONFIG_CMD_NET is defined. But this leaves the board revision "undetected". This patch allows static definition of revision or default fallback to the latest revision. Signed-off-by: Sanjeev Premi Signed-off-by: Sandeep Paulraj --- board/ti/evm/evm.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'board/ti/evm/evm.c') diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index 73330db..09d14f7 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -46,6 +46,11 @@ u8 get_omap3_evm_rev(void) static void omap3_evm_get_revision(void) { +#if defined(CONFIG_CMD_NET) + /* + * Board revision can be ascertained only by identifying + * the Ethernet chipset. + */ unsigned int smsc_id; /* Ethernet PHY ID is stored at ID_REV register */ @@ -62,6 +67,19 @@ static void omap3_evm_get_revision(void) default: omap3_evm_version = OMAP3EVM_BOARD_GEN_2; } +#else +#if defined(CONFIG_STATIC_BOARD_REV) + /* + * Look for static defintion of the board revision + */ + omap3_evm_version = CONFIG_STATIC_BOARD_REV; +#else + /* + * Fallback to the default above. + */ + omap3_evm_version = OMAP3EVM_BOARD_GEN_2; +#endif +#endif /* CONFIG_CMD_NET */ } #ifdef CONFIG_USB_OMAP3 @@ -110,6 +128,7 @@ int misc_init_r(void) #if defined(CONFIG_CMD_NET) setup_net_chip(); #endif + omap3_evm_get_revision(); dieid_num_r(); @@ -163,9 +182,6 @@ static void setup_net_chip(void) writel(GPIO0, &gpio3_base->cleardataout); udelay(1); writel(GPIO0, &gpio3_base->setdataout); - - /* determine omap3evm revision */ - omap3_evm_get_revision(); } int board_eth_init(bd_t *bis) -- cgit v1.1