public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Rick Chen <rick@andestech.com>
To: <bmeng.cn@gmail.com>, <ycliang@andestech.com>,
	<rick@andestech.com>, <rickchen36@gmail.com>
Cc: <u-boot@lists.denx.de>
Subject: [PATCH v2] riscv: ae350: Enable CCTL_SUEN
Date: Tue, 3 Jan 2023 16:17:13 +0800	[thread overview]
Message-ID: <20230103081713.15220-1-rick@andestech.com> (raw)

CCTL operations are available to Supervisor/User-mode
software under the control of the mcache_ctl.CCTL_SUEN
control bit. Enable it to support Supervisor(and User)
CCTL operations.

Signed-off-by: Rick Chen <rick@andestech.com>
---

Changes in v2
 - fix typo
 - correct aligment

---

 arch/riscv/cpu/ax25/cpu.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/riscv/cpu/ax25/cpu.c b/arch/riscv/cpu/ax25/cpu.c
index c4c2de2ef0..a46674f7c2 100644
--- a/arch/riscv/cpu/ax25/cpu.c
+++ b/arch/riscv/cpu/ax25/cpu.c
@@ -12,18 +12,20 @@
 #include <asm/csr.h>
 
 #define CSR_MCACHE_CTL	0x7ca
-#define CSR_MMISC_CTL	0x7d0
-#define CSR_MARCHID		0xf12
+#define CSR_MMISC_CTL		0x7d0
+#define CSR_MARCHID			0xf12
 
 #define V5_MCACHE_CTL_IC_EN_OFFSET      0
 #define V5_MCACHE_CTL_DC_EN_OFFSET      1
-#define V5_MCACHE_CTL_DC_COHEN_OFFSET	19
+#define V5_MCACHE_CTL_CCTL_SUEN_OFFSET	8
+#define V5_MCACHE_CTL_DC_COHEN_OFFSET		19
 #define V5_MCACHE_CTL_DC_COHSTA_OFFSET	20
 
-#define V5_MCACHE_CTL_IC_EN		BIT(V5_MCACHE_CTL_IC_EN_OFFSET)
-#define V5_MCACHE_CTL_DC_EN				BIT(V5_MCACHE_CTL_DC_EN_OFFSET)
-#define V5_MCACHE_CTL_DC_COHEN_EN       BIT(V5_MCACHE_CTL_DC_COHEN_OFFSET)
-#define V5_MCACHE_CTL_DC_COHSTA_EN      BIT(V5_MCACHE_CTL_DC_COHSTA_OFFSET)
+#define V5_MCACHE_CTL_IC_EN					BIT(V5_MCACHE_CTL_IC_EN_OFFSET)
+#define V5_MCACHE_CTL_DC_EN					BIT(V5_MCACHE_CTL_DC_EN_OFFSET)
+#define V5_MCACHE_CTL_CCTL_SUEN			BIT(V5_MCACHE_CTL_CCTL_SUEN_OFFSET)
+#define V5_MCACHE_CTL_DC_COHEN_EN   BIT(V5_MCACHE_CTL_DC_COHEN_OFFSET)
+#define V5_MCACHE_CTL_DC_COHSTA_EN  BIT(V5_MCACHE_CTL_DC_COHSTA_OFFSET)
 
 
 /*
@@ -55,6 +57,8 @@ void harts_early_init(void)
 			mcache_ctl_val |= V5_MCACHE_CTL_IC_EN;
 		if (!(mcache_ctl_val & V5_MCACHE_CTL_DC_EN))
 			mcache_ctl_val |= V5_MCACHE_CTL_DC_EN;
+		if (!(mcache_ctl_val & V5_MCACHE_CTL_CCTL_SUEN))
+			mcache_ctl_val |= V5_MCACHE_CTL_CCTL_SUEN;
 		csr_write(CSR_MCACHE_CTL, mcache_ctl_val);
 
 		/*
-- 
2.17.1


             reply	other threads:[~2023-01-03  8:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03  8:17 Rick Chen [this message]
2023-01-31 14:57 ` [PATCH v2] riscv: ae350: Enable CCTL_SUEN Leo Liang

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=20230103081713.15220-1-rick@andestech.com \
    --to=rick@andestech.com \
    --cc=bmeng.cn@gmail.com \
    --cc=rickchen36@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.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