Skip to content

Commit bc0b964

Browse files
committed
soc: ti: omap-prm: Allow hardware supported retention when idle
When moving the l4 interconnect instances to probe with simple-pm-bus and genpd, we will have l4per and core domains stop idling unless we configure the domain bits to allow retention when idle. As the TI SoCs have hardware autoidle capabilities, this is safe to do. The domains will only enter retention on WFI when none of the devices on the domain block autoidle in the hardware. This follows what we are already currently doing. Cc: Santosh Shilimkar <[email protected]> Cc: Tero Kristo <[email protected]> Signed-off-by: Tony Lindgren <[email protected]>
1 parent a15de03 commit bc0b964

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

drivers/soc/ti/omap_prm.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ struct omap_reset_data {
8888
#define OMAP_PRM_HAS_RSTCTRL BIT(0)
8989
#define OMAP_PRM_HAS_RSTST BIT(1)
9090
#define OMAP_PRM_HAS_NO_CLKDM BIT(2)
91+
#define OMAP_PRM_RET_WHEN_IDLE BIT(3)
9192

9293
#define OMAP_PRM_HAS_RESETS (OMAP_PRM_HAS_RSTCTRL | OMAP_PRM_HAS_RSTST)
9394

@@ -174,7 +175,8 @@ static const struct omap_prm_data omap4_prm_data[] = {
174175
.name = "core", .base = 0x4a306700,
175176
.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_reton,
176177
.rstctrl = 0x210, .rstst = 0x214, .clkdm_name = "ducati",
177-
.rstmap = rst_map_012
178+
.rstmap = rst_map_012,
179+
.flags = OMAP_PRM_RET_WHEN_IDLE,
178180
},
179181
{
180182
.name = "ivahd", .base = 0x4a306f00,
@@ -199,7 +201,8 @@ static const struct omap_prm_data omap4_prm_data[] = {
199201
},
200202
{
201203
.name = "l4per", .base = 0x4a307400,
202-
.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_reton
204+
.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_reton,
205+
.flags = OMAP_PRM_RET_WHEN_IDLE,
203206
},
204207
{
205208
.name = "cefuse", .base = 0x4a307600,
@@ -517,7 +520,7 @@ static int omap_prm_domain_power_on(struct generic_pm_domain *domain)
517520
{
518521
struct omap_prm_domain *prmd;
519522
int ret;
520-
u32 v;
523+
u32 v, mode;
521524

522525
prmd = genpd_to_prm_domain(domain);
523526
if (!prmd->cap)
@@ -530,7 +533,12 @@ static int omap_prm_domain_power_on(struct generic_pm_domain *domain)
530533
else
531534
v = readl_relaxed(prmd->prm->base + prmd->pwrstctrl);
532535

533-
writel_relaxed(v | OMAP_PRMD_ON_ACTIVE,
536+
if (prmd->prm->data->flags & OMAP_PRM_RET_WHEN_IDLE)
537+
mode = OMAP_PRMD_RETENTION;
538+
else
539+
mode = OMAP_PRMD_ON_ACTIVE;
540+
541+
writel_relaxed((v & ~PRM_POWERSTATE_MASK) | mode,
534542
prmd->prm->base + prmd->pwrstctrl);
535543

536544
/* wait for the transition bit to get cleared */

0 commit comments

Comments
 (0)