summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2019-01-19 00:35:47 +0300
committerAnup Patel <anup@brainfault.org>2019-01-22 07:33:49 +0300
commit784a4657c0957e7f9561fd2d87930ba008643c1e (patch)
treec8711726b76df9d32e82122870921f790c1c7c54 /lib
parent1ee745fe57c3ad9db64bb31564f21a4fab101f22 (diff)
downloadopensbi-784a4657c0957e7f9561fd2d87930ba008643c1e.tar.xz
lib: Move software interrupt enablement from firmware to lib
The secondary hart waits for an IPI signal from the boot hart to executing boot code (hot boot). As a result, software generated interrupts have to be enabled for secondary harts before waiting for the boot hart boot completion IPI signal. Enabling software generated interrupts (IPI) can be done independently of the firmware code and moved to libsbi code so that the different firmware do not have to implement this. Signed-off-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/sbi_hart.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sbi_hart.c b/lib/sbi_hart.c
index e8a689e..e12a546 100644
--- a/lib/sbi_hart.c
+++ b/lib/sbi_hart.c
@@ -304,6 +304,10 @@ void sbi_hart_wait_for_coldboot(struct sbi_scratch *scratch, u32 hartid)
if ((sbi_platform_hart_count(plat) <= hartid) ||
(COLDBOOT_WAIT_BITMAP_SIZE <= hartid))
sbi_hart_hang();
+
+ /* Set MSIE bit to receive IPI */
+ csr_set(mie, MIP_MSIP);
+
do {
spin_lock(&coldboot_wait_bitmap_lock);
coldboot_wait_bitmap |= (1UL << hartid);