summaryrefslogtreecommitdiff
path: root/arch/loongarch/power
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2023-04-18 19:38:58 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2023-04-18 19:38:58 +0800
commit1c1378a4090845e12c4dbbb337de7acce309b570 (patch)
treebdcb14c5c5a3ee1f7416ba411a78f91c0042162f /arch/loongarch/power
parent6637775ca3c3d0b4f7b83c5ce9a592df2c9bff52 (diff)
LoongArch: Enable PG when wakeup from suspend
Some firmwares don't enable PG when wakeup from suspend, so do it in kernel. This can improve code compatibility for boot kernel. Signed-off-by: Baoqi Zhang <zhangbaoqi@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/power')
-rw-r--r--arch/loongarch/power/suspend_asm.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/loongarch/power/suspend_asm.S b/arch/loongarch/power/suspend_asm.S
index 90da899c06a1..e2fc3b4e31f0 100644
--- a/arch/loongarch/power/suspend_asm.S
+++ b/arch/loongarch/power/suspend_asm.S
@@ -80,6 +80,10 @@ SYM_INNER_LABEL(loongarch_wakeup_start, SYM_L_GLOBAL)
JUMP_VIRT_ADDR t0, t1
+ /* Enable PG */
+ li.w t0, 0xb0 # PLV=0, IE=0, PG=1
+ csrwr t0, LOONGARCH_CSR_CRMD
+
la.pcrel t0, acpi_saved_sp
ld.d sp, t0, 0
SETUP_WAKEUP