omap3evm: Move function to identify board revision
PATCH 1/1 omap3evm: Move function 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.
Moved the function and added detailed comment to set the context.
--- board/ti/evm/evm.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
board/ti/evm/evm.c +6 -3
@@ -109,6 +109,12 @@ int misc_init_r(void)#if defined(CONFIG_CMD_NET )setup_net_chip (); + +/* +* Board revision can be ascertained only by identifying +* the Ethernet chipset. +*/ +omap3_evm_get_revision ();#endif dieid_num_r ();
@@ -163,9 +169,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)
Signature · 1 line
1.7.2.2
Premi
PATCH 1/1 omap3evm: Move function to identify board revision
Quoted 27 lines
-----Original Message-----
From: Premi, Sanjeev
Sent: Tuesday, October 19, 2010 6:37 PM
To: u-boot at lists.denx.de
Cc: Premi, Sanjeev
Subject: [PATCH] omap3evm: Move function to identify board revisionFunction
omap3_evm_get_revision()- to identify the board revision was called at end ofsetup_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.
Moved the function and added detailed comment to set the context.
Signed-off-by Sanjeev Premi <[email protected]>--- board/ti/evm/evm.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)board/ti/evm/evm.c +0
-0
board/ti/evm/evm.c int misc_init_r(void) · line 118
Quoted 10 lines
board/ti/evm/evm.c +6
-0@@ -109,6 +109,12 @@ int misc_init_r(void)#if defined(CONFIG_CMD_NET )setup_net_chip (); + +/* +* Board revision can be ascertained only by identifying +* the Ethernet chipset. +*/ +omap3_evm_get_revision ();#endif
[sp] While reviewing the code, I realized a "latent" bug that
can hit us when CONFIG_CMD_NET is not defined.
omap3_evm_get_revision() never gets called - value of omap3_evm_version is never set. So, value returned by get_omap3_evm_rev() depends upon compiler used.
Please disregard this patch. I will submit a cleaned-up patch with takes care of this "latent" bug as well.
~sanjeev
Quoted 16 lines
board/ti/evm/evm.c +0
-3dieid_num_r ();@@ -163,9 +169,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)Signature · 1 line
1.7.2.2