]> git.ipfire.org Git - people/arne_f/kernel.git/blame - arch/arm64/include/asm/acpi.h
ARM64 / ACPI: Parse MADT for SMP initialization
[people/arne_f/kernel.git] / arch / arm64 / include / asm / acpi.h
CommitLineData
37655163
AS
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
652261a7
MS
15#include <linux/mm.h>
16
37655163
AS
17/* Basic configuration for ACPI */
18#ifdef CONFIG_ACPI
652261a7
MS
19/* ACPI table mapping after acpi_gbl_permanent_mmap is set */
20static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
21 acpi_size size)
22{
23 if (!page_is_ram(phys >> PAGE_SHIFT))
24 return ioremap(phys, size);
25
26 return ioremap_cache(phys, size);
27}
28#define acpi_os_ioremap acpi_os_ioremap
29
37655163
AS
30#define acpi_strict 1 /* No out-of-spec workarounds on ARM64 */
31extern int acpi_disabled;
32extern int acpi_noirq;
33extern int acpi_pci_disabled;
34
7c59a3df
GG
35/* 1 to indicate PSCI 0.2+ is implemented */
36static inline bool acpi_psci_present(void)
37{
38 return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_COMPLIANT;
39}
40
41/* 1 to indicate HVC must be used instead of SMC as the PSCI conduit */
42static inline bool acpi_psci_use_hvc(void)
43{
44 return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_USE_HVC;
45}
46
37655163
AS
47static inline void disable_acpi(void)
48{
49 acpi_disabled = 1;
50 acpi_pci_disabled = 1;
51 acpi_noirq = 1;
52}
53
b10d79f7
AS
54static inline void enable_acpi(void)
55{
56 acpi_disabled = 0;
57 acpi_pci_disabled = 0;
58 acpi_noirq = 0;
59}
60
37655163
AS
61/*
62 * It's used from ACPI core in kdump to boot UP system with SMP kernel,
63 * with this check the ACPI core will not override the CPU index
64 * obtained from GICC with 0 and not print some error message as well.
65 * Since MADT must provide at least one GICC structure for GIC
66 * initialization, CPU will be always available in MADT on ARM64.
67 */
68static inline bool acpi_has_cpu_in_madt(void)
69{
70 return true;
71}
72
73static inline void arch_fix_phys_package_id(int num, u32 slot) { }
fccb9a81 74void __init acpi_init_cpus(void);
37655163 75
7c59a3df
GG
76#else
77static inline bool acpi_psci_present(void) { return false; }
78static inline bool acpi_psci_use_hvc(void) { return false; }
fccb9a81 79static inline void acpi_init_cpus(void) { }
37655163
AS
80#endif /* CONFIG_ACPI */
81
82#endif /*_ASM_ACPI_H*/