summaryrefslogtreecommitdiff
path: root/board/cm_t35/cm_t35.c
diff options
context:
space:
mode:
authorNikita Kiryanov <nikita@compulab.co.il>2012-05-24 04:01:24 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-07-07 14:07:24 +0200
commit8c318eb3a0db27ea7f0ae3e7be42f5b4b375cf3b (patch)
tree51ee450a3218dbefc1251cca38e540ddc4b35df6 /board/cm_t35/cm_t35.c
parent2ef6302f8728d52ee4fb3b169be5dc6becae566f (diff)
downloadu-boot-8c318eb3a0db27ea7f0ae3e7be42f5b4b375cf3b.tar.gz
cm-t35: print PCB revision information
Buffer the PCB revision to avoid multiple eeprom accesses for the same data and print it as a part of board information. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'board/cm_t35/cm_t35.c')
-rw-r--r--board/cm_t35/cm_t35.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/board/cm_t35/cm_t35.c b/board/cm_t35/cm_t35.c
index 89e6b08e7f..700c184944 100644
--- a/board/cm_t35/cm_t35.c
+++ b/board/cm_t35/cm_t35.c
@@ -99,6 +99,39 @@ int board_init(void)
return 0;
}
+static u32 cm_t3x_rev;
+
+/*
+ * Routine: get_board_rev
+ * Description: read system revision
+ */
+u32 get_board_rev(void)
+{
+ if (!cm_t3x_rev)
+ cm_t3x_rev = cm_t3x_eeprom_get_board_rev();
+
+ return cm_t3x_rev;
+};
+
+/*
+ * Routine: misc_init_r
+ * Description: display die ID
+ */
+int misc_init_r(void)
+{
+ u32 board_rev = get_board_rev();
+ u32 rev_major = board_rev / 100;
+ u32 rev_minor = board_rev - (rev_major * 100);
+
+ if ((rev_minor / 10) * 10 == rev_minor)
+ rev_minor = rev_minor / 10;
+
+ printf("PCB: %u.%u\n", rev_major, rev_minor);
+ dieid_num_r();
+
+ return 0;
+}
+
/*
* Routine: set_muxconf_regs
* Description: Setting up the configuration Mux registers specific to the