Commit f5ed5010 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'tegra-for-5.5-arm-core' of...

Merge tag 'tegra-for-5.5-arm-core' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/soc

ARM: tegra: Core changes for v5.5-rc1

Contains two fixes for CPU idle and suspend/resume on early Tegra SoCs.

* tag 'tegra-for-5.5-arm-core' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  ARM: tegra: Use WFE for power-gating on Tegra30
  ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume()

Link: https://lore.kernel.org/r/20191102144521.3863321-5-thierry.reding@gmail.comSigned-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 3bd00db6 91d7ff5a
...@@ -44,16 +44,16 @@ ENTRY(tegra_resume) ...@@ -44,16 +44,16 @@ ENTRY(tegra_resume)
cmp r6, #TEGRA20 cmp r6, #TEGRA20
beq 1f @ Yes beq 1f @ Yes
/* Clear the flow controller flags for this CPU. */ /* Clear the flow controller flags for this CPU. */
cpu_to_csr_reg r1, r0 cpu_to_csr_reg r3, r0
mov32 r2, TEGRA_FLOW_CTRL_BASE mov32 r2, TEGRA_FLOW_CTRL_BASE
ldr r1, [r2, r1] ldr r1, [r2, r3]
/* Clear event & intr flag */ /* Clear event & intr flag */
orr r1, r1, \ orr r1, r1, \
#FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG #FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG
movw r0, #0x3FFD @ enable, cluster_switch, immed, bitmaps movw r0, #0x3FFD @ enable, cluster_switch, immed, bitmaps
@ & ext flags for CPU power mgnt @ & ext flags for CPU power mgnt
bic r1, r1, r0 bic r1, r1, r0
str r1, [r2] str r1, [r2, r3]
1: 1:
mov32 r9, 0xc09 mov32 r9, 0xc09
......
...@@ -682,10 +682,12 @@ tegra30_enter_sleep: ...@@ -682,10 +682,12 @@ tegra30_enter_sleep:
dsb dsb
ldr r0, [r6, r2] /* memory barrier */ ldr r0, [r6, r2] /* memory barrier */
cmp r10, #TEGRA30
halted: halted:
isb isb
dsb dsb
wfi /* CPU should be power gated here */ wfine /* CPU should be power gated here */
wfeeq
/* !!!FIXME!!! Implement halt failure handler */ /* !!!FIXME!!! Implement halt failure handler */
b halted b halted
......
...@@ -91,8 +91,23 @@ void flowctrl_cpu_suspend_enter(unsigned int cpuid) ...@@ -91,8 +91,23 @@ void flowctrl_cpu_suspend_enter(unsigned int cpuid)
reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
/* clear wfi bitmap */ /* clear wfi bitmap */
reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP; reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP;
/* pwr gating on wfi */
reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid; if (tegra_get_chip_id() == TEGRA30) {
/*
* The wfi doesn't work well on Tegra30 because
* CPU hangs under some odd circumstances after
* power-gating (like memory running off PLLP),
* hence use wfe that is working perfectly fine.
* Note that Tegra30 TRM doc clearly stands that
* wfi should be used for the "Cluster Switching",
* while wfe for the power-gating, just like it
* is done on Tegra20.
*/
reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid;
} else {
/* pwr gating on wfi */
reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid;
}
break; break;
} }
reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */ reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment