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

Antoine Tenart antoine.tenart at free-electrons.com
Thu Sep 1 09:57:40 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

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 regarding sunXi SoCs. As this Kconfig option is currently
only used in the psci code, it should be safe to add it even of all the
SoCs having a GIC do not select it, as long as they don't have psci

Finally the series has a patch to enable the psci support for sun5i
SoCs, and another patch to let sun5i SoCs boot the kernel in non-secure
mode so that it can call psci functions.



Antoine Tenart (6):
  ARM: add the ARM_GIC configuration option
  sunxi: select ARM_GIC for sun[6789]i
  ARM: PSCI: protect GIC specific code with ARM_GIC
  sun5/7i: add an implementation of the psci suspend function
  sun5i: enable PSCI
  sun5i: boot in HYP mode by default

 arch/arm/Kconfig                              |   3 +
 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                  |  38 +++---
 arch/arm/include/asm/arch-sunxi/clock_sun4i.h |   7 ++
 arch/arm/include/asm/arch-sunxi/dram_sun4i.h  |  11 ++
 board/sunxi/Kconfig                           |   9 ++
 include/configs/sun5i.h                       |   5 +
 9 files changed, 248 insertions(+), 15 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/sunxi/psci_suspend.c


More information about the U-Boot mailing list