aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Kiryanov <nikita@compulab.co.il>2012-01-02 04:01:34 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-01-16 08:40:11 +0100
commit7d3c97d71ffe3d0cf8df00228ba18c79746fdf50 (patch)
tree0337ecc97fec4d8861dae9be31ad3dc6cb39f6a9
parent715462dd7ec56f2410a98a4cd8fe8203132871dd (diff)
downloadu-boot-7d3c97d71ffe3d0cf8df00228ba18c79746fdf50.zip
u-boot-7d3c97d71ffe3d0cf8df00228ba18c79746fdf50.tar.gz
u-boot-7d3c97d71ffe3d0cf8df00228ba18c79746fdf50.tar.bz2
cm-t35: pass correct revision information to Linux
Read revision from EEPROM and pass it to Linux. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
-rw-r--r--board/cm_t35/eeprom.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/board/cm_t35/eeprom.c b/board/cm_t35/eeprom.c
index 93ed6cb..b3d332f 100644
--- a/board/cm_t35/eeprom.c
+++ b/board/cm_t35/eeprom.c
@@ -25,6 +25,10 @@
#define EEPROM_LAYOUT_VER_OFFSET 44
#define BOARD_SERIAL_OFFSET 20
#define BOARD_SERIAL_OFFSET_LEGACY 8
+#define BOARD_REV_OFFSET 0
+#define BOARD_REV_OFFSET_LEGACY 6
+#define BOARD_REV_SIZE 4
+#define BOARD_REV_SIZE_LEGACY 2
#define LAYOUT_INVALID 0
#define LAYOUT_LEGACY 0xff
@@ -76,3 +80,27 @@ void get_board_serial(struct tag_serialnr *serialnr)
serialnr->high = serial[1];
}
}
+
+/*
+ * Routine: get_board_rev
+ * Description: read system revision
+ */
+u32 get_board_rev(void)
+{
+ u32 rev = 0;
+ uint offset = BOARD_REV_OFFSET_LEGACY;
+ int len = BOARD_REV_SIZE_LEGACY;
+
+ if (eeprom_setup_layout())
+ return 0;
+
+ if (eeprom_layout != LAYOUT_LEGACY) {
+ offset = BOARD_REV_OFFSET;
+ len = BOARD_REV_SIZE;
+ }
+
+ if (cm_t3x_eeprom_read(offset, (uchar *)&rev, len))
+ return 0;
+
+ return rev;
+};