diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2015-06-05 11:21:23 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2015-06-05 11:21:23 +0100 |
commit | addc8120a784181cc6410973948eee94ea16f2bd (patch) | |
tree | de84cba276c224bcc4c1070a58a4f19625960723 /arch/arm64/include | |
parent | eb7c11ee3c5ce6c45ac28a5015a8e60ed458b412 (diff) | |
parent | c5a1330573c1748179898f4799f130e416ce4738 (diff) | |
download | op-kernel-dev-addc8120a784181cc6410973948eee94ea16f2bd.zip op-kernel-dev-addc8120a784181cc6410973948eee94ea16f2bd.tar.gz |
Merge branch 'arm64/psci-rework' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux
* 'arm64/psci-rework' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux:
arm64: psci: remove ACPI coupling
arm64: psci: kill psci_power_state
arm64: psci: account for Trusted OS instances
arm64: psci: support unsigned return values
arm64: psci: remove unnecessary id indirection
arm64: smp: consistently use error codes
arm64: smp_plat: add get_logical_index
arm/arm64: kvm: add missing PSCI include
Conflicts:
arch/arm64/kernel/smp.c
Diffstat (limited to 'arch/arm64/include')
-rw-r--r-- | arch/arm64/include/asm/acpi.h | 15 | ||||
-rw-r--r-- | arch/arm64/include/asm/psci.h | 12 | ||||
-rw-r--r-- | arch/arm64/include/asm/smp_plat.h | 16 |
3 files changed, 27 insertions, 16 deletions
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 1240b86..39248d3 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -16,6 +16,7 @@ #include <linux/irqchip/arm-gic-acpi.h> #include <asm/cputype.h> +#include <asm/psci.h> #include <asm/smp_plat.h> /* Basic configuration for ACPI */ @@ -39,18 +40,6 @@ extern int acpi_disabled; extern int acpi_noirq; extern int acpi_pci_disabled; -/* 1 to indicate PSCI 0.2+ is implemented */ -static inline bool acpi_psci_present(void) -{ - return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_COMPLIANT; -} - -/* 1 to indicate HVC must be used instead of SMC as the PSCI conduit */ -static inline bool acpi_psci_use_hvc(void) -{ - return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_USE_HVC; -} - static inline void disable_acpi(void) { acpi_disabled = 1; @@ -88,8 +77,6 @@ static inline void arch_fix_phys_package_id(int num, u32 slot) { } void __init acpi_init_cpus(void); #else -static inline bool acpi_psci_present(void) { return false; } -static inline bool acpi_psci_use_hvc(void) { return false; } static inline void acpi_init_cpus(void) { } #endif /* CONFIG_ACPI */ diff --git a/arch/arm64/include/asm/psci.h b/arch/arm64/include/asm/psci.h index 2454bc5..49d7e1a 100644 --- a/arch/arm64/include/asm/psci.h +++ b/arch/arm64/include/asm/psci.h @@ -14,7 +14,15 @@ #ifndef __ASM_PSCI_H #define __ASM_PSCI_H -int psci_dt_init(void); -int psci_acpi_init(void); +int __init psci_dt_init(void); + +#ifdef CONFIG_ACPI +int __init psci_acpi_init(void); +bool __init acpi_psci_present(void); +bool __init acpi_psci_use_hvc(void); +#else +static inline int psci_acpi_init(void) { return 0; } +static inline bool acpi_psci_present(void) { return false; } +#endif #endif /* __ASM_PSCI_H */ diff --git a/arch/arm64/include/asm/smp_plat.h b/arch/arm64/include/asm/smp_plat.h index 8dcd61e..7abf757 100644 --- a/arch/arm64/include/asm/smp_plat.h +++ b/arch/arm64/include/asm/smp_plat.h @@ -19,6 +19,8 @@ #ifndef __ASM_SMP_PLAT_H #define __ASM_SMP_PLAT_H +#include <linux/cpumask.h> + #include <asm/types.h> struct mpidr_hash { @@ -39,6 +41,20 @@ static inline u32 mpidr_hash_size(void) */ extern u64 __cpu_logical_map[NR_CPUS]; #define cpu_logical_map(cpu) __cpu_logical_map[cpu] +/* + * Retrieve logical cpu index corresponding to a given MPIDR.Aff* + * - mpidr: MPIDR.Aff* bits to be used for the look-up + * + * Returns the cpu logical index or -EINVAL on look-up error + */ +static inline int get_logical_index(u64 mpidr) +{ + int cpu; + for (cpu = 0; cpu < nr_cpu_ids; cpu++) + if (cpu_logical_map(cpu) == mpidr) + return cpu; + return -EINVAL; +} void __init do_post_cpus_up_work(void); |