]> www.infradead.org Git - users/willy/xarray.git/commit
LoongArch: Add ACPI standard hardware register based S3 support
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Sat, 20 Jul 2024 14:41:06 +0000 (22:41 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Sat, 20 Jul 2024 14:41:06 +0000 (22:41 +0800)
commite523a5a65f34ca5bd67ccfdfdccf04689b58f0bf
tree41d19e000f4ca6353c22c35867410e56bec5bc28
parentf60d251b27f6599b3407950924ac9b2c7a94b714
LoongArch: Add ACPI standard hardware register based S3 support

Most LoongArch 64 machines are using custom "SADR" ACPI extension to
perform ACPI S3 sleep. However the standard ACPI way to perform sleep
is to write a value to ACPI PM1/SLEEP_CTL register, and this is never
supported properly in kernel.

Add standard S3 sleep by providing a default DoSuspend function which
calls ACPI's acpi_enter_sleep_state() routine when SADR is not provided
by the firmware.

Also fix suspend assembly code so that ra is set properly before go
into sleep routine. (Previously linked address of jirl was set to a0,
some firmware do require return address in a0 but it's already set with
la.pcrel before).

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/power/platform.c
arch/loongarch/power/suspend_asm.S