• Jiaxun Yang's avatar
    LoongArch: Add ACPI standard hardware register based S3 support · e523a5a6
    Jiaxun Yang authored
    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: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    e523a5a6
suspend_asm.S 1.88 KB