Loading arch/loongarch/Kconfig +3 −0 Original line number Diff line number Diff line Loading @@ -521,6 +521,9 @@ menu "Power management options" config ARCH_SUSPEND_POSSIBLE def_bool y config ARCH_HIBERNATION_POSSIBLE def_bool y source "kernel/power/Kconfig" source "drivers/acpi/Kconfig" Loading arch/loongarch/kernel/asm-offsets.c +12 −0 Original line number Diff line number Diff line Loading @@ -257,3 +257,15 @@ void output_smpboot_defines(void) BLANK(); } #endif #ifdef CONFIG_HIBERNATION void output_pbe_defines(void) { COMMENT(" Linux struct pbe offsets. "); OFFSET(PBE_ADDRESS, pbe, address); OFFSET(PBE_ORIG_ADDRESS, pbe, orig_address); OFFSET(PBE_NEXT, pbe, next); DEFINE(PBE_SIZE, sizeof(struct pbe)); BLANK(); } #endif arch/loongarch/kernel/reset.c +5 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #include <acpi/reboot.h> #include <asm/idle.h> #include <asm/loongarch.h> #include <asm/loongson.h> void (*pm_power_off)(void); EXPORT_SYMBOL(pm_power_off); Loading @@ -41,6 +42,10 @@ void machine_power_off(void) #ifdef CONFIG_SMP preempt_disable(); smp_send_stop(); #endif #ifdef CONFIG_PM if (!acpi_disabled) enable_pci_wakeup(); #endif do_kernel_power_off(); #ifdef CONFIG_EFI Loading arch/loongarch/kernel/setup.c +5 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <linux/libfdt.h> #include <linux/of_fdt.h> #include <linux/of_address.h> #include <linux/suspend.h> #include <linux/swiotlb.h> #include <asm/addrspace.h> Loading Loading @@ -370,6 +371,10 @@ static void __init arch_mem_init(char **cmdline_p) dma_contiguous_reserve(PFN_PHYS(max_low_pfn)); /* Reserve for hibernation. */ register_nosave_region(PFN_DOWN(__pa_symbol(&__nosave_begin)), PFN_UP(__pa_symbol(&__nosave_end))); memblock_dump_all(); early_memtest(PFN_PHYS(ARCH_PFN_OFFSET), PFN_PHYS(max_low_pfn)); Loading arch/loongarch/power/Makefile +1 −0 Original line number Diff line number Diff line obj-y += platform.o obj-$(CONFIG_SUSPEND) += suspend.o suspend_asm.o obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate_asm.o Loading
arch/loongarch/Kconfig +3 −0 Original line number Diff line number Diff line Loading @@ -521,6 +521,9 @@ menu "Power management options" config ARCH_SUSPEND_POSSIBLE def_bool y config ARCH_HIBERNATION_POSSIBLE def_bool y source "kernel/power/Kconfig" source "drivers/acpi/Kconfig" Loading
arch/loongarch/kernel/asm-offsets.c +12 −0 Original line number Diff line number Diff line Loading @@ -257,3 +257,15 @@ void output_smpboot_defines(void) BLANK(); } #endif #ifdef CONFIG_HIBERNATION void output_pbe_defines(void) { COMMENT(" Linux struct pbe offsets. "); OFFSET(PBE_ADDRESS, pbe, address); OFFSET(PBE_ORIG_ADDRESS, pbe, orig_address); OFFSET(PBE_NEXT, pbe, next); DEFINE(PBE_SIZE, sizeof(struct pbe)); BLANK(); } #endif
arch/loongarch/kernel/reset.c +5 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #include <acpi/reboot.h> #include <asm/idle.h> #include <asm/loongarch.h> #include <asm/loongson.h> void (*pm_power_off)(void); EXPORT_SYMBOL(pm_power_off); Loading @@ -41,6 +42,10 @@ void machine_power_off(void) #ifdef CONFIG_SMP preempt_disable(); smp_send_stop(); #endif #ifdef CONFIG_PM if (!acpi_disabled) enable_pci_wakeup(); #endif do_kernel_power_off(); #ifdef CONFIG_EFI Loading
arch/loongarch/kernel/setup.c +5 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <linux/libfdt.h> #include <linux/of_fdt.h> #include <linux/of_address.h> #include <linux/suspend.h> #include <linux/swiotlb.h> #include <asm/addrspace.h> Loading Loading @@ -370,6 +371,10 @@ static void __init arch_mem_init(char **cmdline_p) dma_contiguous_reserve(PFN_PHYS(max_low_pfn)); /* Reserve for hibernation. */ register_nosave_region(PFN_DOWN(__pa_symbol(&__nosave_begin)), PFN_UP(__pa_symbol(&__nosave_end))); memblock_dump_all(); early_memtest(PFN_PHYS(ARCH_PFN_OFFSET), PFN_PHYS(max_low_pfn)); Loading
arch/loongarch/power/Makefile +1 −0 Original line number Diff line number Diff line obj-y += platform.o obj-$(CONFIG_SUSPEND) += suspend.o suspend_asm.o obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate_asm.o