ARM: tegra: Use clk_m CPU on Tegra124 LP1 resume
authorStephen Warren <swarren@nvidia.com>
Thu, 3 Oct 2019 20:50:33 +0000 (14:50 -0600)
committerThierry Reding <treding@nvidia.com>
Wed, 8 Jan 2020 11:58:46 +0000 (12:58 +0100)
Configure the clock controller to set an alternate clock for the CPU
when it receives an IRQ during LP1 (system suspend). Specifically, use
clk_m (the crystal) rather than clk_s (a 32KHz clock). Such an IRQ will
be the LP1 wake event. This reduces the amount of time taken to resume
from LP1.

NVIDIA's downstream kernel executes this code on both Tegra30 and
Tegra124, so it appears OK to make this change unconditionally.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
arch/arm/mach-tegra/sleep-tegra30.S

index f01ea3be1405e4d293ba7ad7be84d94816e4db85..02cc6ff96f30ad8b5575e1bf29566353e1252d8b 100644 (file)
@@ -670,8 +670,12 @@ tegra30_switch_cpu_to_clk32k:
        pll_iddq_entry r1, r5, CLK_RESET_PLLX_MISC3, CLK_RESET_PLLX_MISC3_IDDQ
 _no_pll_in_iddq:
 
-       /* switch to CLKS */
-       mov     r0, #0  /* brust policy = 32KHz */
+       /*
+        * Switch to clk_s (32KHz); bits 28:31=0
+        * Enable burst on CPU IRQ; bit 24=1
+        * Set IRQ burst clock source to clk_m; bits 10:8=0
+        */
+       mov     r0, #(1 << 24)
        str     r0, [r5, #CLK_RESET_SCLK_BURST]
 
        ret     lr