summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorAnup Patel <[email protected]>2023-12-11 14:07:56 +0530
committerAnup Patel <[email protected]>2023-12-19 15:56:37 +0530
commitcdebae2cc9539e2e0553b9c68eab22997c734cbb (patch)
tree3a0c68c8935b8381ba36da2eb60eaf7e350d2da1 /platform
parent80169b25f8a9a7cb8becceff9a414900919527c6 (diff)
lib: utils/irqchip: Add shared MMIO region for PLIC in root domain
On platforms with Smepmp, the MMIO regions accessed by M-mode need to be explicitly marked with M-mode only read/write or shared (both (M-mode and S-mode) read/write permission. If the above is not done then runtime PLIC access from M-mode on platforms with Smepmp will result in access fault when further results in CPU hotplug not working. Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'platform')
-rw-r--r--platform/fpga/ariane/platform.c3
-rw-r--r--platform/fpga/openpiton/platform.c3
-rw-r--r--platform/kendryte/k210/platform.c1
-rw-r--r--platform/kendryte/k210/platform.h1
-rw-r--r--platform/nuclei/ux600/platform.c3
-rw-r--r--platform/template/platform.c3
6 files changed, 14 insertions, 0 deletions
diff --git a/platform/fpga/ariane/platform.c b/platform/fpga/ariane/platform.c
index 975528f1..8be5e6ca 100644
--- a/platform/fpga/ariane/platform.c
+++ b/platform/fpga/ariane/platform.c
@@ -25,6 +25,8 @@
#define ARIANE_UART_REG_WIDTH 4
#define ARIANE_UART_REG_OFFSET 0
#define ARIANE_PLIC_ADDR 0xc000000
+#define ARIANE_PLIC_SIZE (0x200000 + \
+ (ARIANE_HART_COUNT * 0x1000))
#define ARIANE_PLIC_NUM_SOURCES 3
#define ARIANE_HART_COUNT 1
#define ARIANE_CLINT_ADDR 0x2000000
@@ -36,6 +38,7 @@
static struct plic_data plic = {
.addr = ARIANE_PLIC_ADDR,
+ .size = ARIANE_PLIC_SIZE,
.num_src = ARIANE_PLIC_NUM_SOURCES,
};
diff --git a/platform/fpga/openpiton/platform.c b/platform/fpga/openpiton/platform.c
index e59dc992..2317a899 100644
--- a/platform/fpga/openpiton/platform.c
+++ b/platform/fpga/openpiton/platform.c
@@ -24,6 +24,8 @@
#define OPENPITON_DEFAULT_UART_REG_WIDTH 1
#define OPENPITON_DEFAULT_UART_REG_OFFSET 0
#define OPENPITON_DEFAULT_PLIC_ADDR 0xfff1100000
+#define OPENPITON_DEFAULT_PLIC_SIZE (0x200000 + \
+ (OPENPITON_DEFAULT_HART_COUNT * 0x1000))
#define OPENPITON_DEFAULT_PLIC_NUM_SOURCES 2
#define OPENPITON_DEFAULT_HART_COUNT 3
#define OPENPITON_DEFAULT_CLINT_ADDR 0xfff1020000
@@ -40,6 +42,7 @@ static struct platform_uart_data uart = {
};
static struct plic_data plic = {
.addr = OPENPITON_DEFAULT_PLIC_ADDR,
+ .size = OPENPITON_DEFAULT_PLIC_SIZE,
.num_src = OPENPITON_DEFAULT_PLIC_NUM_SOURCES,
};
diff --git a/platform/kendryte/k210/platform.c b/platform/kendryte/k210/platform.c
index 637a217f..27b23f73 100644
--- a/platform/kendryte/k210/platform.c
+++ b/platform/kendryte/k210/platform.c
@@ -32,6 +32,7 @@ unsigned long fw_platform_init(unsigned long arg0, unsigned long arg1,
static struct plic_data plic = {
.addr = K210_PLIC_BASE_ADDR,
+ .size = K210_PLIC_BASE_SIZE,
.num_src = K210_PLIC_NUM_SOURCES,
};
diff --git a/platform/kendryte/k210/platform.h b/platform/kendryte/k210/platform.h
index be52aa30..9417403d 100644
--- a/platform/kendryte/k210/platform.h
+++ b/platform/kendryte/k210/platform.h
@@ -27,6 +27,7 @@
#define K210_ACLINT_MTIMER_ADDR \
(K210_CLINT_BASE_ADDR + CLINT_MTIMER_OFFSET)
#define K210_PLIC_BASE_ADDR 0x0C000000ULL
+#define K210_PLIC_BASE_SIZE (0x200000ULL + (K210_HART_COUNT * 0x1000))
/* Registers */
#define K210_PLL0 0x08
diff --git a/platform/nuclei/ux600/platform.c b/platform/nuclei/ux600/platform.c
index 6fd6cd70..f688b50a 100644
--- a/platform/nuclei/ux600/platform.c
+++ b/platform/nuclei/ux600/platform.c
@@ -39,6 +39,8 @@
CLINT_MTIMER_OFFSET)
#define UX600_PLIC_ADDR 0x8000000
+#define UX600_PLIC_SIZE (0x200000 + \
+ (UX600_HART_COUNT * 0x1000))
#define UX600_PLIC_NUM_SOURCES 0x35
#define UX600_PLIC_NUM_PRIORITIES 7
@@ -63,6 +65,7 @@ static u32 ux600_clk_freq = 8000000;
static struct plic_data plic = {
.addr = UX600_PLIC_ADDR,
+ .size = UX600_PLIC_SIZE,
.num_src = UX600_PLIC_NUM_SOURCES,
};
diff --git a/platform/template/platform.c b/platform/template/platform.c
index 86381ca2..4b3f2acf 100644
--- a/platform/template/platform.c
+++ b/platform/template/platform.c
@@ -19,6 +19,8 @@
#include <sbi_utils/timer/aclint_mtimer.h>
#define PLATFORM_PLIC_ADDR 0xc000000
+#define PLATFORM_PLIC_SIZE (0x200000 + \
+ (PLATFORM_HART_COUNT * 0x1000))
#define PLATFORM_PLIC_NUM_SOURCES 128
#define PLATFORM_HART_COUNT 4
#define PLATFORM_CLINT_ADDR 0x2000000
@@ -33,6 +35,7 @@
static struct plic_data plic = {
.addr = PLATFORM_PLIC_ADDR,
+ .size = PLATFORM_PLIC_SIZE,
.num_src = PLATFORM_PLIC_NUM_SOURCES,
};