diff options
| author | Anup Patel <[email protected]> | 2018-12-22 20:42:48 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-12-22 20:42:48 +0530 |
| commit | 51d3964f0795dbd305953e41a4e7fe241e243855 (patch) | |
| tree | 3ff443a70d244c9667262777824650f1bae07991 /lib | |
| parent | 27332e63faaf6d3220a9d56bcfb280921114f012 (diff) | |
| parent | 8304ee9424cc7700f2b08ba17553c2e48e0bafa8 (diff) | |
Merge pull request #3 from riscv/unleashed_working_12_21
Unleashed working 12 21
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sbi_hart.c | 2 | ||||
| -rw-r--r-- | lib/sbi_init.c | 13 | ||||
| -rw-r--r-- | lib/sbi_ipi.c | 2 |
3 files changed, 10 insertions, 7 deletions
diff --git a/lib/sbi_hart.c b/lib/sbi_hart.c index be114d69..1e5465f5 100644 --- a/lib/sbi_hart.c +++ b/lib/sbi_hart.c @@ -211,8 +211,6 @@ int sbi_hart_init(struct sbi_scratch *scratch, u32 hartid) void __attribute__((noreturn)) sbi_hart_hang(void) { - sbi_printf("\nHART%u Hang !!\n\n", sbi_current_hartid()); - while (1) wfi(); __builtin_unreachable(); diff --git a/lib/sbi_init.c b/lib/sbi_init.c index da78a7ef..68113b49 100644 --- a/lib/sbi_init.c +++ b/lib/sbi_init.c @@ -86,7 +86,6 @@ static void __attribute__((noreturn)) init_coldboot(struct sbi_scratch *scratch, sbi_printf("OpenSBI v%d.%d (%s %s)\n", OPENSBI_MAJOR, OPENSBI_MINOR, __DATE__, __TIME__); - sbi_printf("Running on Hart %u\n", hartid); sbi_printf("%s\n", logo); @@ -95,6 +94,7 @@ static void __attribute__((noreturn)) init_coldboot(struct sbi_scratch *scratch, sbi_printf("Platform HART Features : RV%d%s\n", misa_xlen(), str); sbi_printf("Platform Max HARTs : %d\n", sbi_platform_hart_count(plat)); + sbi_printf("Current Hart : %u\n", hartid); /* Firmware details */ sbi_printf("Firmware Base : 0x%lx\n", scratch->fw_start); sbi_printf("Firmware Size : %d KB\n", @@ -106,11 +106,9 @@ static void __attribute__((noreturn)) init_coldboot(struct sbi_scratch *scratch, sbi_hart_pmp_dump(scratch); - sbi_hart_mark_available(hartid); - if (!sbi_platform_has_hart_hotplug(plat)) sbi_hart_wake_coldboot_harts(scratch, hartid); - + sbi_hart_mark_available(hartid); sbi_hart_switch_mode(hartid, scratch->next_arg1, scratch->next_addr, scratch->next_mode); } @@ -124,6 +122,9 @@ static void __attribute__((noreturn)) init_warmboot(struct sbi_scratch *scratch, if (!sbi_platform_has_hart_hotplug(plat)) sbi_hart_wait_for_coldboot(scratch, hartid); + if (sbi_platform_hart_disabled(plat, hartid)) + sbi_hart_hang(); + rc = sbi_system_warm_early_init(scratch, hartid); if (rc) sbi_hart_hang(); @@ -164,7 +165,11 @@ void __attribute__((noreturn)) sbi_init(struct sbi_scratch *scratch) { bool coldboot = FALSE; u32 hartid = sbi_current_hartid(); + struct sbi_platform *plat = sbi_platform_ptr(scratch); + if (sbi_platform_hart_disabled(plat, hartid)) + sbi_hart_hang(); + if (atomic_add_return(&coldboot_lottery, 1) == 1) coldboot = TRUE; diff --git a/lib/sbi_ipi.c b/lib/sbi_ipi.c index f3e68de1..d21ea4a2 100644 --- a/lib/sbi_ipi.c +++ b/lib/sbi_ipi.c @@ -28,7 +28,7 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch, /* send IPIs to everyone */ for (i = 0, m = mask; m; i++, m >>= 1) { - if ((m & 1) && (i != hartid)) { + if ((m & 1) && (i != hartid) && !sbi_platform_hart_disabled(plat, hartid)) { oth = sbi_hart_id_to_scratch(scratch, i); oth->ipi_type = event; mb(); |
