aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64
diff options
context:
space:
mode:
authorHanjun Guo <hanjun.guo@linaro.org>2013-07-03 19:15:17 +0800
committerGraeme Gregory <graeme.gregory@linaro.org>2013-09-25 14:01:16 +0100
commit8c4cc5b92b61e82e64c595f8cb5c35949036a69a (patch)
tree8696765b1379ff8e6ad78d6473c55c1c952e1cd9 /arch/arm64
parent41a556a8f1819e633314256e1ecc809533fd6bbe (diff)
ARM64 / ACPI: Prefill cpu possible and present maps and map logical cpu id to APIC id
When boot the kernel with MADT, the cpu possible and present maps should be prefilled for cpu topology and cpu hot-plug. The logic cpu id maps to GIC id is also implemented, then we can use it for ACPI driver for cpu hot-plug. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/include/asm/acpi.h8
-rw-r--r--arch/arm64/kernel/setup.c2
-rw-r--r--arch/arm64/kernel/smp.c2
3 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index b43ddba29dbd..c40148b77e6c 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -77,6 +77,12 @@ extern int acpi_noirq;
extern int acpi_pci_disabled;
extern int acpi_strict;
+/* map logic cpu id to physical APIC id
+ * APIC = GIC cpu interface on ARM
+ */
+extern volatile int arm_cpu_to_apicid[NR_CPUS];
+extern int boot_cpu_apic_id;
+
struct acpi_arm_root {
phys_addr_t phys_address;
unsigned long size;
@@ -86,6 +92,8 @@ extern struct acpi_arm_root acpi_arm_rsdp_info;
/* Low-level suspend routine. */
extern int acpi_suspend_lowlevel(void);
+extern void prefill_possible_map(void);
+
/* Physical address to resume after wakeup */
/* BOZO: was...
#define acpi_wakeup_address ((unsigned long)(real_mode_header->wakeup_start))
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index d557da684dae..7bac8b137ecf 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -296,7 +296,9 @@ void __init setup_arch(char **cmdline_p)
#endif
#ifdef CONFIG_ACPI
+ boot_cpu_apic_id = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
acpi_boot_init();
+ prefill_possible_map();
#endif
}
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 78db90dcc910..6039f5e534a4 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -415,7 +415,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
if (err)
continue;
+#ifndef CONFIG_ACPI
set_cpu_present(cpu, true);
+#endif
max_cpus--;
}
}