summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2018-12-21 11:42:10 +0300
committerAnup Patel <anup@brainfault.org>2018-12-21 12:24:06 +0300
commita18913200a34c6da44c634578214db7830cdd036 (patch)
tree5da4f8a4d39eedd08a2ed7cdc79503893b2aaffc /lib
parent1bfa2445059a4248f82f097a94e4746b5adf2137 (diff)
downloadopensbi-a18913200a34c6da44c634578214db7830cdd036.tar.xz
lib: Remove prints from sbi_hart_switch_mode()
The sbi_hart_switch_mode() will be used by CPU hotplug. This means if we have prints in sbi_hart_switch_mode() then these prints will mix with Linux prints. Being a runtime firmware, we should be verbose only at coldboot time and error situations. Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/sbi_hart.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/sbi_hart.c b/lib/sbi_hart.c
index fae82c9..01362dd 100644
--- a/lib/sbi_hart.c
+++ b/lib/sbi_hart.c
@@ -209,7 +209,7 @@ 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());
+ sbi_printf("\nHART%u Hang !!\n\n", sbi_current_hartid());
while (1)
wfi();
@@ -222,7 +222,6 @@ void __attribute__((noreturn)) sbi_hart_switch_mode(unsigned long arg0,
unsigned long next_mode)
{
unsigned long val;
- char mode = 'M';
switch (next_mode) {
case PRV_M:
@@ -236,7 +235,6 @@ void __attribute__((noreturn)) sbi_hart_switch_mode(unsigned long arg0,
sbi_hart_hang();
break;
default:
- sbi_printf("\nTrying to switch to unsupported mode\n");
sbi_hart_hang();
}
@@ -248,21 +246,16 @@ void __attribute__((noreturn)) sbi_hart_switch_mode(unsigned long arg0,
csr_write(mepc, next_addr);
if (next_mode == PRV_S) {
- mode = 'S';
csr_write(stvec, next_addr);
csr_write(sscratch, 0);
csr_write(sie, 0);
csr_write(satp, 0);
} else if (next_mode == PRV_U) {
- mode = 'U';
csr_write(utvec, next_addr);
csr_write(uscratch, 0);
csr_write(uie, 0);
}
- sbi_printf("HART %u switching to %c-mode...\n\n",
- sbi_current_hartid(), mode);
-
register unsigned long a0 asm ("a0") = arg0;
register unsigned long a1 asm ("a1") = arg1;
__asm__ __volatile__ ("mret" : : "r" (a0), "r" (a1));