Skip to content

Commit 47fe740

Browse files
Sukrut Bellarykhilman
authored andcommitted
ARM: OMAP2+: Fix l4ls clk domain handling in STANDBY
Don't put the l4ls clk domain to sleep in case of standby. Since CM3 PM FW[1](ti-v4.1.y) doesn't wake-up/enable the l4ls clk domain upon wake-up, CM3 PM FW fails to wake-up the MPU. [1] https://git.ti.com/cgit/processor-firmware/ti-amx3-cm3-pm-firmware/ Signed-off-by: Sukrut Bellary <[email protected]> Tested-by: Judith Mendez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kevin Hilman <[email protected]>
1 parent 7d25c4e commit 47fe740

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

arch/arm/mach-omap2/clockdomain.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#define CLKDM_NO_AUTODEPS (1 << 4)
4949
#define CLKDM_ACTIVE_WITH_MPU (1 << 5)
5050
#define CLKDM_MISSING_IDLE_REPORTING (1 << 6)
51+
#define CLKDM_STANDBY_FORCE_WAKEUP BIT(7)
5152

5253
#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO)
5354
#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)

arch/arm/mach-omap2/clockdomains33xx_data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static struct clockdomain l4ls_am33xx_clkdm = {
1919
.pwrdm = { .name = "per_pwrdm" },
2020
.cm_inst = AM33XX_CM_PER_MOD,
2121
.clkdm_offs = AM33XX_CM_PER_L4LS_CLKSTCTRL_OFFSET,
22-
.flags = CLKDM_CAN_SWSUP,
22+
.flags = CLKDM_CAN_SWSUP | CLKDM_STANDBY_FORCE_WAKEUP,
2323
};
2424

2525
static struct clockdomain l3s_am33xx_clkdm = {

arch/arm/mach-omap2/cm33xx.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
#include "cm-regbits-34xx.h"
2121
#include "cm-regbits-33xx.h"
2222
#include "prm33xx.h"
23+
#if IS_ENABLED(CONFIG_SUSPEND)
24+
#include <linux/suspend.h>
25+
#endif
2326

2427
/*
2528
* CLKCTRL_IDLEST_*: possible values for the CM_*_CLKCTRL.IDLEST bitfield:
@@ -328,8 +331,17 @@ static int am33xx_clkdm_clk_disable(struct clockdomain *clkdm)
328331
{
329332
bool hwsup = false;
330333

334+
#if IS_ENABLED(CONFIG_SUSPEND)
335+
/*
336+
* In case of standby, Don't put the l4ls clk domain to sleep.
337+
* Since CM3 PM FW doesn't wake-up/enable the l4ls clk domain
338+
* upon wake-up, CM3 PM FW fails to wake-up th MPU.
339+
*/
340+
if (pm_suspend_target_state == PM_SUSPEND_STANDBY &&
341+
(clkdm->flags & CLKDM_STANDBY_FORCE_WAKEUP))
342+
return 0;
343+
#endif
331344
hwsup = am33xx_cm_is_clkdm_in_hwsup(clkdm->cm_inst, clkdm->clkdm_offs);
332-
333345
if (!hwsup && (clkdm->flags & CLKDM_CAN_FORCE_SLEEP))
334346
am33xx_clkdm_sleep(clkdm);
335347

0 commit comments

Comments
 (0)