From 60631ec37f034210226c0017b45da4e9e0c6b2bb Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 21 Aug 2024 08:00:31 +0200 Subject: [PATCH] Enable SEIE in MIE directly from machine mode --- lagarto-ox.nix | 1 + opensbi-enable-seip.patch | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 opensbi-enable-seip.patch diff --git a/lagarto-ox.nix b/lagarto-ox.nix index af77342..dd8ee93 100644 --- a/lagarto-ox.nix +++ b/lagarto-ox.nix @@ -333,6 +333,7 @@ patches = [ ./opensbi-timer-debug.patch #./opensbi-enable-meip.patch + ./opensbi-enable-seip.patch ./opensbi-dump-mregs.patch #./opensbi-dont-delegate.patch #./ox-alveo-platform-plic.patch diff --git a/opensbi-enable-seip.patch b/opensbi-enable-seip.patch new file mode 100644 index 0000000..b1bf8b0 --- /dev/null +++ b/opensbi-enable-seip.patch @@ -0,0 +1,24 @@ +diff --git a/lib/sbi/sbi_irqchip.c b/lib/sbi/sbi_irqchip.c +index 0ae604a..dd4592a 100644 +--- a/lib/sbi/sbi_irqchip.c ++++ b/lib/sbi/sbi_irqchip.c +@@ -37,8 +37,7 @@ int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot) + if (rc) + return rc; + +- if (ext_irqfn != default_irqfn) +- csr_set(CSR_MIE, MIP_MEIP); ++ csr_set(CSR_MIE, MIP_SEIP); + + return 0; + } +@@ -47,8 +46,7 @@ void sbi_irqchip_exit(struct sbi_scratch *scratch) + { + const struct sbi_platform *plat = sbi_platform_ptr(scratch); + +- if (ext_irqfn != default_irqfn) +- csr_clear(CSR_MIE, MIP_MEIP); ++ csr_clear(CSR_MIE, MIP_SEIP); + + sbi_platform_irqchip_exit(plat); + }