]> git.sur5r.net Git - u-boot/commitdiff
omap3evm: Add board revision function
authorAjay Kumar Gupta <ajay.gupta@ti.com>
Thu, 10 Jun 2010 05:50:49 +0000 (11:20 +0530)
committerRemy Bohmer <linux@bohmer.net>
Wed, 30 Jun 2010 19:37:37 +0000 (21:37 +0200)
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 <linux@bohmer.net>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: Sandeep Paulraj <s-paulraj@ti.com>
board/ti/evm/evm.c
board/ti/evm/evm.h

index 0718a08308afe1488aa5cce53f7bda1c4fb15fa0..fcc1803bcd4f1a221f529949791f63c6631c9e87 100644 (file)
 #include <asm/mach-types.h>
 #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)
index 37da29d7ad9ac6ed5b578d3e8668f9b6d1e9ae98..e2581f6bf10de7ec5f9ac892a59db044514cfd77 100644 (file)
@@ -33,6 +33,20 @@ const omap3_sysinfo sysinfo = {
 #endif
 };
 
+/*
+ * OMAP35x EVM revision
+ * Run time detection of EVM revision is done by reading Ethernet
+ * PHY ID -
+ *      GEN_1   = 0x01150000
+ *      GEN_2   = 0x92200000
+ */
+enum {
+       OMAP3EVM_BOARD_GEN_1 = 0,       /* EVM Rev between  A - D */
+       OMAP3EVM_BOARD_GEN_2,           /* EVM Rev >= Rev E */
+};
+
+u8 get_omap3_evm_rev(void);
+
 static void setup_net_chip(void);
 
 /*