summaryrefslogtreecommitdiff
path: root/cpu/arm_cortexa8/omap3/sys_info.c
diff options
context:
space:
mode:
authorSanjeev Premi <premi@ti.com>2009-04-27 21:27:54 +0530
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2009-04-29 21:11:49 +0200
commitcba0b778dd5f1ea32959b6825c7f0a31501a99d5 (patch)
treee669eb53350b92adef4aa44e4b1c262d74246ee1 /cpu/arm_cortexa8/omap3/sys_info.c
parent90006e9b33bcdbf241b0295d186e3634137907a9 (diff)
downloadu-boot-imx-cba0b778dd5f1ea32959b6825c7f0a31501a99d5.zip
u-boot-imx-cba0b778dd5f1ea32959b6825c7f0a31501a99d5.tar.gz
u-boot-imx-cba0b778dd5f1ea32959b6825c7f0a31501a99d5.tar.bz2
OMAP3: Print correct silicon revision
The function display_board_info() displays incorrect silicon revision - based on the return value from function get_cpu_rev(). This patch fixes the problem. Signed-off-by: Sanjeev Premi <premi@ti.com>
Diffstat (limited to 'cpu/arm_cortexa8/omap3/sys_info.c')
-rw-r--r--cpu/arm_cortexa8/omap3/sys_info.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/cpu/arm_cortexa8/omap3/sys_info.c b/cpu/arm_cortexa8/omap3/sys_info.c
index fb240df..2f04cd6 100644
--- a/cpu/arm_cortexa8/omap3/sys_info.c
+++ b/cpu/arm_cortexa8/omap3/sys_info.c
@@ -35,6 +35,12 @@ extern omap3_sysinfo sysinfo;
static gpmc_csx_t *gpmc_cs_base = (gpmc_csx_t *)GPMC_CONFIG_CS0_BASE;
static sdrc_t *sdrc_base = (sdrc_t *)OMAP34XX_SDRC_BASE;
static ctrl_t *ctrl_base = (ctrl_t *)OMAP34XX_CTRL_BASE;
+static char *rev_s[CPU_3XX_MAX_REV] = {
+ "1.0",
+ "2.0",
+ "2.1",
+ "3.0",
+ "3.1"};
/*****************************************************************
* dieid_num_r(void) - read and set die ID
@@ -76,18 +82,27 @@ u32 get_cpu_type(void)
u32 get_cpu_rev(void)
{
u32 cpuid = 0;
+ ctrl_id_t *id_base;
/*
* On ES1.0 the IDCODE register is not exposed on L4
- * so using CPU ID to differentiate
- * between ES2.0 and ES1.0.
+ * so using CPU ID to differentiate between ES1.0 and > ES1.0.
*/
__asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r"(cpuid));
if ((cpuid & 0xf) == 0x0)
- return CPU_3430_ES1;
- else
- return CPU_3430_ES2;
+ return CPU_3XX_ES10;
+ else {
+ /* Decode the IDs on > ES1.0 */
+ id_base = (ctrl_id_t *) OMAP34XX_ID_L4_IO_BASE;
+ cpuid = (readl(&id_base->idcode) >> CPU_3XX_ID_SHIFT) & 0xf;
+
+ /* Some early ES2.0 seem to report ID 0, fix this */
+ if(cpuid == 0)
+ cpuid = CPU_3XX_ES20;
+
+ return cpuid;
+ }
}
/****************************************************
@@ -277,8 +292,8 @@ int print_cpuinfo (void)
sec_s = "?";
}
- printf("OMAP%s-%s rev %d, CPU-OPP2 L3-165MHz\n", cpu_s,
- sec_s, get_cpu_rev());
+ printf("OMAP%s-%s ES%s, CPU-OPP2 L3-165MHz\n",
+ cpu_s, sec_s, rev_s[get_cpu_rev()]);
return 0;
}