From 52ce907d40074d92c5044ac2fbe5c267b166a4ee Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Tue, 29 Oct 2013 16:11:16 -0700 Subject: lm4: Properly identify TM4 chip used on haswell/baytrail systems This chip returns ver/family/partno = 0x10de, as indicated by the datasheet. Also switch the identification code to use a switch statement rather than re-reading the DID1 register in if-then-else. BUG=chrome-os-partner:23679 BRANCH=none (maybe haswell branches, but it's largely cosmetic) TEST=version command on rambi identifies the chip as ti tm4e1g31h6zrb B1 Change-Id: I4a3748413de65d3116feb7c444f5a2af5953eecd Signed-off-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/175008 Reviewed-by: Vic Yang --- chip/lm4/system.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/chip/lm4/system.c b/chip/lm4/system.c index 05f6def1bd..589a10c99e 100644 --- a/chip/lm4/system.c +++ b/chip/lm4/system.c @@ -513,17 +513,20 @@ const char *system_get_chip_id_string(void) const char *system_get_raw_chip_name(void) { - if ((LM4_SYSTEM_DID1 & 0xffff0000) == 0x10e20000) { + switch ((LM4_SYSTEM_DID1 & 0xffff0000) >> 16) { + case 0x10de: + return "tm4e1g31h6zrb"; + case 0x10e2: return "lm4fsxhh5bb"; - } else if ((LM4_SYSTEM_DID1 & 0xffff0000) == 0x10e30000) { + case 0x10e3: return "lm4fs232h5bb"; - } else if ((LM4_SYSTEM_DID1 & 0xffff0000) == 0x10e40000) { + case 0x10e4: return "lm4fs99h5bb"; - } else if ((LM4_SYSTEM_DID1 & 0xffff0000) == 0x10e60000) { + case 0x10e6: return "lm4fs1ah5bb"; - } else if ((LM4_SYSTEM_DID1 & 0xffff0000) == 0x10ea0000) { + case 0x10ea: return "lm4fs1gh5bb"; - } else { + default: return system_get_chip_id_string(); } } -- cgit v1.2.1