arm64: add PSCI support for qemu platform

Summary
   Add ARM PCSI (Power State Coordination Interface) Support
for qemu. With the interface, Poweroff/PowerReset can be support

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
This commit is contained in:
qinwei1 2023-08-11 16:35:07 +08:00 committed by Xiang Xiao
parent 1e55ca43ef
commit cb3e6667e3
3 changed files with 7 additions and 1 deletions

View File

@ -49,6 +49,7 @@ config ARCH_CHIP_RK3399
config ARCH_CHIP_QEMU config ARCH_CHIP_QEMU
bool "QEMU virt platform (ARMv8a)" bool "QEMU virt platform (ARMv8a)"
select ARCH_HAVE_ADDRENV select ARCH_HAVE_ADDRENV
select ARCH_HAVE_PSCI
select ARCH_NEED_ADDRENV_MAPPING select ARCH_NEED_ADDRENV_MAPPING
---help--- ---help---
QEMU virt platform (ARMv8a) QEMU virt platform (ARMv8a)
@ -56,6 +57,7 @@ config ARCH_CHIP_QEMU
config ARCH_CHIP_GOLDFISH config ARCH_CHIP_GOLDFISH
bool "goldfish platform (ARMv8a)" bool "goldfish platform (ARMv8a)"
select ARCH_CORTEX_A53 select ARCH_CORTEX_A53
select ARCH_HAVE_PSCI
select ARCH_HAVE_MULTICPU select ARCH_HAVE_MULTICPU
select ARMV8A_HAVE_GICv2 select ARMV8A_HAVE_GICv2
select ARCH_HAVE_ADDRENV select ARCH_HAVE_ADDRENV

View File

@ -174,6 +174,10 @@ void arm64_chip_boot(void)
arm64_mmu_init(true); arm64_mmu_init(true);
#ifdef CONFIG_ARCH_HAVE_PSCI
arm64_psci_init("smc");
#endif
/* Perform board-specific device initialization. This would include /* Perform board-specific device initialization. This would include
* configuration of board specific resources such as GPIOs, LEDs, etc. * configuration of board specific resources such as GPIOs, LEDs, etc.
*/ */

View File

@ -177,7 +177,7 @@ void arm64_chip_boot(void)
#if defined(CONFIG_ARCH_CHIP_QEMU_WITH_HV) #if defined(CONFIG_ARCH_CHIP_QEMU_WITH_HV)
arm64_psci_init("hvc"); arm64_psci_init("hvc");
#elif defined(CONFIG_SMP) || defined(CONFIG_ARCH_HAVE_PSCI) #elif defined(CONFIG_ARCH_HAVE_PSCI)
arm64_psci_init("smc"); arm64_psci_init("smc");
#endif #endif