ARM64 / ACPI: Get RSDP and ACPI boot-time tables
As we want to get ACPI tables to parse and then use the information
for system initialization, we should get the RSDP (Root System
Description Pointer) first, it then locates Extended Root Description
Table (XSDT) which contains all the 64-bit physical address that
pointer to other boot-time tables.
Introduce acpi.c and its related head file in this patch to provide
fundamental needs of extern variables and functions for ACPI core,
and then get boot-time tables as needed.
- asm/acenv.h for arch specific ACPICA environments and
implementation, It is needed unconditionally by ACPI core;
- asm/acpi.h for arch specific variables and functions needed by
ACPI driver core;
- acpi.c for ARM64 related ACPI implementation for ACPI driver
core;
acpi_boot_table_init() is introduced to get RSDP and boot-time tables,
it will be called in setup_arch() before paging_init(), so we should
use eary_memremap() mechanism here to get the RSDP and all the table
pointers.
FADT Major.Minor version was introduced in ACPI 5.1, it is the same
as ACPI version.
In ACPI 5.1, some major gaps are fixed for ARM, such as updates in
MADT table for GIC and SMP init, without those updates, we can not
get the MPIDR for SMP init, and GICv2/3 related init information, so
we can't boot arm64 ACPI properly with table versions predating 5.1.
If firmware provides ACPI tables with ACPI version less than 5.1,
OS has no way to retrieve the configuration data that is necessary
to init SMP boot protocol and the GIC properly, so disable ACPI if
we get an FADT table with version less that 5.1 when acpi_boot_table_init()
called.
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Tested-by: Yijing Wang <wangyijing@huawei.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Jon Masters <jcm@redhat.com>
Tested-by: Timur Tabi <timur@codeaurora.org>
Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Al Stone <al.stone@linaro.org>
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-03-24 22:02:37 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013-2014, Linaro Ltd.
|
|
|
|
* Author: Al Stone <al.stone@linaro.org>
|
|
|
|
* Author: Graeme Gregory <graeme.gregory@linaro.org>
|
|
|
|
* Author: Hanjun Guo <hanjun.guo@linaro.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation;
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ASM_ACPI_H
|
|
|
|
#define _ASM_ACPI_H
|
|
|
|
|
2016-08-22 14:55:24 +08:00
|
|
|
#include <linux/memblock.h>
|
2015-07-31 22:46:16 +08:00
|
|
|
#include <linux/psci.h>
|
2015-03-24 22:02:49 +08:00
|
|
|
|
2015-03-24 22:02:47 +08:00
|
|
|
#include <asm/cputype.h>
|
|
|
|
#include <asm/smp_plat.h>
|
2016-12-01 21:51:12 +08:00
|
|
|
#include <asm/tlbflush.h>
|
2015-03-24 22:02:38 +08:00
|
|
|
|
2015-07-07 07:16:47 +08:00
|
|
|
/* Macros for consistency checks of the GICC subtable of MADT */
|
|
|
|
#define ACPI_MADT_GICC_LENGTH \
|
|
|
|
(acpi_gbl_FADT.header.revision < 6 ? 76 : 80)
|
|
|
|
|
|
|
|
#define BAD_MADT_GICC_ENTRY(entry, end) \
|
|
|
|
(!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) || \
|
|
|
|
(entry)->header.length != ACPI_MADT_GICC_LENGTH)
|
|
|
|
|
ARM64 / ACPI: Get RSDP and ACPI boot-time tables
As we want to get ACPI tables to parse and then use the information
for system initialization, we should get the RSDP (Root System
Description Pointer) first, it then locates Extended Root Description
Table (XSDT) which contains all the 64-bit physical address that
pointer to other boot-time tables.
Introduce acpi.c and its related head file in this patch to provide
fundamental needs of extern variables and functions for ACPI core,
and then get boot-time tables as needed.
- asm/acenv.h for arch specific ACPICA environments and
implementation, It is needed unconditionally by ACPI core;
- asm/acpi.h for arch specific variables and functions needed by
ACPI driver core;
- acpi.c for ARM64 related ACPI implementation for ACPI driver
core;
acpi_boot_table_init() is introduced to get RSDP and boot-time tables,
it will be called in setup_arch() before paging_init(), so we should
use eary_memremap() mechanism here to get the RSDP and all the table
pointers.
FADT Major.Minor version was introduced in ACPI 5.1, it is the same
as ACPI version.
In ACPI 5.1, some major gaps are fixed for ARM, such as updates in
MADT table for GIC and SMP init, without those updates, we can not
get the MPIDR for SMP init, and GICv2/3 related init information, so
we can't boot arm64 ACPI properly with table versions predating 5.1.
If firmware provides ACPI tables with ACPI version less than 5.1,
OS has no way to retrieve the configuration data that is necessary
to init SMP boot protocol and the GIC properly, so disable ACPI if
we get an FADT table with version less that 5.1 when acpi_boot_table_init()
called.
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Tested-by: Yijing Wang <wangyijing@huawei.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Jon Masters <jcm@redhat.com>
Tested-by: Timur Tabi <timur@codeaurora.org>
Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Al Stone <al.stone@linaro.org>
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-03-24 22:02:37 +08:00
|
|
|
/* Basic configuration for ACPI */
|
|
|
|
#ifdef CONFIG_ACPI
|
2016-12-14 15:04:46 +08:00
|
|
|
/* ACPI table mapping after acpi_permanent_mmap is set */
|
2015-03-24 22:02:38 +08:00
|
|
|
static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
|
|
|
|
acpi_size size)
|
|
|
|
{
|
2016-08-22 14:55:24 +08:00
|
|
|
/*
|
|
|
|
* EFI's reserve_regions() call adds memory with the WB attribute
|
|
|
|
* to memblock via early_init_dt_add_memory_arch().
|
|
|
|
*/
|
|
|
|
if (!memblock_is_memory(phys))
|
2015-03-24 22:02:38 +08:00
|
|
|
return ioremap(phys, size);
|
|
|
|
|
|
|
|
return ioremap_cache(phys, size);
|
|
|
|
}
|
|
|
|
#define acpi_os_ioremap acpi_os_ioremap
|
|
|
|
|
2015-03-24 22:02:47 +08:00
|
|
|
typedef u64 phys_cpuid_t;
|
|
|
|
#define PHYS_CPUID_INVALID INVALID_HWID
|
|
|
|
|
ARM64 / ACPI: Get RSDP and ACPI boot-time tables
As we want to get ACPI tables to parse and then use the information
for system initialization, we should get the RSDP (Root System
Description Pointer) first, it then locates Extended Root Description
Table (XSDT) which contains all the 64-bit physical address that
pointer to other boot-time tables.
Introduce acpi.c and its related head file in this patch to provide
fundamental needs of extern variables and functions for ACPI core,
and then get boot-time tables as needed.
- asm/acenv.h for arch specific ACPICA environments and
implementation, It is needed unconditionally by ACPI core;
- asm/acpi.h for arch specific variables and functions needed by
ACPI driver core;
- acpi.c for ARM64 related ACPI implementation for ACPI driver
core;
acpi_boot_table_init() is introduced to get RSDP and boot-time tables,
it will be called in setup_arch() before paging_init(), so we should
use eary_memremap() mechanism here to get the RSDP and all the table
pointers.
FADT Major.Minor version was introduced in ACPI 5.1, it is the same
as ACPI version.
In ACPI 5.1, some major gaps are fixed for ARM, such as updates in
MADT table for GIC and SMP init, without those updates, we can not
get the MPIDR for SMP init, and GICv2/3 related init information, so
we can't boot arm64 ACPI properly with table versions predating 5.1.
If firmware provides ACPI tables with ACPI version less than 5.1,
OS has no way to retrieve the configuration data that is necessary
to init SMP boot protocol and the GIC properly, so disable ACPI if
we get an FADT table with version less that 5.1 when acpi_boot_table_init()
called.
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Tested-by: Yijing Wang <wangyijing@huawei.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Jon Masters <jcm@redhat.com>
Tested-by: Timur Tabi <timur@codeaurora.org>
Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Al Stone <al.stone@linaro.org>
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-03-24 22:02:37 +08:00
|
|
|
#define acpi_strict 1 /* No out-of-spec workarounds on ARM64 */
|
|
|
|
extern int acpi_disabled;
|
|
|
|
extern int acpi_noirq;
|
|
|
|
extern int acpi_pci_disabled;
|
|
|
|
|
|
|
|
static inline void disable_acpi(void)
|
|
|
|
{
|
|
|
|
acpi_disabled = 1;
|
|
|
|
acpi_pci_disabled = 1;
|
|
|
|
acpi_noirq = 1;
|
|
|
|
}
|
|
|
|
|
2015-03-24 22:02:41 +08:00
|
|
|
static inline void enable_acpi(void)
|
|
|
|
{
|
|
|
|
acpi_disabled = 0;
|
|
|
|
acpi_pci_disabled = 0;
|
|
|
|
acpi_noirq = 0;
|
|
|
|
}
|
|
|
|
|
2015-03-24 22:02:47 +08:00
|
|
|
/*
|
|
|
|
* The ACPI processor driver for ACPI core code needs this macro
|
|
|
|
* to find out this cpu was already mapped (mapping from CPU hardware
|
|
|
|
* ID to CPU logical ID) or not.
|
|
|
|
*/
|
|
|
|
#define cpu_physical_id(cpu) cpu_logical_map(cpu)
|
|
|
|
|
ARM64 / ACPI: Get RSDP and ACPI boot-time tables
As we want to get ACPI tables to parse and then use the information
for system initialization, we should get the RSDP (Root System
Description Pointer) first, it then locates Extended Root Description
Table (XSDT) which contains all the 64-bit physical address that
pointer to other boot-time tables.
Introduce acpi.c and its related head file in this patch to provide
fundamental needs of extern variables and functions for ACPI core,
and then get boot-time tables as needed.
- asm/acenv.h for arch specific ACPICA environments and
implementation, It is needed unconditionally by ACPI core;
- asm/acpi.h for arch specific variables and functions needed by
ACPI driver core;
- acpi.c for ARM64 related ACPI implementation for ACPI driver
core;
acpi_boot_table_init() is introduced to get RSDP and boot-time tables,
it will be called in setup_arch() before paging_init(), so we should
use eary_memremap() mechanism here to get the RSDP and all the table
pointers.
FADT Major.Minor version was introduced in ACPI 5.1, it is the same
as ACPI version.
In ACPI 5.1, some major gaps are fixed for ARM, such as updates in
MADT table for GIC and SMP init, without those updates, we can not
get the MPIDR for SMP init, and GICv2/3 related init information, so
we can't boot arm64 ACPI properly with table versions predating 5.1.
If firmware provides ACPI tables with ACPI version less than 5.1,
OS has no way to retrieve the configuration data that is necessary
to init SMP boot protocol and the GIC properly, so disable ACPI if
we get an FADT table with version less that 5.1 when acpi_boot_table_init()
called.
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Tested-by: Yijing Wang <wangyijing@huawei.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Jon Masters <jcm@redhat.com>
Tested-by: Timur Tabi <timur@codeaurora.org>
Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Al Stone <al.stone@linaro.org>
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-03-24 22:02:37 +08:00
|
|
|
/*
|
|
|
|
* It's used from ACPI core in kdump to boot UP system with SMP kernel,
|
|
|
|
* with this check the ACPI core will not override the CPU index
|
|
|
|
* obtained from GICC with 0 and not print some error message as well.
|
|
|
|
* Since MADT must provide at least one GICC structure for GIC
|
|
|
|
* initialization, CPU will be always available in MADT on ARM64.
|
|
|
|
*/
|
|
|
|
static inline bool acpi_has_cpu_in_madt(void)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void arch_fix_phys_package_id(int num, u32 slot) { }
|
2015-03-24 22:02:45 +08:00
|
|
|
void __init acpi_init_cpus(void);
|
ARM64 / ACPI: Get RSDP and ACPI boot-time tables
As we want to get ACPI tables to parse and then use the information
for system initialization, we should get the RSDP (Root System
Description Pointer) first, it then locates Extended Root Description
Table (XSDT) which contains all the 64-bit physical address that
pointer to other boot-time tables.
Introduce acpi.c and its related head file in this patch to provide
fundamental needs of extern variables and functions for ACPI core,
and then get boot-time tables as needed.
- asm/acenv.h for arch specific ACPICA environments and
implementation, It is needed unconditionally by ACPI core;
- asm/acpi.h for arch specific variables and functions needed by
ACPI driver core;
- acpi.c for ARM64 related ACPI implementation for ACPI driver
core;
acpi_boot_table_init() is introduced to get RSDP and boot-time tables,
it will be called in setup_arch() before paging_init(), so we should
use eary_memremap() mechanism here to get the RSDP and all the table
pointers.
FADT Major.Minor version was introduced in ACPI 5.1, it is the same
as ACPI version.
In ACPI 5.1, some major gaps are fixed for ARM, such as updates in
MADT table for GIC and SMP init, without those updates, we can not
get the MPIDR for SMP init, and GICv2/3 related init information, so
we can't boot arm64 ACPI properly with table versions predating 5.1.
If firmware provides ACPI tables with ACPI version less than 5.1,
OS has no way to retrieve the configuration data that is necessary
to init SMP boot protocol and the GIC properly, so disable ACPI if
we get an FADT table with version less that 5.1 when acpi_boot_table_init()
called.
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Tested-by: Yijing Wang <wangyijing@huawei.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Jon Masters <jcm@redhat.com>
Tested-by: Timur Tabi <timur@codeaurora.org>
Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Al Stone <al.stone@linaro.org>
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-03-24 22:02:37 +08:00
|
|
|
|
2015-03-24 22:02:43 +08:00
|
|
|
#else
|
2015-03-24 22:02:45 +08:00
|
|
|
static inline void acpi_init_cpus(void) { }
|
ARM64 / ACPI: Get RSDP and ACPI boot-time tables
As we want to get ACPI tables to parse and then use the information
for system initialization, we should get the RSDP (Root System
Description Pointer) first, it then locates Extended Root Description
Table (XSDT) which contains all the 64-bit physical address that
pointer to other boot-time tables.
Introduce acpi.c and its related head file in this patch to provide
fundamental needs of extern variables and functions for ACPI core,
and then get boot-time tables as needed.
- asm/acenv.h for arch specific ACPICA environments and
implementation, It is needed unconditionally by ACPI core;
- asm/acpi.h for arch specific variables and functions needed by
ACPI driver core;
- acpi.c for ARM64 related ACPI implementation for ACPI driver
core;
acpi_boot_table_init() is introduced to get RSDP and boot-time tables,
it will be called in setup_arch() before paging_init(), so we should
use eary_memremap() mechanism here to get the RSDP and all the table
pointers.
FADT Major.Minor version was introduced in ACPI 5.1, it is the same
as ACPI version.
In ACPI 5.1, some major gaps are fixed for ARM, such as updates in
MADT table for GIC and SMP init, without those updates, we can not
get the MPIDR for SMP init, and GICv2/3 related init information, so
we can't boot arm64 ACPI properly with table versions predating 5.1.
If firmware provides ACPI tables with ACPI version less than 5.1,
OS has no way to retrieve the configuration data that is necessary
to init SMP boot protocol and the GIC properly, so disable ACPI if
we get an FADT table with version less that 5.1 when acpi_boot_table_init()
called.
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Tested-by: Yijing Wang <wangyijing@huawei.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Jon Masters <jcm@redhat.com>
Tested-by: Timur Tabi <timur@codeaurora.org>
Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Al Stone <al.stone@linaro.org>
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-03-24 22:02:37 +08:00
|
|
|
#endif /* CONFIG_ACPI */
|
|
|
|
|
2016-01-26 19:10:38 +08:00
|
|
|
#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
|
|
|
|
bool acpi_parking_protocol_valid(int cpu);
|
|
|
|
void __init
|
|
|
|
acpi_set_mailbox_entry(int cpu, struct acpi_madt_generic_interrupt *processor);
|
|
|
|
#else
|
|
|
|
static inline bool acpi_parking_protocol_valid(int cpu) { return false; }
|
|
|
|
static inline void
|
|
|
|
acpi_set_mailbox_entry(int cpu, struct acpi_madt_generic_interrupt *processor)
|
|
|
|
{}
|
|
|
|
#endif
|
|
|
|
|
2015-05-13 21:12:47 +08:00
|
|
|
static inline const char *acpi_get_enable_method(int cpu)
|
|
|
|
{
|
2016-01-26 19:10:38 +08:00
|
|
|
if (acpi_psci_present())
|
|
|
|
return "psci";
|
|
|
|
|
|
|
|
if (acpi_parking_protocol_valid(cpu))
|
|
|
|
return "parking-protocol";
|
|
|
|
|
|
|
|
return NULL;
|
2015-05-13 21:12:47 +08:00
|
|
|
}
|
2015-09-04 21:11:41 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_ACPI_APEI
|
2016-12-01 21:51:12 +08:00
|
|
|
/*
|
|
|
|
* acpi_disable_cmcff is used in drivers/acpi/apei/hest.c for disabling
|
|
|
|
* IA-32 Architecture Corrected Machine Check (CMC) Firmware-First mode
|
|
|
|
* with a kernel command line parameter "acpi=nocmcoff". But we don't
|
|
|
|
* have this IA-32 specific feature on ARM64, this definition is only
|
|
|
|
* for compatibility.
|
|
|
|
*/
|
|
|
|
#define acpi_disable_cmcff 1
|
2015-09-04 21:11:41 +08:00
|
|
|
pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr);
|
2016-12-01 21:51:12 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Despite its name, this function must still broadcast the TLB
|
|
|
|
* invalidation in order to ensure other CPUs don't end up with junk
|
|
|
|
* entries as a result of speculation. Unusually, its also called in
|
|
|
|
* IRQ context (ghes_iounmap_irq) so if we ever need to use IPIs for
|
|
|
|
* TLB broadcasting, then we're in trouble here.
|
|
|
|
*/
|
|
|
|
static inline void arch_apei_flush_tlb_one(unsigned long addr)
|
|
|
|
{
|
|
|
|
flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_ACPI_APEI */
|
2015-09-04 21:11:41 +08:00
|
|
|
|
2016-05-25 06:35:44 +08:00
|
|
|
#ifdef CONFIG_ACPI_NUMA
|
|
|
|
int arm64_acpi_numa_init(void);
|
|
|
|
int acpi_numa_get_nid(unsigned int cpu, u64 hwid);
|
|
|
|
#else
|
|
|
|
static inline int arm64_acpi_numa_init(void) { return -ENOSYS; }
|
|
|
|
static inline int acpi_numa_get_nid(unsigned int cpu, u64 hwid) { return NUMA_NO_NODE; }
|
|
|
|
#endif /* CONFIG_ACPI_NUMA */
|
|
|
|
|
2016-06-20 18:56:13 +08:00
|
|
|
#define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE
|
|
|
|
|
ARM64 / ACPI: Get RSDP and ACPI boot-time tables
As we want to get ACPI tables to parse and then use the information
for system initialization, we should get the RSDP (Root System
Description Pointer) first, it then locates Extended Root Description
Table (XSDT) which contains all the 64-bit physical address that
pointer to other boot-time tables.
Introduce acpi.c and its related head file in this patch to provide
fundamental needs of extern variables and functions for ACPI core,
and then get boot-time tables as needed.
- asm/acenv.h for arch specific ACPICA environments and
implementation, It is needed unconditionally by ACPI core;
- asm/acpi.h for arch specific variables and functions needed by
ACPI driver core;
- acpi.c for ARM64 related ACPI implementation for ACPI driver
core;
acpi_boot_table_init() is introduced to get RSDP and boot-time tables,
it will be called in setup_arch() before paging_init(), so we should
use eary_memremap() mechanism here to get the RSDP and all the table
pointers.
FADT Major.Minor version was introduced in ACPI 5.1, it is the same
as ACPI version.
In ACPI 5.1, some major gaps are fixed for ARM, such as updates in
MADT table for GIC and SMP init, without those updates, we can not
get the MPIDR for SMP init, and GICv2/3 related init information, so
we can't boot arm64 ACPI properly with table versions predating 5.1.
If firmware provides ACPI tables with ACPI version less than 5.1,
OS has no way to retrieve the configuration data that is necessary
to init SMP boot protocol and the GIC properly, so disable ACPI if
we get an FADT table with version less that 5.1 when acpi_boot_table_init()
called.
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Tested-by: Yijing Wang <wangyijing@huawei.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Jon Masters <jcm@redhat.com>
Tested-by: Timur Tabi <timur@codeaurora.org>
Tested-by: Robert Richter <rrichter@cavium.com>
Acked-by: Robert Richter <rrichter@cavium.com>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Al Stone <al.stone@linaro.org>
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-03-24 22:02:37 +08:00
|
|
|
#endif /*_ASM_ACPI_H*/
|