1. 13 8月, 2013 4 次提交
    • J
      ARM: tegra: add LP1 suspend support for Tegra114 · e9f62449
      Joseph Lo 提交于
      The LP1 suspend mode will power off the CPU, clock gated the PLLs and put
      SDRAM to self-refresh mode. Any interrupt can wake up device from LP1. The
      sequence when LP1 suspending:
      
      * tunning off L1 data cache and the MMU
      * storing some EMC registers, DPD (deep power down) status, clk source of
        mselect and SCLK burst policy
      * putting SDRAM into self-refresh
      * switching CPU to CLK_M (12MHz OSC)
      * tunning off PLLM, PLLP, PLLA, PLLC and PLLX
      * switching SCLK to CLK_S (32KHz OSC)
      * shutting off the CPU rail
      
      The sequence of LP1 resuming:
      
      * re-enabling PLLM, PLLP, PLLA, PLLC and PLLX
      * restoring the clk source of mselect and SCLK burst policy
      * setting up CCLK burst policy to PLLX
      * restoring DPD status and some EMC registers
      * resuming SDRAM to normal mode
      * jumping to the "tegra_resume" from PMC_SCRATCH41
      
      Due to the SDRAM will be put into self-refresh mode, the low level
      procedures of LP1 suspending and resuming should be copied to
      TEGRA_IRAM_CODE_AREA (TEGRA_IRAM_BASE + SZ_4K) when suspending. Before
      restoring the CPU context when resuming, the SDRAM needs to be switched
      back to normal mode. And the PLLs need to be re-enabled, SCLK burst policy
      be restored. Then jumping to "tegra_resume" that was expected to be stored
      in PMC_SCRATCH41 to restore CPU context and back to kernel.
      
      Based on the work by: Bo Yan <byan@nvidia.com>
      Signed-off-by: NJoseph Lo <josephl@nvidia.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      e9f62449
    • J
      ARM: tegra: add LP1 suspend support for Tegra20 · 731a9274
      Joseph Lo 提交于
      The LP1 suspend mode will power off the CPU, clock gated the PLLs and put
      SDRAM to self-refresh mode. Any interrupt can wake up device from LP1. The
      sequence when LP1 suspending:
      
      * tunning off L1 data cache and the MMU
      * putting SDRAM into self-refresh
      * storing some EMC registers and SCLK burst policy
      * switching CPU to CLK_M (12MHz OSC)
      * switching SCLK to CLK_S (32KHz OSC)
      * tunning off PLLM, PLLP and PLLC
      * shutting off the CPU rail
      
      The sequence of LP1 resuming:
      
      * re-enabling PLLM, PLLP, and PLLC
      * restoring some EMC registers and SCLK burst policy
      * setting up CCLK burst policy to PLLP
      * resuming SDRAM to normal mode
      * jumping to the "tegra_resume" from PMC_SCRATCH41
      
      Due to the SDRAM will be put into self-refresh mode, the low level
      procedures of LP1 suspending and resuming should be copied to
      TEGRA_IRAM_CODE_AREA (TEGRA_IRAM_BASE + SZ_4K) when suspending. Before
      restoring the CPU context when resuming, the SDRAM needs to be switched
      back to normal mode. And the PLLs need to be re-enabled, SCLK burst policy
      be restored, CCLK burst policy be set in PLLP. Then jumping to
      "tegra_resume" that was expected to be stored in PMC_SCRATCH41 to restore
      CPU context and back to kernel.
      
      Based on the work by:
      Colin Cross <ccross@android.com>
      Gary King <gking@nvidia.com>
      Signed-off-by: NJoseph Lo <josephl@nvidia.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      731a9274
    • J
      ARM: tegra: add LP1 suspend support for Tegra30 · e7a932b1
      Joseph Lo 提交于
      The LP1 suspend mode will power off the CPU, clock gated the PLLs and put
      SDRAM to self-refresh mode. Any interrupt can wake up device from LP1. The
      sequence when LP1 suspending:
      
      * tunning off L1 data cache and the MMU
      * storing some EMC registers, DPD (deep power down) status, clk source of
        mselect and SCLK burst policy
      * putting SDRAM into self-refresh
      * switching CPU to CLK_M (12MHz OSC)
      * tunning off PLLM, PLLP, PLLA, PLLC and PLLX
      * switching SCLK to CLK_S (32KHz OSC)
      * shutting off the CPU rail
      
      The sequence of LP1 resuming:
      
      * re-enabling PLLM, PLLP, PLLA, PLLC and PLLX
      * restoring the clk source of mselect and SCLK burst policy
      * setting up CCLK burst policy to PLLX
      * restoring DPD status and some EMC registers
      * resuming SDRAM to normal mode
      * jumping to the "tegra_resume" from PMC_SCRATCH41
      
      Due to the SDRAM will be put into self-refresh mode, the low level
      procedures of LP1 suspending and resuming should be copied to
      TEGRA_IRAM_CODE_AREA (TEGRA_IRAM_BASE + SZ_4K) when suspending. Before
      restoring the CPU context when resuming, the SDRAM needs to be switched
      back to normal mode. And the PLLs need to be re-enabled, SCLK burst policy
      be restored, CCLK burst policy be set in PLLX. Then jumping to
      "tegra_resume" that was expected to be stored in PMC_SCRATCH41 to restore
      CPU context and back to kernel.
      
      Based on the work by: Scott Williams <scwilliams@nvidia.com>
      Signed-off-by: NJoseph Lo <josephl@nvidia.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      e7a932b1
    • J
      ARM: tegra: add common LP1 suspend support · 95872f42
      Joseph Lo 提交于
      The LP1 suspending mode on Tegra means CPU rail off, devices and PLLs are
      clock gated and SDRAM in self-refresh mode. That means the low level LP1
      suspending and resuming code couldn't be run on DRAM and the CPU must
      switch to the always on clock domain (a.k.a. CLK_M 12MHz oscillator). And
      the system clock (SCLK) would be switched to CLK_S, a 32KHz oscillator.
      The LP1 low level handling code need to be moved to IRAM area first. And
      marking the LP1 mask for indicating the Tegra device is in LP1. The CPU
      power timer needs to be re-calculated based on 32KHz that was originally
      based on PCLK.
      
      When resuming from LP1, the LP1 reset handler will resume PLLs and then
      put DRAM to normal mode. Then jumping to the "tegra_resume" that will
      restore full context before back to kernel. The "tegra_resume" handler
      was expected to be found in PMC_SCRATCH41 register.
      
      This is common LP1 procedures for Tegra, so we do these jobs mainly in
      this patch:
      * moving LP1 low level handling code to IRAM
      * marking LP1 mask
      * copying the physical address of "tegra_resume" to PMC_SCRATCH41
      * re-calculate the CPU power timer based on 32KHz
      Signed-off-by: NJoseph Lo <josephl@nvidia.com>
      [swarren, replaced IRAM_CODE macro with IO_ADDRESS(TEGRA_IRAM_CODE_AREA)]
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      95872f42
  2. 20 7月, 2013 2 次提交
  3. 06 6月, 2013 2 次提交
  4. 29 4月, 2013 1 次提交
  5. 05 4月, 2013 1 次提交
  6. 04 4月, 2013 3 次提交
  7. 27 3月, 2013 1 次提交
  8. 12 3月, 2013 1 次提交
    • S
      ARM: tegra: remove save/restore of CPU diag register · 02e75d64
      Stephen Warren 提交于
      Prior to this change, {save,restore}_cpu_arch_register() collaborated to
      maintain the value of the CPU diagnostic register across power cycles.
      This was required to maintain any CPU errata workaround enable bits in
      that register. However, now that the Tegra reset vector code always
      enables all required workarounds, there is no need to save and restore
      the diagnostic register; it is always explicitly programmed in the
      required manner.
      
      Hence, remove the save/restore logic.
      
      This has the advantage that the kernel always directly controls the value
      of this register every boot, rather than relying on a bootloader or other
      kernel code having previously written the correct value into it. This
      makes CPU0 (which was previously saved/restored) and CPUn (which should
      have been set up by the reset vector) be controlled in exactly the same
      way, which is easier to debug/find/...
      
      In particular, when converting Tegra to a multi-platform kernel, the CPU0
      diagnostic register value initially comes from the bootloader. Most Tegra
      bootloaders don't yet enable all required CPU bug workarounds. The
      previous commit updates the kernel to do so on any CPU power cycle.
      However, the save/restore code ends up over-writing the value with the
      old bootloader-driven value instead of the now more-likely-to-be-correct
      kernel value!
      
      Even irrespective of multi-platform conversion, this change limits the
      kernel's exposure to any WARs the bootloader didn't enable for CPU0: on
      the very first LP2 transition (CPU power-saving which power-cycles the
      CPU), the correct value will be enabled.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      02e75d64
  9. 29 1月, 2013 3 次提交
    • J
      ARM: tegra20: cpuidle: add powered-down state for secondary CPU · 5c1350bd
      Joseph Lo 提交于
      The powered-down state of Tegra20 requires power gating both CPU cores.
      When the secondary CPU requests to enter powered-down state, it saves
      its own contexts and then enters WFI. The Tegra20 had a limition to
      power down both CPU cores. The secondary CPU must waits for CPU0 in
      powered-down state too. If the secondary CPU be woken up before CPU0
      entering powered-down state, then it needs to restore its CPU states
      and waits for next chance.
      
      Be aware of that, you may see the legacy power state "LP2" in the code
      which is exactly the same meaning of "CPU power down".
      
      Based on the work by:
      Colin Cross <ccross@android.com>
      Gary King <gking@nvidia.com>
      Signed-off-by: NJoseph Lo <josephl@nvidia.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      5c1350bd
    • P
      ARM: tegra: move tegra_cpu_car.h to linux/clk/tegra.h · 89572c77
      Prashant Gaikwad 提交于
      tegra_cpu_car_ops struct is going to be accessed from drivers/clk/tegra.
      Move the tegra_cpu_car_ops to include/linux/clk/tegra.h.
      Signed-off-by: NPrashant Gaikwad <pgaikwad@nvidia.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      89572c77
    • J
      ARM: tegra: clean up the CPUINIT section · 8c627fa6
      Joseph Lo 提交于
      There are some redundant codes in the CPUINIT section that was caused by
      some codes not be organized well in "headsmp.S". Currently all the codes
      in "headsmp.S" were put into CPUINIT section. But actually it doesn't
      need to be loacted in CPUINIT section. There is no fuction access them
      in CPUINIT section and we will relocate them to IRAM.
      
      These codes also caused some unnecessary functions that access these
      codes been put into CPUINIT section too. This patch clean it up and put
      them into normal text section.
      Signed-off-by: NJoseph Lo <josephl@nvidia.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      8c627fa6
  10. 16 11月, 2012 3 次提交