public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/9] ARMv7: add PSCI support to u-boot
@ 2013-11-21  8:59 Marc Zyngier
  2013-11-21  8:59 ` [U-Boot] [PATCH 1/9] ARM: HYP/non-sec: fix alignment requirements for vectors Marc Zyngier
                   ` (10 more replies)
  0 siblings, 11 replies; 48+ messages in thread
From: Marc Zyngier @ 2013-11-21  8:59 UTC (permalink / raw)
  To: u-boot

PSCI is an ARM standard that provides a generic interface that
supervisory software can use to manage power in the following
situations:
- Core idle management
- CPU hotplug
- big.LITTLE migration models
- System shutdown and reset

It basically allows the kernel to offload these tasks to the firmware,
and rely on common kernel side code.

More importantly, it gives a way to ensure that CPUs enter the kernel
at the appropriate exception level (ie HYP mode, to allow the use of
the virtualization extensions), even across events like CPUs being
powered off/on or suspended.

The main idea here is to reuse some of the existing u-boot code to
create a separate blob that can live in SRAM (or a reserved page of
memory), containing a secure monitor that will implement the PSCI
operations. This code will still be alive when u-boot is long gone,
hence the need for a piece of memory that will not be touched by the
OS.

This patch series contains 3 parts:
- the first four patches are just bug fixes
- the next three contain the generic PSCI code and build infrastructure
- the last two implement the CPU_ON method of the Allwinner A20 (aka sun7i).

I realize the A20 u-boot code is not upstream yet (BTW is anyone
actively working on that?), but hopefully that should give a good idea
of how things are structured so far. The patches are against a merge
of u-boot mainline and the sunxi tree as of ten days ago.

As for using this code, it goes like this:
sun7i# ext2load mmc 0:1 0x40000000 /boot/sunxi-psci.bin
908 bytes read in 18 ms (48.8 KiB/s)
sun7i# cp 0x40000000 0x4000 0x1000
sun7i# ext2load mmc 0:1 40008000 /boot/zImage
3415087 bytes read in 184 ms (17.7 MiB/s)
sun7i# setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/nfs nfsroot=10.1.203.35:/export/roots/bobby-brown,tcp,v3 rw ip=dhcp
sun7i# bootz 40008000

The kernel now boots in HYP mode, finds its secondary CPU without any
additional SMP code, and runs KVM out of the box. Hopefully, the
Xen/ARM guys can do the same fairly easily.

I'm wildly cross-posting this patch series, including to lists I'm not
subscribed to. Please keep me on Cc for any comment you may have.

Cheers,

	M.

Marc Zyngier (9):
  ARM: HYP/non-sec: fix alignment requirements for vectors
  ARM: HYP/non-sec: move switch to non-sec to the last boot phase
  ARM: HYP/non-sec: add a barrier after setting SCR.NS==1
  ARM: non-sec: reset CNTVOFF to zero
  ARM: HYP/non-sec: add generic ARMv7 PSCI code
  ARM: HYP/non-sec: make pen code sections depend on !ARMV7_PSCI
  ARM: HYP/non-sec: add the option for a second-stage monitor
  sunxi: HYP/non-sec: add sun7i PSCI backend
  sunxi: HYP/non-sec: configure CNTFRQ on all CPUs

 Makefile                                 |   5 ++
 arch/arm/cpu/armv7/Makefile              |   4 ++
 arch/arm/cpu/armv7/nonsec_virt.S         |  21 +++++-
 arch/arm/cpu/armv7/psci.S                | 109 ++++++++++++++++++++++++++++
 arch/arm/cpu/armv7/sunxi/Makefile        |   3 +
 arch/arm/cpu/armv7/sunxi/config.mk       |   6 +-
 arch/arm/cpu/armv7/sunxi/psci.S          | 119 +++++++++++++++++++++++++++++++
 arch/arm/cpu/armv7/sunxi/u-boot-psci.lds |  63 ++++++++++++++++
 arch/arm/cpu/armv7/virt-v7.c             |   2 +
 arch/arm/lib/bootm.c                     |   5 +-
 include/configs/sun7i.h                  |   7 ++
 psci/Makefile                            |  67 +++++++++++++++++
 12 files changed, 406 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/psci.S
 create mode 100644 arch/arm/cpu/armv7/sunxi/psci.S
 create mode 100644 arch/arm/cpu/armv7/sunxi/u-boot-psci.lds
 create mode 100644 psci/Makefile

-- 
1.8.2.3

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

end of thread, other threads:[~2014-06-04  1:51 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-21  8:59 [U-Boot] [PATCH 0/9] ARMv7: add PSCI support to u-boot Marc Zyngier
2013-11-21  8:59 ` [U-Boot] [PATCH 1/9] ARM: HYP/non-sec: fix alignment requirements for vectors Marc Zyngier
2013-11-21 10:19   ` Masahiro Yamada
2013-11-21 10:36     ` Marc Zyngier
2013-11-21 22:24   ` Andre Przywara
2013-11-21  8:59 ` [U-Boot] [PATCH 2/9] ARM: HYP/non-sec: move switch to non-sec to the last boot phase Marc Zyngier
2013-11-26 14:36   ` Andre Przywara
2013-11-21  8:59 ` [U-Boot] [PATCH 3/9] ARM: HYP/non-sec: add a barrier after setting SCR.NS==1 Marc Zyngier
2013-11-22  1:51   ` Christoffer Dall
2013-11-22 10:56     ` Marc Zyngier
2013-11-22 16:53       ` Christoffer Dall
2013-12-30  3:10     ` [U-Boot] [PATCH 3/9] ARM: HYP/non-sec switch in bootm.c TigerLiu at viatech.com.cn
2013-12-30  4:57       ` Christoffer Dall
2013-12-30  5:15         ` TigerLiu at viatech.com.cn
2013-12-30  5:22           ` Christoffer Dall
2013-12-30  5:33             ` TigerLiu at viatech.com.cn
2013-11-26 14:39   ` [U-Boot] [PATCH 3/9] ARM: HYP/non-sec: add a barrier after setting SCR.NS==1 Andre Przywara
2013-11-21  8:59 ` [U-Boot] [PATCH 4/9] ARM: non-sec: reset CNTVOFF to zero Marc Zyngier
2013-11-26 14:41   ` Andre Przywara
2013-11-26 14:46     ` Marc Zyngier
2013-11-21  8:59 ` [U-Boot] [PATCH 5/9] ARM: HYP/non-sec: add generic ARMv7 PSCI code Marc Zyngier
2013-11-21  8:59 ` [U-Boot] [PATCH 6/9] ARM: HYP/non-sec: make pen code sections depend on !ARMV7_PSCI Marc Zyngier
2014-06-04  1:51   ` [U-Boot] [PATCH 6/9] ARM: HYP/non-sec: make pen code sectionsdepend " TigerLiu at via-alliance.com
2013-11-21  9:00 ` [U-Boot] [PATCH 7/9] ARM: HYP/non-sec: add the option for a second-stage monitor Marc Zyngier
2013-11-21  9:00 ` [U-Boot] [PATCH 8/9] sunxi: HYP/non-sec: add sun7i PSCI backend Marc Zyngier
2013-11-21  9:00 ` [U-Boot] [PATCH 9/9] sunxi: HYP/non-sec: configure CNTFRQ on all CPUs Marc Zyngier
2013-11-21 14:28 ` [U-Boot] [PATCH 0/9] ARMv7: add PSCI support to u-boot Rob Herring
2013-11-21 15:04   ` Marc Zyngier
2013-11-22  1:54     ` Christoffer Dall
2013-11-22  3:58       ` Anup Patel
2013-11-22  8:42         ` [U-Boot] [linux-sunxi] " Ian Campbell
2013-11-22  9:00           ` Anup Patel
2013-11-22 16:49             ` Christoffer Dall
2013-11-22 10:25         ` [U-Boot] " Marc Zyngier
2013-11-22 10:51       ` Marc Zyngier
2013-11-22  8:40     ` [U-Boot] [linux-sunxi] " Ian Campbell
2013-11-22  8:56       ` Anup Patel
2013-11-22 10:49         ` Ian Campbell
2013-11-22 14:51       ` Marc Zyngier
2013-12-06 11:43 ` [U-Boot] " Andre Przywara
2013-12-06 12:12   ` Marc Zyngier
2013-12-06 12:59     ` [U-Boot] [linux-sunxi] " Ian Campbell
2013-12-06 15:44       ` Ian Campbell
2013-12-06 15:48         ` Andre Przywara
2013-12-06 17:21           ` Ian Campbell
2013-12-06 17:45             ` Marc Zyngier
2013-12-06 13:03     ` [U-Boot] " Andre Przywara
2013-12-06 16:00       ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox