arch: riscv: add common stub reboot function

This patch adds weak sys_arch_reboot() function to avoid build error
with CONFIG_REBOOT=y. Some SoC has already had own reboot function
but others (Ex. qemu boards) faced buld error.

- openisa_rv32m1: Not change
- riscv-ite: Do nothing, remove and use arch/riscv function

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
This commit is contained in:
Katsuhiro Suzuki 2021-02-03 14:17:28 +09:00 committed by Maureen Helm
commit e58e2767f8
3 changed files with 30 additions and 5 deletions

View file

@ -10,6 +10,7 @@ zephyr_library_sources(
irq_manage.c irq_manage.c
isr.S isr.S
prep_c.c prep_c.c
reboot.c
reset.S reset.S
swap.S swap.S
thread.c thread.c

29
arch/riscv/core/reboot.c Normal file
View file

@ -0,0 +1,29 @@
/*
* Copyright (c) 2021 Katsuhiro Suzuki
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief RISC-V reboot interface
*/
#include <kernel.h>
#include <arch/cpu.h>
#include <sys/util.h>
/**
* @brief Reset the system
*
* This is stub function to avoid build error with CONFIG_REBOOT=y
* RISC-V specification does not have a common interface for system reset.
* Each RISC-V SoC that has reset feature should implement own reset function.
*
* @return N/A
*/
void __weak sys_arch_reboot(int type)
{
ARG_UNUSED(type);
}

View file

@ -10,11 +10,6 @@
#include <init.h> #include <init.h>
#include <soc.h> #include <soc.h>
void sys_arch_reboot(int type)
{
ARG_UNUSED(type);
}
static int ite_it8xxx2_init(const struct device *arg) static int ite_it8xxx2_init(const struct device *arg)
{ {
ARG_UNUSED(arg); ARG_UNUSED(arg);