PSCI

From linux-sunxi.org
Jump to navigation Jump to search

PSCI is the Power State Coordination Interface on ARM-based devices. It defines a standard interface for power management, designed to work across various operating systems and privilege levels.

See:


U-Boot and PSCI

Boot modes

On architectures that support it (e.g. sun7i), recent mainline U-Boot allows booting in two different modes: the normal kernel mode, also known as "supervisor" (SVC) mode, and a "hypervisor" (HYP) mode. Hypervisor is a more privileged mode (designed to even control SVC operation, e.g. for virtualization).

For these platforms, and with standard U-Boot configuration (CONFIG_ARMV7_NONSEC set, and CONFIG_ARMV7_BOOT_SEC_DEFAULT absent), the hypervisor boot mode will be the default. Note that U-Boot labels it non-secure ("nonsec"), in contrast to secure ("sec") operation which corresponds to SVC. The boot mode can also be specified by explicitly setting the bootm_boot_mode environment variable. (http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/cpu/armv7/Kconfig)

The U-Boot PSCI interface is currently only available in "nonsec" (HYP) mode, which will cause the bootloader to automatically provide PSCI functions and corresponding device tree nodes.

see also:

Mainline kernel

With some combinations of mainline kernel version and architecture, PSCI may be required for SMP (i.e. to bring up more than one CPU). For example Linux 3.19.x and sun7i/A20 have been observed to show this behaviour. If the Linux kernel doesn't initialize the secondary core(s), you might want to double-check the boot mode and presence of the /psci node in the device tree.

To verify the actual boot mode, examine the mainline kernel boot messages (dmesg | grep -E 'psci|started in'). Search for a line that says

CPU: All CPU(s) started in <X> mode.

where <X> will be SVC for secure, and HYP for non-secure boot mode.

3.4.x kernels

Older kernels might not support non-secure boot mode, and thus may require the bootm_boot_mode=sec setting instead.