mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-17 18:28:55 +00:00
ae3527f088
We add RISC-V semihosting based serial console for JTAG based early debugging. The RISC-V semihosting specification is available at: https://github.com/riscv/riscv-semihosting-spec/blob/main/riscv-semihosting-spec.adoc Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Kautuk Consul <kconsul@ventanamicro.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
24 lines
448 B
C
24 lines
448 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2022 Ventana Micro Systems Inc.
|
|
*/
|
|
|
|
#include <common.h>
|
|
|
|
long smh_trap(int sysnum, void *addr)
|
|
{
|
|
register int ret asm ("a0") = sysnum;
|
|
register void *param0 asm ("a1") = addr;
|
|
|
|
asm volatile (".align 4\n"
|
|
".option push\n"
|
|
".option norvc\n"
|
|
|
|
"slli zero, zero, 0x1f\n"
|
|
"ebreak\n"
|
|
"srai zero, zero, 7\n"
|
|
".option pop\n"
|
|
: "+r" (ret) : "r" (param0) : "memory");
|
|
|
|
return ret;
|
|
}
|