mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Julian Vetter <jvetter@kalrayinc.com>
To: barebox@lists.infradead.org
Cc: Yann Sionneau <ysionneau@kalrayinc.com>,
	Julian Vetter <jvetter@kalrayinc.com>
Subject: [PATCH 2/2] kvx: Request additional owner bit-fields on CV2
Date: Wed, 23 Oct 2024 10:54:32 +0200	[thread overview]
Message-ID: <20241023085432.1593840-2-jvetter@kalrayinc.com> (raw)
In-Reply-To: <20241023085432.1593840-1-jvetter@kalrayinc.com>

There are additional registers on CV2 whose access permissions need to
be delegated to the right PL (e.g. access to additional breakpoints and
watchpoints, etc.)

Signed-off-by: Julian Vetter <jvetter@kalrayinc.com>
---
 arch/kvx/include/asm/privilege.h | 50 +++++++++++++++++++++++++++-----
 1 file changed, 43 insertions(+), 7 deletions(-)

diff --git a/arch/kvx/include/asm/privilege.h b/arch/kvx/include/asm/privilege.h
index f183b24d42..4b03d9d3c5 100644
--- a/arch/kvx/include/asm/privilege.h
+++ b/arch/kvx/include/asm/privilege.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (C) 2019 Kalray Inc.
+ * Copyright (C) 2024 Kalray Inc.
  */
 
 #ifndef _ASM_KVX_PRIVILEGE_H
@@ -120,13 +120,35 @@
 #define DO_WFXL_OWN(__field, __pl) \
 	SFR_SET_VAL_WFXL(DO, __field, __pl)
 
-#define DO_WFXL_VALUE(__pl) (DO_WFXL_OWN(B0, __pl) | \
-			     DO_WFXL_OWN(B1, __pl) | \
-			     DO_WFXL_OWN(W0, __pl) | \
-			     DO_WFXL_OWN(W1, __pl))
+#if defined(CONFIG_ARCH_COOLIDGE_V1)
+#define DO_WFXL_VALUE(__pl)	(DO_WFXL_OWN(B0, __pl) | \
+				 DO_WFXL_OWN(B1, __pl) | \
+				 DO_WFXL_OWN(W0, __pl) | \
+				 DO_WFXL_OWN(W1, __pl))
 
-#define DO_WFXL_VALUE_PL_CUR_PLUS_1     DO_WFXL_VALUE(PL_CUR_PLUS_1)
-#define DO_WFXL_VALUE_PL_CUR            DO_WFXL_VALUE(PL_CUR)
+#define DO_WFXL_VALUE_PL_CUR_PLUS_1	DO_WFXL_VALUE(PL_CUR_PLUS_1)
+#elif defined(CONFIG_ARCH_COOLIDGE_V2)
+#define DO_WFXL_VALUE(__pl)	(DO_WFXL_OWN(B2, __pl) | \
+				 DO_WFXL_OWN(B3, __pl) | \
+				 DO_WFXL_OWN(W2, __pl) | \
+				 DO_WFXL_OWN(W3, __pl))
+
+#define DO_WFXL_VALUE_PL_CUR_PLUS_1	(DO_WFXL_VALUE(PL_CUR_PLUS_1) | \
+					 DO_WFXL_OWN(B0, PL_CUR_PLUS_1) | \
+					 DO_WFXL_OWN(B1, PL_CUR_PLUS_1) | \
+					 DO_WFXL_OWN(W0, PL_CUR_PLUS_1) | \
+					 DO_WFXL_OWN(W1, PL_CUR_PLUS_1) | \
+					 DO_WFXL_OWN(BI0, PL_CUR_PLUS_1) | \
+					 DO_WFXL_OWN(BI1, PL_CUR_PLUS_1) | \
+					 DO_WFXL_OWN(BI2, PL_CUR_PLUS_1) | \
+					 DO_WFXL_OWN(BI3, PL_CUR_PLUS_1))
+
+
+#else
+#error Unsupported arch
+#endif
+
+#define DO_WFXL_VALUE_PL_CUR		DO_WFXL_VALUE(PL_CUR)
 
 /**
  * Misc owner configuration
@@ -157,7 +179,21 @@
 #define MO_WFXM_OWN(__field, __pl) \
 	SFR_SET_VAL_WFXM(MO, __field, __pl)
 
+#if defined(CONFIG_ARCH_COOLIDGE_V1)
 #define MO_WFXM_VALUE(__pl)	(MO_WFXM_OWN(PMIT, __pl))
+#elif defined(CONFIG_ARCH_COOLIDGE_V2)
+#define MO_WFXM_VALUE(__pl)	(MO_WFXM_OWN(PMIT, __pl) | \
+				 MO_WFXM_OWN(COMM, __pl) | \
+				 MO_WFXM_OWN(TPCM, __pl) | \
+				 MO_WFXM_OWN(DISW, __pl) | \
+				 MO_WFXM_OWN(PM4, __pl) | \
+				 MO_WFXM_OWN(PM5, __pl) | \
+				 MO_WFXM_OWN(PM6, __pl) | \
+				 MO_WFXM_OWN(PM7, __pl) | \
+				 MO_WFXM_OWN(SRHPC, __pl))
+#else
+#error Unsupported arch
+#endif
 
 #define MO_WFXM_VALUE_PL_CUR_PLUS_1	MO_WFXM_VALUE(PL_CUR_PLUS_1)
 #define MO_WFXM_VALUE_PL_CUR		MO_WFXM_VALUE(PL_CUR)
-- 
2.34.1








  reply	other threads:[~2024-10-23  9:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23  8:54 [PATCH 1/2] kvx: Split sfr definition for kv3-1 and kv3-2 Julian Vetter
2024-10-23  8:54 ` Julian Vetter [this message]
2024-10-23 12:45 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241023085432.1593840-2-jvetter@kalrayinc.com \
    --to=jvetter@kalrayinc.com \
    --cc=barebox@lists.infradead.org \
    --cc=ysionneau@kalrayinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox