public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] OMAP3: Print correct silicon revision
@ 2009-04-21 16:23 Sanjeev Premi
  2009-04-21 16:55 ` Dirk Behme
  2009-04-22 21:20 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 11+ messages in thread
From: Sanjeev Premi @ 2009-04-21 16:23 UTC (permalink / raw)
  To: u-boot

The function display_board_info() displays the silicon
revision as 2 - based on the return value from get_cpu_rev().

This is incorrect as the current Si version is 3.1

This patch displays the correct version; but does not
change get_cpu_rev() to minimize the code impact.

Signed-off-by: Sanjeev Premi <premi@ti.com>
---
 cpu/arm_cortexa8/omap3/sys_info.c |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/cpu/arm_cortexa8/omap3/sys_info.c b/cpu/arm_cortexa8/omap3/sys_info.c
index b385b91..8c6a4d6 100644
--- a/cpu/arm_cortexa8/omap3/sys_info.c
+++ b/cpu/arm_cortexa8/omap3/sys_info.c
@@ -36,6 +36,8 @@ 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 omap_revision[8] = "";
+
 /*****************************************************************
  * dieid_num_r(void) - read and set die ID
  *****************************************************************/
@@ -90,6 +92,36 @@ u32 get_cpu_rev(void)
 
 }
 
+/**
+ * Converts cpu revision into a string
+ */
+void set_omap_revision(void)
+{
+	u32 idcode;
+	ctrl_id_t *id_base;
+	char *str_rev = &omap_revision[0];
+
+	if (get_cpu_rev() == CPU_3430_ES1) {
+		strcat (str_rev, "ES1.0");
+	}
+	else {
+		id_base = (ctrl_id_t *)OMAP34XX_ID_L4_IO_BASE;
+
+		idcode = readl(&id_base->idcode);
+
+		if (idcode == 0x1B7AE02F)
+			strcat (str_rev, "ES2.0");
+		else if (idcode == 0x2B7AE02F)
+			strcat (str_rev, "ES2.1");
+		else if (idcode == 0x3B7AE02F)
+			strcat (str_rev, "ES3.0");
+		else if (idcode == 0x4B7AE02F)
+			strcat (str_rev, "ES3.1");
+		else
+			strcat (str_rev, "ES??");
+	}
+}
+
 /****************************************************
  * is_mem_sdr() - return 1 if mem type in use is SDR
  ****************************************************/
@@ -232,9 +264,10 @@ void display_board_info(u32 btype)
 		sec_s = "?";
 	}
 
+	set_omap_revision();
 
-	printf("OMAP%s-%s rev %d, CPU-OPP2 L3-165MHz\n", cpu_s,
-	       sec_s, get_cpu_rev());
+	printf("OMAP%s-%s (%s), CPU-OPP2 L3-165MHz\n", cpu_s,
+	       sec_s, omap_revision);
 	printf("%s + %s/%s\n", sysinfo.board_string,
 	       mem_s, sysinfo.nand_string);
 
-- 
1.6.2.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-04-23 14:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-21 16:23 [U-Boot] [PATCH] OMAP3: Print correct silicon revision Sanjeev Premi
2009-04-21 16:55 ` Dirk Behme
2009-04-21 18:06   ` Premi, Sanjeev
2009-04-21 18:33     ` Dirk Behme
2009-04-21 18:25   ` Premi, Sanjeev
2009-04-21 19:34     ` Dirk Behme
2009-04-21 19:38       ` Premi, Sanjeev
2009-04-22 11:40       ` Premi, Sanjeev
2009-04-22 15:40         ` Dirk Behme
2009-04-22 21:20 ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-23 14:45   ` Dirk Behme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox