mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v1] kvx: Fix SoC version/revision string
@ 2024-09-27 13:53 Julian Vetter
  2024-09-27 15:59 ` Yann Sionneau
  2024-09-30  7:00 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Julian Vetter @ 2024-09-27 13:53 UTC (permalink / raw)
  To: barebox; +Cc: Yann Sionneau, Julian Vetter

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 <ysionneau@kalrayinc.com>
Signed-off-by: Julian Vetter <jvetter@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








^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-30  7:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-27 13:53 [PATCH v1] kvx: Fix SoC version/revision string Julian Vetter
2024-09-27 15:59 ` Yann Sionneau
2024-09-30  7:00 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox