[PATCH] kvx: Fix SoC version/revision string

Julian Vetter jvetter at kalrayinc.com
Fri Sep 27 06:07:01 PDT 2024


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

Signed-off-by: Julian Vetter <jvetter at 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








More information about the barebox mailing list