X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=target%2Flinux%2Fat91%2Fpatches-5.15%2F215-ARM-at91-pm-add-backup-mode-support-for-SAMA7G5.patch;fp=target%2Flinux%2Fat91%2Fpatches-5.15%2F215-ARM-at91-pm-add-backup-mode-support-for-SAMA7G5.patch;h=cc5f4aec0a608dd1fa97f6dd0039d667e68f2418;hp=0000000000000000000000000000000000000000;hb=eb758a8fec2cee24e528008052fa2bd58482ca3a;hpb=c5c37886cff1705ba9be9b33df3ab121bd27fe6b diff --git a/target/linux/at91/patches-5.15/215-ARM-at91-pm-add-backup-mode-support-for-SAMA7G5.patch b/target/linux/at91/patches-5.15/215-ARM-at91-pm-add-backup-mode-support-for-SAMA7G5.patch new file mode 100644 index 0000000000..cc5f4aec0a --- /dev/null +++ b/target/linux/at91/patches-5.15/215-ARM-at91-pm-add-backup-mode-support-for-SAMA7G5.patch @@ -0,0 +1,52 @@ +From 62be32b56ff31b2cd048a53fac40a165c5bc66cd Mon Sep 17 00:00:00 2001 +From: Claudiu Beznea +Date: Thu, 15 Apr 2021 13:50:06 +0300 +Subject: [PATCH 215/247] ARM: at91: pm: add backup mode support for SAMA7G5 + +Adapt at91_pm_backup_init() to work for SAMA7G5. Also, set the LPM pin +to shutdown controller. This will signal to PMIC that it needs to switch +to the state corresponding to backup mode. + +Signed-off-by: Claudiu Beznea +Signed-off-by: Nicolas Ferre +Link: https://lore.kernel.org/r/20210415105010.569620-21-claudiu.beznea@microchip.com +--- + arch/arm/mach-at91/pm.c | 3 ++- + arch/arm/mach-at91/pm_suspend.S | 7 +++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +--- a/arch/arm/mach-at91/pm.c ++++ b/arch/arm/mach-at91/pm.c +@@ -744,7 +744,8 @@ static int __init at91_pm_backup_init(vo + struct platform_device *pdev; + int ret = -ENODEV, located = 0; + +- if (!IS_ENABLED(CONFIG_SOC_SAMA5D2)) ++ if (!IS_ENABLED(CONFIG_SOC_SAMA5D2) && ++ !IS_ENABLED(CONFIG_SOC_SAMA7G5)) + return -EPERM; + + if (!at91_is_pm_mode_active(AT91_PM_BACKUP)) +--- a/arch/arm/mach-at91/pm_suspend.S ++++ b/arch/arm/mach-at91/pm_suspend.S +@@ -106,6 +106,12 @@ lp_done_\ena: + #endif + .endm + ++ .macro at91_backup_set_lpm reg ++#ifdef CONFIG_SOC_SAMA7 ++ orr \reg, \reg, #0x200000 ++#endif ++ .endm ++ + .text + + .arm +@@ -989,6 +995,7 @@ ulp_exit: + ldr r0, .shdwc + mov tmp1, #0xA5000000 + add tmp1, tmp1, #0x1 ++ at91_backup_set_lpm tmp1 + str tmp1, [r0, #0] + .endm +