From 857e33e27f1feeec328ae8be5ad61ee51b75e4ec Mon Sep 17 00:00:00 2001 From: Jonathan Neuschäfer Date: Mon, 22 Aug 2016 19:37:16 +0200 Subject: arch/riscv: Implement the SBI again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not all SBI calls are implemented, but it's enough to see a couple dozen lines of Linux boot output. It should also be noted that the SBI is still in flux: https://groups.google.com/a/groups.riscv.org/forum/#!topic/sw-dev/6oNhlW0OFKM Change-Id: I80e4fe508336d6428ca7136bc388fbc3cda4f1e4 Signed-off-by: Jonathan Neuschäfer Reviewed-on: https://review.coreboot.org/16119 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/arch/riscv/include/arch/sbi.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/arch/riscv/include/arch/sbi.h (limited to 'src/arch/riscv/include') diff --git a/src/arch/riscv/include/arch/sbi.h b/src/arch/riscv/include/arch/sbi.h new file mode 100644 index 0000000000..df7f6cc70e --- /dev/null +++ b/src/arch/riscv/include/arch/sbi.h @@ -0,0 +1,36 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2016 Jonathan Neuschäfer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + + +#ifndef _ARCH_SBI_H +#define _ARCH_SBI_H + +#define SBI_ECALL_HART_ID 0 +#define SBI_ECALL_CONSOLE_PUT 1 +#define SBI_ECALL_SEND_DEVICE_REQUEST 2 +#define SBI_ECALL_RECEIVE_DEVICE_RESPONSE 3 +#define SBI_ECALL_SEND_IPI 4 +#define SBI_ECALL_CLEAR_IPI 5 +#define SBI_ECALL_SHUTDOWN 6 +#define SBI_ECALL_SET_TIMER 7 +#define SBI_ECALL_QUERY_MEMORY 8 +#define SBI_ECALL_NUM_HARTS 9 + +#ifndef __ASSEMBLY__ +struct opaque; +extern struct opaque sbi_page; +#endif + +#endif -- cgit v1.2.3