All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 00/11] sunxi: sun5/7i: add the psci suspend function
@ 2017-04-30 13:29 Antoine Tenart
  2017-04-30 13:29 ` [U-Boot] [PATCH v4 01/11] arm: add atomic functions with return support Antoine Tenart
                   ` (11 more replies)
  0 siblings, 12 replies; 34+ messages in thread
From: Antoine Tenart @ 2017-04-30 13:29 UTC (permalink / raw)
  To: u-boot

Hi all,

Respin this series that was sent in October 2016, with comments and new
psci aware SoC taken into account.

This series adds an implementation of the psci suspend function for both
sun5i and sun7i. This was tested on Nextthing's CHIP, using cpuidle in
Linux.

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 selecting ARCH_SUPPORT_PSCI. 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.

On multi-core systems, we need to ensure all CPU are in psci suspend
function to switch the cpu clk source. Likewise, the first CPU to exit
the psci suspend function should restore the cpu clk source; and only
the first one. This series adds a few atomic operation (with return
support) in order to solve this problem. I used the Linux
implementation.

This series is based on sunxi/master (6e39de1b337e) and can be found on:
https://github.com/atenart/u-boot sunxi/psci-suspend

Thanks!

Antoine

Since v3:
  - Reworked the atomic functions with return support, based on the Linux
    implementation.
  - Do not disable LDO anymore.
  - Added some comments.
  - Poll the pll1 lock bit before switching to it.
  - Select CONFIG_ARM_GIC directly in CONFIG_TEGRA_COMMON.
  - Select ARM_GIC for mx7 and uniphier as well.

Since v2:
  - Stopped putting the dram into self-refresh.
  - Removed pll2-7 disabling.
  - Added an atomic variable to only change the cpuclk source when all
    CPUs are in idle.
  - Did a similar implementation to be sure the first CPU to leave the
    idle mode switches back the cpuclk source to pll1.
  - Rebased on the latest master and updated the patches.

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 (11):
  arm: add atomic functions with return support
  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
  tegra: select ARM_GIC for Tegra SoCs
  mx7: select ARM_GIC
  uniphier: select ARM_GIC
  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                              |  13 ++++
 arch/arm/cpu/armv7/mx7/Kconfig                |   1 +
 arch/arm/cpu/armv7/nonsec_virt.S              |   6 ++
 arch/arm/cpu/armv7/sunxi/Makefile             |   9 ++-
 arch/arm/cpu/armv7/sunxi/psci.c               |  40 +---------
 arch/arm/cpu/armv7/sunxi/psci.h               |  58 ++++++++++++++
 arch/arm/cpu/armv7/sunxi/psci_suspend.c       | 108 ++++++++++++++++++++++++++
 arch/arm/cpu/armv7/virt-v7.c                  |  42 ++++++----
 arch/arm/include/asm/arch-sunxi/clock_sun4i.h |   2 +
 arch/arm/include/asm/atomic.h                 |  36 +++++++++
 arch/arm/mach-tegra/Kconfig                   |   1 +
 arch/arm/mach-uniphier/Kconfig                |   1 +
 board/sunxi/Kconfig                           |  12 +++
 include/configs/sun5i.h                       |   2 +
 14 files changed, 278 insertions(+), 53 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/sunxi/psci.h
 create mode 100644 arch/arm/cpu/armv7/sunxi/psci_suspend.c

-- 
2.11.0

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2017-05-11  8:00 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-30 13:29 [U-Boot] [PATCH v4 00/11] sunxi: sun5/7i: add the psci suspend function Antoine Tenart
2017-04-30 13:29 ` [U-Boot] [PATCH v4 01/11] arm: add atomic functions with return support Antoine Tenart
2017-04-30 13:29 ` [U-Boot] [PATCH v4 02/11] arm: add the ARM_GIC configuration option Antoine Tenart
2017-04-30 13:29 ` [U-Boot] [PATCH v4 03/11] sunxi: select ARM_GIC for sun[6789]i Antoine Tenart
2017-04-30 13:29 ` [U-Boot] [PATCH v4 04/11] arm: select ARM_GIC for SoCs having a psci implementation Antoine Tenart
2017-05-11  8:00   ` Masahiro Yamada
2017-04-30 13:29 ` [U-Boot] [PATCH v4 05/11] tegra: select ARM_GIC for Tegra SoCs Antoine Tenart
2017-05-01 15:12   ` Tom Warren
2017-05-01 15:34     ` Stephen Warren
2017-05-02  6:51       ` Antoine Tenart
2017-05-02 14:58         ` Stephen Warren
2017-05-02  6:39     ` Antoine Tenart
2017-05-02  6:40       ` Antoine Tenart
2017-04-30 13:29 ` [U-Boot] [PATCH v4 06/11] mx7: select ARM_GIC Antoine Tenart
2017-04-30 13:29 ` [U-Boot] [PATCH v4 07/11] uniphier: " Antoine Tenart
2017-04-30 13:29 ` [U-Boot] [PATCH v4 08/11] arm: psci: protect GIC specific code with ARM_GIC Antoine Tenart
2017-04-30 13:29 ` [U-Boot] [PATCH v4 09/11] sun5/7i: add an implementation of the psci suspend function Antoine Tenart
2017-05-01 21:13   ` Maxime Ripard
2017-05-02  7:04     ` Antoine Tenart
2017-05-02  7:23       ` Antoine Tenart
2017-05-02  7:27         ` Chen-Yu Tsai
2017-05-02  7:33           ` Maxime Ripard
2017-05-02  7:42             ` Antoine Tenart
2017-05-02  7:56       ` Maxime Ripard
2017-05-02  8:06         ` Antoine Tenart
2017-04-30 13:29 ` [U-Boot] [PATCH v4 10/11] sun5i: add defines used by the PSCI code Antoine Tenart
2017-04-30 13:29 ` [U-Boot] [PATCH v4 11/11] sun5i: boot in non-secure mode by default Antoine Tenart
2017-05-01 21:14   ` Maxime Ripard
2017-05-02  6:54     ` Antoine Tenart
2017-05-02  7:34       ` Maxime Ripard
2017-04-30 16:26 ` [U-Boot] [PATCH v4 00/11] sunxi: sun5/7i: add the psci suspend function Angus Ainslie
2017-04-30 16:49   ` Antoine Tenart
2017-04-30 23:26     ` Angus Ainslie
2017-05-02  7:14       ` Antoine Tenart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.