summaryrefslogtreecommitdiff
path: root/board/cm_t35/eeprom.c
diff options
context:
space:
mode:
authorNikita Kiryanov <nikita@compulab.co.il>2012-05-24 04:01:22 (GMT)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-07-07 12:07:24 (GMT)
commit6f3b300c0a324725e468f496f89372388ff5ee66 (patch)
treed251d0a973b52915d2afd3947d4139d07ff17ea5 /board/cm_t35/eeprom.c
parent390cdcda1b1d07eb054120e9bdfc4374b6ef8f6e (diff)
downloadu-boot-fsl-qoriq-6f3b300c0a324725e468f496f89372388ff5ee66.tar.xz
cm-t35: fix incorrect BOARD_REV_SIZE value
Non-legacy layouts have an extended revision field, but only the first 2 bytes are the PCB revision. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Diffstat (limited to 'board/cm_t35/eeprom.c')
-rw-r--r--board/cm_t35/eeprom.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/board/cm_t35/eeprom.c b/board/cm_t35/eeprom.c
index dfa171d..6053811 100644
--- a/board/cm_t35/eeprom.c
+++ b/board/cm_t35/eeprom.c
@@ -27,8 +27,7 @@
#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 BOARD_REV_SIZE 2
#define MAC_ADDR_OFFSET 4
#define MAC_ADDR_OFFSET_LEGACY 0
@@ -107,17 +106,14 @@ 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) {
+ if (eeprom_layout != LAYOUT_LEGACY)
offset = BOARD_REV_OFFSET;
- len = BOARD_REV_SIZE;
- }
- if (cm_t3x_eeprom_read(offset, (uchar *)&rev, len))
+ if (cm_t3x_eeprom_read(offset, (uchar *)&rev, BOARD_REV_SIZE))
return 0;
return rev;