From cdebae2cc9539e2e0553b9c68eab22997c734cbb Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Mon, 11 Dec 2023 14:07:56 +0530 Subject: 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 --- platform/fpga/ariane/platform.c | 3 +++ platform/fpga/openpiton/platform.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'platform/fpga') diff --git a/platform/fpga/ariane/platform.c b/platform/fpga/ariane/platform.c index 975528f..8be5e6c 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 e59dc99..2317a89 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, }; -- cgit v1.1