In the register $PCR the bitfield SV (SoC Version) determines on which
SoC iteration we are (e.g., KV2, KV3, etc.), whereas CAR (Core
ARchitecture Revision) determines the Revision within each iteration,
e.g., KV3-1, KV3-2, etc. Since this port is only for KV3, SV should not
change anyway. But CAR changes depending on the revision. So fix the SoC
info driver to give out the right SoC version/revision string.

Reviewed-by: Yann Sionneau <ysionn...@kalrayinc.com>
Signed-off-by: Julian Vetter <jvet...@kalrayinc.com>
---
 drivers/soc/kvx/kvx_socinfo.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/kvx/kvx_socinfo.c b/drivers/soc/kvx/kvx_socinfo.c
index 87c20c327b..5f28f08bfb 100644
--- a/drivers/soc/kvx/kvx_socinfo.c
+++ b/drivers/soc/kvx/kvx_socinfo.c
@@ -46,13 +46,14 @@ static void kvx_soc_info_read_revision(void)
        u8 car = kvx_sfr_field_val(pcr, PCR, CAR);
        const char *car_str = "", *ver_str = "";
 
-       switch (car) {
+       switch (sv) {
        case 0:
+       case 1:
                car_str = "kv3";
                break;
        }
 
-       switch (sv) {
+       switch (car) {
        case 0:
                ver_str = "1";
                break;
-- 
2.34.1






Reply via email to