Commit 0e5670c0 authored by Zhao Yihan's avatar Zhao Yihan Committed by guzitao
Browse files

sw64: register a suspend entry

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



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

Since the method of powering down the core is strongly coupled with the
implementation of hardware designing, this part is put into BIOS now. So
kernel need to get and register the address of the sleep entry from BIOS,
which would be used in sleep interrupt entry of HMCode.

Signed-off-by: default avatarZhao Yihan <zhaoyihan@wxiat.com>
Reviewed-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent 60582003
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -35,4 +35,8 @@ extern void efi_init(void);

#define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__)

extern unsigned long entSuspend;

#define SLEEP_ENTRY_GUID	EFI_GUID(0x59cb76bb, 0x9c3a, 0x4c8f, 0xbd, 0x5c, 0xc0, 0x0f, 0x20, 0x61, 0x18, 0x4b)

#endif /* _ASM_SW64_EFI_H */
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <asm/stacktrace.h>
#include <asm/processor.h>
#include <asm/ptrace.h>
#include <asm/efi.h>

#include "proto.h"

@@ -1458,4 +1459,5 @@ trap_init(void)
	wrent(entIF, 3);
	wrent(entUna, 4);
	wrent(entSys, 5);
	wrent((void *)entSuspend, 6);
}
+4 −1
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@

#include <asm/efi.h>

unsigned long entSuspend;

static int __init is_memory(efi_memory_desc_t *md)
{
	if (md->attribute & (EFI_MEMORY_WB|EFI_MEMORY_WT|EFI_MEMORY_WC))
@@ -32,7 +34,8 @@ static int __init is_memory(efi_memory_desc_t *md)
	return 0;
}
static efi_config_table_type_t arch_tables[] __initdata = {
	{SMBIOS3_TABLE_GUID, NULL, NULL}
	{SMBIOS3_TABLE_GUID, NULL, NULL},
	{SLEEP_ENTRY_GUID, &entSuspend, "SLEEP ENTRY"}
};

static int __init uefi_init(u64 efi_system_table)