提交 6ab80d4c 编写于 作者: D Dai Xin 提交者: guzitao

sw64: implement a new policy of power management

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5XTK7

--------------------------------

In the previous commit, we prefer to use efi runtime function hooks
as default power management ops, it may raise unexpected errors at
virtual machine application. So in this commit we make the legacy
power management module built in the kernel, which may be used by
some guest os kernel under some circumstances when running without
efi loader support.
Signed-off-by: NDai Xin <daixin@wxiat.com>
Reviewed-by: NHe Sheng <hesheng@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 f015f9a2
...@@ -255,13 +255,6 @@ config PLATFORM_XUELANG ...@@ -255,13 +255,6 @@ config PLATFORM_XUELANG
endchoice endchoice
config LEGACY_XUELANG
bool "Xuelang Reset Interface"
depends on SW64_CHIP3
help
This enables the legacy reset driver for SW64 chip3 CRBs. This interface
as a temporary solution will be deprecated in the future.
config MIGHT_HAVE_PC_SERIO config MIGHT_HAVE_PC_SERIO
bool "Use PC serio device i8042" bool "Use PC serio device i8042"
select ARCH_MIGHT_HAVE_PC_SERIO select ARCH_MIGHT_HAVE_PC_SERIO
......
...@@ -15,6 +15,7 @@ struct sw64_platform_ops { ...@@ -15,6 +15,7 @@ struct sw64_platform_ops {
extern struct sw64_platform_ops *sw64_platform; extern struct sw64_platform_ops *sw64_platform;
extern struct sw64_platform_ops xuelang_ops; extern struct sw64_platform_ops xuelang_ops;
extern struct boot_params *sunway_boot_params;
extern void sw64_halt(void); extern void sw64_halt(void);
extern void sw64_poweroff(void); extern void sw64_poweroff(void);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/chip3_io.h> #include <asm/platform.h>
#include <asm/io.h> #include <asm/io.h>
#ifdef CONFIG_SW64_RRK #ifdef CONFIG_SW64_RRK
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_LEGACY_XUELANG) += legacy_xuelang.o obj-$(CONFIG_PLATFORM_XUELANG) += legacy_xuelang.o
...@@ -51,9 +51,11 @@ void sw64_restart(void) ...@@ -51,9 +51,11 @@ void sw64_restart(void)
static int sw64_reset_init(void) static int sw64_reset_init(void)
{ {
pm_restart = sw64_restart; if (!sunway_boot_params->efi_systab) {
pm_power_off = sw64_poweroff; pm_restart = sw64_restart;
pm_halt = sw64_halt; pm_power_off = sw64_poweroff;
pm_halt = sw64_halt;
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册