Commit 7d0ce3b2 authored by Kefeng Wang's avatar Kefeng Wang Committed by Palmer Dabbelt

riscv: sbi: Fix undefined reference to sbi_shutdown

There is no shutdown call in SBI v0.2, only set pm_power_off
when RISCV_SBI_V01 enabled to fix following build error,

riscv64-linux-ld: arch/riscv/kernel/sbi.o: in function `sbi_power_off':
sbi.c:(.text+0xe): undefined reference to `sbi_shutdown

Fixes: efca1398 ("RISC-V: Introduce a new config for SBI v0.1")
Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent f9d89c94
...@@ -167,6 +167,11 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask, ...@@ -167,6 +167,11 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask,
return result; return result;
} }
static void sbi_set_power_off(void)
{
pm_power_off = sbi_shutdown;
}
#else #else
static void __sbi_set_timer_v01(uint64_t stime_value) static void __sbi_set_timer_v01(uint64_t stime_value)
{ {
...@@ -191,6 +196,8 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask, ...@@ -191,6 +196,8 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask,
return 0; return 0;
} }
static void sbi_set_power_off(void) {}
#endif /* CONFIG_RISCV_SBI_V01 */ #endif /* CONFIG_RISCV_SBI_V01 */
static void __sbi_set_timer_v02(uint64_t stime_value) static void __sbi_set_timer_v02(uint64_t stime_value)
...@@ -540,16 +547,12 @@ static inline long sbi_get_firmware_version(void) ...@@ -540,16 +547,12 @@ static inline long sbi_get_firmware_version(void)
return __sbi_base_ecall(SBI_EXT_BASE_GET_IMP_VERSION); return __sbi_base_ecall(SBI_EXT_BASE_GET_IMP_VERSION);
} }
static void sbi_power_off(void)
{
sbi_shutdown();
}
int __init sbi_init(void) int __init sbi_init(void)
{ {
int ret; int ret;
pm_power_off = sbi_power_off; sbi_set_power_off();
ret = sbi_get_spec_version(); ret = sbi_get_spec_version();
if (ret > 0) if (ret > 0)
sbi_spec_version = ret; sbi_spec_version = ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment