[U-Boot] [PATCH v2 0/9] sunxi: sun5/7i: add the psci suspend function

Antoine Tenart antoine.tenart at free-electrons.com
Thu Oct 6 16:33:52 CEST 2016


Hi all,

This series adds an implementation of the psci suspend function for both
sun5i and sun7i. This was tested on Nextthing's CHIP and on a A20, using
cpuidle in Linux. My tests showed a power consumption reduced by a factor
2 on the CHIP when the system was idle. It went from ~1W without cpuidle
enabled to ~0.45W.

The idea of this suspend function is to put the dram into self-refresh,
cut off some plls and to switch cpuclk to a source with a lower
frequency. Please note the sun7i implementation lacks some parts as
putting the ram into self-refresh and coming back from this state seems
a bit tricky. I made some tests but did not managed yet to have a stable
solution.

As the sun5i does not have a GIC, I needed to remove some code from the
generic psci code. To do this I added an ARM_GIC Kconfig option which
needs to be selected by each SoC having a GIC. I already added the
relevant lines for SoCs using the PSCI ARMv7 code. As this Kconfig
option is currently only used in the psci code, it should be safe to add
it even if all the SoCs having a GIC do not select it, as long as they
don't have psci functions.

Finally the series has a patch to add defines used by the psci code and
another patch to let sun5i SoCs boot the kernel in non-secure mode so
that it can call psci functions.

Thanks!

Antoine

Since v1:
  - Rebased on the latest master and updated the patches.
  - Fixed a compile warning I introduced in virt-v7.c
  - Added the missing ARM_GIC Kconfig options.
  - Fixed a commit message (removed 'HYP').

Antoine Tenart (9):
  ARM: add the ARM_GIC configuration option
  sunxi: select ARM_GIC for sun[6789]i
  ARM: select ARM_GIC for SoCs having a psci implementation
  exynos: select ARM_GIC for TARGET_ARNDALE
  tegra: select ARM_GIC for Tegra TK1s
  ARM: PSCI: protect GIC specific code with ARM_GIC
  sun5/7i: add an implementation of the psci suspend function
  sun5i: add defines used by the PSCI code
  sun5i: boot in non-secure mode by default

 arch/arm/Kconfig                              |  11 ++
 arch/arm/cpu/armv7/nonsec_virt.S              |   6 +
 arch/arm/cpu/armv7/sunxi/Makefile             |   9 +-
 arch/arm/cpu/armv7/sunxi/psci_suspend.c       | 175 ++++++++++++++++++++++++++
 arch/arm/cpu/armv7/virt-v7.c                  |  42 ++++---
 arch/arm/include/asm/arch-sunxi/clock_sun4i.h |   7 ++
 arch/arm/include/asm/arch-sunxi/dram_sun4i.h  |  11 ++
 arch/arm/mach-exynos/Kconfig                  |   1 +
 arch/arm/mach-tegra/tegra124/Kconfig          |   2 +
 board/sunxi/Kconfig                           |   9 ++
 include/configs/sun5i.h                       |   3 +
 11 files changed, 261 insertions(+), 15 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/sunxi/psci_suspend.c

-- 
2.10.1



More information about the U-Boot mailing list