aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-24 11:23:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-24 11:23:45 -0400
commit836ee4874e201a5907f9658fb2bf3527dd952d30 (patch)
tree34a9e521bbba61d127794278e7b14d96797273f4 /arch/arm64/include
parentfb65d872d7a8dc629837a49513911d0281577bfd (diff)
parent7676fa70feb2f3bcdd4b854a553a57d8ef8505aa (diff)
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull initial ACPI support for arm64 from Will Deacon: "This series introduces preliminary ACPI 5.1 support to the arm64 kernel using the "hardware reduced" profile. We don't support any peripherals yet, so it's fairly limited in scope: - MEMORY init (UEFI) - ACPI discovery (RSDP via UEFI) - CPU init (FADT) - GIC init (MADT) - SMP boot (MADT + PSCI) - ACPI Kconfig options (dependent on EXPERT) ACPI for arm64 has been in development for a while now and hardware has been available that can boot with either FDT or ACPI tables. This has been made possible by both changes to the ACPI spec to cater for ARM-based machines (known as "hardware-reduced" in ACPI parlance) but also a Linaro-driven effort to get this supported on top of the Linux kernel. This pull request is the result of that work. These changes allow us to initialise the CPUs, interrupt controller, and timers via ACPI tables, with memory information and cmdline coming from EFI. We don't support a hybrid ACPI/FDT scheme. Of course, there is still plenty of work to do (a serial console would be nice!) but I expect that to happen on a per-driver basis after this core series has been merged. Anyway, the diff stat here is fairly horrible, but splitting this up and merging it via all the different subsystems would have been extremely painful. Instead, we've got all the relevant Acks in place and I've not seen anything other than trivial (Kconfig) conflicts in -next (for completeness, I've included my resolution below). Nearly half of the insertions fall under Documentation/. So, we'll see how this goes. Right now, it all depends on EXPERT and I fully expect people to use FDT by default for the immediate future" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (31 commits) ARM64 / ACPI: make acpi_map_gic_cpu_interface() as void function ARM64 / ACPI: Ignore the return error value of acpi_map_gic_cpu_interface() ARM64 / ACPI: fix usage of acpi_map_gic_cpu_interface ARM64: kernel: acpi: honour acpi=force command line parameter ARM64: kernel: acpi: refactor ACPI tables init and checks ARM64: kernel: psci: let ACPI probe PSCI version ARM64: kernel: psci: factor out probe function ACPI: move arm64 GSI IRQ model to generic GSI IRQ layer ARM64 / ACPI: Don't unflatten device tree if acpi=force is passed ARM64 / ACPI: additions of ACPI documentation for arm64 Documentation: ACPI for ARM64 ARM64 / ACPI: Enable ARM64 in Kconfig XEN / ACPI: Make XEN ACPI depend on X86 ARM64 / ACPI: Select ACPI_REDUCED_HARDWARE_ONLY if ACPI is enabled on ARM64 clocksource / arch_timer: Parse GTDT to initialize arch timer irqchip: Add GICv2 specific ACPI boot support ARM64 / ACPI: Introduce ACPI_IRQ_MODEL_GIC and register device's gsi ACPI / processor: Make it possible to get CPU hardware ID via GICC ACPI / processor: Introduce phys_cpuid_t for CPU hardware ID ARM64 / ACPI: Parse MADT for SMP initialization ...
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/acenv.h18
-rw-r--r--arch/arm64/include/asm/acpi.h96
-rw-r--r--arch/arm64/include/asm/cpu_ops.h1
-rw-r--r--arch/arm64/include/asm/fixmap.h3
-rw-r--r--arch/arm64/include/asm/irq.h13
-rw-r--r--arch/arm64/include/asm/pci.h6
-rw-r--r--arch/arm64/include/asm/psci.h3
-rw-r--r--arch/arm64/include/asm/smp.h5
8 files changed, 142 insertions, 3 deletions
diff --git a/arch/arm64/include/asm/acenv.h b/arch/arm64/include/asm/acenv.h
new file mode 100644
index 000000000000..b49166fde7ea
--- /dev/null
+++ b/arch/arm64/include/asm/acenv.h
@@ -0,0 +1,18 @@
1/*
2 * ARM64 specific ACPICA environments and implementation
3 *
4 * Copyright (C) 2014, Linaro Ltd.
5 * Author: Hanjun Guo <hanjun.guo@linaro.org>
6 * Author: Graeme Gregory <graeme.gregory@linaro.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef _ASM_ACENV_H
14#define _ASM_ACENV_H
15
16/* It is required unconditionally by ACPI core, update it when needed. */
17
18#endif /* _ASM_ACENV_H */
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
new file mode 100644
index 000000000000..59c05d8ea4a0
--- /dev/null
+++ b/arch/arm64/include/asm/acpi.h
@@ -0,0 +1,96 @@
1/*
2 * Copyright (C) 2013-2014, Linaro Ltd.
3 * Author: Al Stone <al.stone@linaro.org>
4 * Author: Graeme Gregory <graeme.gregory@linaro.org>
5 * Author: Hanjun Guo <hanjun.guo@linaro.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation;
10 */
11
12#ifndef _ASM_ACPI_H
13#define _ASM_ACPI_H
14
15#include <linux/mm.h>
16#include <linux/irqchip/arm-gic-acpi.h>
17
18#include <asm/cputype.h>
19#include <asm/smp_plat.h>
20
21/* Basic configuration for ACPI */
22#ifdef CONFIG_ACPI
23/* ACPI table mapping after acpi_gbl_permanent_mmap is set */
24static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
25 acpi_size size)
26{
27 if (!page_is_ram(phys >> PAGE_SHIFT))
28 return ioremap(phys, size);
29
30 return ioremap_cache(phys, size);
31}
32#define acpi_os_ioremap acpi_os_ioremap
33
34typedef u64 phys_cpuid_t;
35#define PHYS_CPUID_INVALID INVALID_HWID
36
37#define acpi_strict 1 /* No out-of-spec workarounds on ARM64 */
38extern int acpi_disabled;
39extern int acpi_noirq;
40extern int acpi_pci_disabled;
41
42/* 1 to indicate PSCI 0.2+ is implemented */
43static inline bool acpi_psci_present(void)
44{
45 return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_COMPLIANT;
46}
47
48/* 1 to indicate HVC must be used instead of SMC as the PSCI conduit */
49static inline bool acpi_psci_use_hvc(void)
50{
51 return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_USE_HVC;
52}
53
54static inline void disable_acpi(void)
55{
56 acpi_disabled = 1;
57 acpi_pci_disabled = 1;
58 acpi_noirq = 1;
59}
60
61static inline void enable_acpi(void)
62{
63 acpi_disabled = 0;
64 acpi_pci_disabled = 0;
65 acpi_noirq = 0;
66}
67
68/*
69 * The ACPI processor driver for ACPI core code needs this macro
70 * to find out this cpu was already mapped (mapping from CPU hardware
71 * ID to CPU logical ID) or not.
72 */
73#define cpu_physical_id(cpu) cpu_logical_map(cpu)
74
75/*
76 * It's used from ACPI core in kdump to boot UP system with SMP kernel,
77 * with this check the ACPI core will not override the CPU index
78 * obtained from GICC with 0 and not print some error message as well.
79 * Since MADT must provide at least one GICC structure for GIC
80 * initialization, CPU will be always available in MADT on ARM64.
81 */
82static inline bool acpi_has_cpu_in_madt(void)
83{
84 return true;
85}
86
87static inline void arch_fix_phys_package_id(int num, u32 slot) { }
88void __init acpi_init_cpus(void);
89
90#else
91static inline bool acpi_psci_present(void) { return false; }
92static inline bool acpi_psci_use_hvc(void) { return false; }
93static inline void acpi_init_cpus(void) { }
94#endif /* CONFIG_ACPI */
95
96#endif /*_ASM_ACPI_H*/
diff --git a/arch/arm64/include/asm/cpu_ops.h b/arch/arm64/include/asm/cpu_ops.h
index da301ee7395c..5a31d6716914 100644
--- a/arch/arm64/include/asm/cpu_ops.h
+++ b/arch/arm64/include/asm/cpu_ops.h
@@ -66,5 +66,6 @@ struct cpu_operations {
66extern const struct cpu_operations *cpu_ops[NR_CPUS]; 66extern const struct cpu_operations *cpu_ops[NR_CPUS];
67int __init cpu_read_ops(struct device_node *dn, int cpu); 67int __init cpu_read_ops(struct device_node *dn, int cpu);
68void __init cpu_read_bootcpu_ops(void); 68void __init cpu_read_bootcpu_ops(void);
69const struct cpu_operations *cpu_get_ops(const char *name);
69 70
70#endif /* ifndef __ASM_CPU_OPS_H */ 71#endif /* ifndef __ASM_CPU_OPS_H */
diff --git a/arch/arm64/include/asm/fixmap.h b/arch/arm64/include/asm/fixmap.h
index 926495686554..95e6b6dcbe37 100644
--- a/arch/arm64/include/asm/fixmap.h
+++ b/arch/arm64/include/asm/fixmap.h
@@ -62,6 +62,9 @@ void __init early_fixmap_init(void);
62 62
63#define __early_set_fixmap __set_fixmap 63#define __early_set_fixmap __set_fixmap
64 64
65#define __late_set_fixmap __set_fixmap
66#define __late_clear_fixmap(idx) __set_fixmap((idx), 0, FIXMAP_PAGE_CLEAR)
67
65extern void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot); 68extern void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot);
66 69
67#include <asm-generic/fixmap.h> 70#include <asm-generic/fixmap.h>
diff --git a/arch/arm64/include/asm/irq.h b/arch/arm64/include/asm/irq.h
index 94c53674a31d..bbb251b14746 100644
--- a/arch/arm64/include/asm/irq.h
+++ b/arch/arm64/include/asm/irq.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_IRQ_H 1#ifndef __ASM_IRQ_H
2#define __ASM_IRQ_H 2#define __ASM_IRQ_H
3 3
4#include <linux/irqchip/arm-gic-acpi.h>
5
4#include <asm-generic/irq.h> 6#include <asm-generic/irq.h>
5 7
6struct pt_regs; 8struct pt_regs;
@@ -8,4 +10,15 @@ struct pt_regs;
8extern void migrate_irqs(void); 10extern void migrate_irqs(void);
9extern void set_handle_irq(void (*handle_irq)(struct pt_regs *)); 11extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
10 12
13static inline void acpi_irq_init(void)
14{
15 /*
16 * Hardcode ACPI IRQ chip initialization to GICv2 for now.
17 * Proper irqchip infrastructure will be implemented along with
18 * incoming GICv2m|GICv3|ITS bits.
19 */
20 acpi_gic_init();
21}
22#define acpi_irq_init acpi_irq_init
23
11#endif 24#endif
diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h
index 872ba939fcb2..b008a72f8bc0 100644
--- a/arch/arm64/include/asm/pci.h
+++ b/arch/arm64/include/asm/pci.h
@@ -27,6 +27,12 @@
27extern int isa_dma_bridge_buggy; 27extern int isa_dma_bridge_buggy;
28 28
29#ifdef CONFIG_PCI 29#ifdef CONFIG_PCI
30static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
31{
32 /* no legacy IRQ on arm64 */
33 return -ENODEV;
34}
35
30static inline int pci_proc_domain(struct pci_bus *bus) 36static inline int pci_proc_domain(struct pci_bus *bus)
31{ 37{
32 return 1; 38 return 1;
diff --git a/arch/arm64/include/asm/psci.h b/arch/arm64/include/asm/psci.h
index e5312ea0ec1a..2454bc59c916 100644
--- a/arch/arm64/include/asm/psci.h
+++ b/arch/arm64/include/asm/psci.h
@@ -14,6 +14,7 @@
14#ifndef __ASM_PSCI_H 14#ifndef __ASM_PSCI_H
15#define __ASM_PSCI_H 15#define __ASM_PSCI_H
16 16
17int psci_init(void); 17int psci_dt_init(void);
18int psci_acpi_init(void);
18 19
19#endif /* __ASM_PSCI_H */ 20#endif /* __ASM_PSCI_H */
diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm/smp.h
index 780f82c827b6..bf22650b1a78 100644
--- a/arch/arm64/include/asm/smp.h
+++ b/arch/arm64/include/asm/smp.h
@@ -39,9 +39,10 @@ extern void show_ipi_list(struct seq_file *p, int prec);
39extern void handle_IPI(int ipinr, struct pt_regs *regs); 39extern void handle_IPI(int ipinr, struct pt_regs *regs);
40 40
41/* 41/*
42 * Setup the set of possible CPUs (via set_cpu_possible) 42 * Discover the set of possible CPUs and determine their
43 * SMP operations.
43 */ 44 */
44extern void smp_init_cpus(void); 45extern void of_smp_init_cpus(void);
45 46
46/* 47/*
47 * Provide a function to raise an IPI cross call on CPUs in callmap. 48 * Provide a function to raise an IPI cross call on CPUs in callmap.