[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3a1f59af1ac9322b0203694b535d5d13120a31eb.1740671156.git.Ryan.Wanner@microchip.com>
Date: Thu, 27 Feb 2025 08:51:58 -0700
From: <Ryan.Wanner@...rochip.com>
To: <lee@...nel.org>, <robh@...nel.org>, <krzk+dt@...nel.org>,
<conor+dt@...nel.org>, <claudiu.beznea@...on.dev>, <sre@...nel.org>,
<nicolas.ferre@...rochip.com>, <alexandre.belloni@...tlin.com>,
<p.zabel@...gutronix.de>
CC: <linux@...linux.org.uk>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-pm@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-rtc@...r.kernel.org>, "Ryan
Wanner" <Ryan.Wanner@...rochip.com>
Subject: [PATCH v3 11/21] ARM: at91: PM: Add Backup mode for SAMA7D65
From: Ryan Wanner <Ryan.Wanner@...rochip.com>
Add config check that enables Backup mode for SAMA7D65 SoC.
Add SHDWC_SR read to clear the status bits once finished exiting backup
mode. This is only for SAMA7D65 SoCs. The SHDWC status register
needs to be cleared after exiting backup mode to clear the wake up pin
status.
Signed-off-by: Ryan Wanner <Ryan.Wanner@...rochip.com>
---
arch/arm/mach-at91/pm.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 39644703244d..d82a507bc8da 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -647,6 +647,11 @@ static void at91_pm_suspend(suspend_state_t state)
at91_suspend_sram_fn = fncpy(at91_suspend_sram_fn,
&at91_pm_suspend_in_sram,
at91_pm_suspend_in_sram_sz);
+
+ if (IS_ENABLED(CONFIG_SOC_SAMA7D65))
+ /* SHDWC.SR */
+ readl(soc_pm.data.shdwc + 0x08);
+
} else {
at91_suspend_finish(0);
}
@@ -707,6 +712,7 @@ static int at91_pm_enter(suspend_state_t state)
static void at91_pm_end(void)
{
at91_pm_config_ws(soc_pm.data.mode, false);
+
}
@@ -1065,7 +1071,8 @@ static int __init at91_pm_backup_init(void)
int ret = -ENODEV, located = 0;
if (!IS_ENABLED(CONFIG_SOC_SAMA5D2) &&
- !IS_ENABLED(CONFIG_SOC_SAMA7G5))
+ !IS_ENABLED(CONFIG_SOC_SAMA7G5) &&
+ !IS_ENABLED(CONFIG_SOC_SAMA7D65))
return -EPERM;
if (!at91_is_pm_mode_active(AT91_PM_BACKUP))
--
2.43.0
Powered by blists - more mailing lists