diff options
| author | Anup Patel <[email protected]> | 2018-12-26 18:36:11 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2018-12-27 09:35:09 +0530 |
| commit | c1b6200653c51642e544c66fab8bb320969b818e (patch) | |
| tree | c4d17e29e7a979cd5a910b4910fcd75a5569f803 /lib | |
| parent | e34aa8a6719dd6c225e576e0617d05735776af6f (diff) | |
lib: Simplify sbi_platform ipi_init() hooks
Instead of having separate ipi_init() hooks for cold and warm boot,
this patch updates struct sbi_platform to have just one ipi_init()
hook. The type of boot (cold or warm) is now a boolean flag parameter
for the updated ipi_init() hook.
Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sbi_init.c | 8 | ||||
| -rw-r--r-- | lib/sbi_ipi.c | 10 |
2 files changed, 5 insertions, 13 deletions
diff --git a/lib/sbi_init.c b/lib/sbi_init.c index 448102e5..989cb7d7 100644 --- a/lib/sbi_init.c +++ b/lib/sbi_init.c @@ -50,11 +50,7 @@ static void __attribute__((noreturn)) init_coldboot(struct sbi_scratch *scratch, if (rc) sbi_hart_hang(); - rc = sbi_ipi_cold_init(scratch); - if (rc) - sbi_hart_hang(); - - rc = sbi_ipi_warm_init(scratch, hartid); + rc = sbi_ipi_init(scratch, hartid, TRUE); if (rc) sbi_hart_hang(); @@ -125,7 +121,7 @@ static void __attribute__((noreturn)) init_warmboot(struct sbi_scratch *scratch, if (rc) sbi_hart_hang(); - rc = sbi_ipi_warm_init(scratch, hartid); + rc = sbi_ipi_init(scratch, hartid, FALSE); if (rc) sbi_hart_hang(); diff --git a/lib/sbi_ipi.c b/lib/sbi_ipi.c index d21ea4a2..423a9a09 100644 --- a/lib/sbi_ipi.c +++ b/lib/sbi_ipi.c @@ -68,15 +68,11 @@ void sbi_ipi_process(struct sbi_scratch *scratch, u32 hartid) scratch->ipi_type = 0; } -int sbi_ipi_warm_init(struct sbi_scratch *scratch, u32 hartid) +int sbi_ipi_init(struct sbi_scratch *scratch, u32 hartid, bool cold_boot) { /* Enable software interrupts */ csr_set(mie, MIP_MSIP); - return sbi_platform_warm_ipi_init(sbi_platform_ptr(scratch), hartid); -} - -int sbi_ipi_cold_init(struct sbi_scratch *scratch) -{ - return sbi_platform_cold_ipi_init(sbi_platform_ptr(scratch)); + return sbi_platform_ipi_init(sbi_platform_ptr(scratch), + hartid, cold_boot); } |
