From b5abf644aa6d1d11023df449a251d0f296c45b89 Mon Sep 17 00:00:00 2001 From: Ajay Kumar Gupta Date: Thu, 10 Jun 2010 11:20:49 +0530 Subject: omap3evm: Add board revision function Added function to differentiate between the OMAP3EVM revisions. The chip-id of the ethernet PHY is being used for this purpose. Rev A to D : 0x01150000 Rev >= E : 0x92200000 CC: Remy Bohmer Signed-off-by: Vaibhav Hiremath Signed-off-by: Sanjeev Premi Signed-off-by: Ajay Kumar Gupta Acked-by: Sandeep Paulraj --- board/ti/evm/evm.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'board/ti/evm/evm.c') diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index 0718a08..fcc1803 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -37,6 +37,33 @@ #include #include "evm.h" +static u8 omap3_evm_version; + +u8 get_omap3_evm_rev(void) +{ + return omap3_evm_version; +} + +static void omap3_evm_get_revision(void) +{ + unsigned int smsc_id; + + /* Ethernet PHY ID is stored at ID_REV register */ + smsc_id = readl(CONFIG_SMC911X_BASE + 0x50) & 0xFFFF0000; + printf("Read back SMSC id 0x%x\n", smsc_id); + + switch (smsc_id) { + /* SMSC9115 chipset */ + case 0x01150000: + omap3_evm_version = OMAP3EVM_BOARD_GEN_1; + break; + /* SMSC 9220 chipset */ + case 0x92200000: + default: + omap3_evm_version = OMAP3EVM_BOARD_GEN_2; + } +} + /* * Routine: board_init * Description: Early hardware init. @@ -121,6 +148,9 @@ 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 From 944a4894c047f9fc17d21f1e4ca92d5909b8405b Mon Sep 17 00:00:00 2001 From: Ajay Kumar Gupta Date: Thu, 10 Jun 2010 11:20:50 +0530 Subject: musb: Program extvbus for OMAP3EVM Rev >= E OMAP3EVM Rev >=E uses external Vbus supply so setting 'extvbus' to '1' for OMAP3EVM Rev >=E runtime based on EVM revision. CC: Remy Bohmer Signed-off-by: Ajay Kumar Gupta --- board/ti/evm/evm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'board/ti/evm/evm.c') diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index fcc1803..9948b9c 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -65,6 +65,19 @@ static void omap3_evm_get_revision(void) } /* + * MUSB port on OMAP3EVM Rev >= E requires extvbus programming. + */ +u8 omap3_evm_need_extvbus(void) +{ + u8 retval = 0; + + if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) + retval = 1; + + return retval; +} + +/* * Routine: board_init * Description: Early hardware init. */ -- cgit v1.1