From: Al Stone <ahs3(a)redhat.com>
This series of patches starts with Hanjun's patch to create a kernel
config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I
then reviewed all of the code that touched any of several fields in the
FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced
mode [1]. Any time there was a use of one of the fields to be ignored,
I evaluated whether or not the code was implementing Hardware Reduced
mode correctly. Similarly, for each the flags in the FADT flags field
that are to be ignored in Hardware Reduced mode, the kernel code was again
scanned for proper usage. The remainder of the patches are to fix all of
the situations I could find where the kernel would not behave correctly
in this ACPI mode.
These are being submitted as an RFC to the linaro-acpi@ list so I can get
some other eyes looking at them before sending them to linux-acpi@ where
they really need to go. These seem to work just fine on the RTSM model
for ARMv7, both with and without ACPI enabled, and with and without
ACPI_REDUCED_HARDWARE enabled. However, there's no way I can think of
or test all possible scenarios so feedback would be greatly appreciated.
NB: these changes are only applicable to the LEG ACPI working tree. The
macros in patch 1/13 will have to change for the linux-acpi tree.
Changes for v4:
-- Remove use of ACPI_HW_DEPENDENT_RETURN_{*} macros; they were not
usable without invasive change.
-- Completely remove global lock/unlock routines on ARM (vs #ifdef)
Changes for v3:
-- Consistent use of #if (!ACPI_REDUCED_HARDWARE)
-- Use of ACPI_HW_DEPENDENT_RETURN_{*} macros
-- Simplify wherever possible
Changes for v2:
-- Change patch series title
-- Add in the FACS global lock patch as further hardware reduced mode
cleanup that is needed
-- Remove whitespace change that should not have gotten in
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced
mode.
[0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5…
Al Stone (13):
ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode
ACPI: bus master reload not supported in reduced HW mode
ACPI: clean up compiler warning about uninitialized field
ACPI: HW reduced mode does not allow use of the FADT sci_interrupt
field
ACPI: ARM: exclude calls on ARM platforms, not include them on x86
ACPI: ensure several FADT fields are only used in HW reduced mode
ACPI: do not reserve memory regions for some FADT entries in HW
reduced mode
ACPI: in HW reduced mode, getting power latencies from FADT is not
allowed
ACPI: add clarifying comment about processor throttling in HW reduced
mode
ACPI: ACPI_FADT_C2_MP_SUPPORTED must be ignored in HW reduced mode
ACPI: use of ACPI_FADT_32BIT_TIMER is not allowed in HW reduced mode
ACPI: correct #ifdef so compilation without ACPI_REDUCED_HARDWARE
works
ACPI: ARM/ARM64: ensure the ACPI FACS global_lock is never used in HW
reduced mode
arch/arm/include/asm/acpi.h | 10 ----------
arch/arm64/include/asm/acpi.h | 10 ----------
drivers/acpi/Kconfig | 8 ++++++++
drivers/acpi/acpica/utxface.c | 3 ++-
drivers/acpi/bus.c | 7 ++++---
drivers/acpi/osl.c | 28 ++++++++++++++++++++--------
drivers/acpi/pci_link.c | 14 ++++++++------
drivers/acpi/plat/arm/boot.c | 2 ++
drivers/acpi/processor_idle.c | 19 ++++++++++++++-----
drivers/acpi/processor_throttling.c | 8 ++++++++
drivers/acpi/sleep.c | 2 +-
include/acpi/acconfig.h | 2 +-
include/acpi/acpixf.h | 3 +++
include/acpi/platform/aclinux.h | 6 ++++++
14 files changed, 77 insertions(+), 45 deletions(-)
--
1.8.3.1
I don't think there is any need for such a deep directory structure and
the filename boot.c was not very descriptive of what the file does.
Make directory structure less deep and remane to arm-core.c
Signed-off-by: Graeme Gregory <graeme.gregory(a)linaro.org>
---
drivers/acpi/Makefile | 3 +-
drivers/acpi/plat/Makefile | 2 +
drivers/acpi/plat/arm-core.c | 695 +++++++++++++++++++++++++++++++++++++++++
drivers/acpi/plat/arm/Makefile | 2 -
drivers/acpi/plat/arm/boot.c | 695 -----------------------------------------
5 files changed, 698 insertions(+), 699 deletions(-)
create mode 100644 drivers/acpi/plat/Makefile
create mode 100644 drivers/acpi/plat/arm-core.c
delete mode 100644 drivers/acpi/plat/arm/Makefile
delete mode 100644 drivers/acpi/plat/arm/boot.c
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index a792d00..262f0be 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -84,5 +84,4 @@ obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o
obj-$(CONFIG_ACPI_APEI) += apei/
-obj-$(CONFIG_ACPI_ARM) += plat/arm/
-
+obj-y += plat/
diff --git a/drivers/acpi/plat/Makefile b/drivers/acpi/plat/Makefile
new file mode 100644
index 0000000..b65bcba
--- /dev/null
+++ b/drivers/acpi/plat/Makefile
@@ -0,0 +1,2 @@
+obj-$(CONFIG_ACPI_ARM) += arm-core.o
+
diff --git a/drivers/acpi/plat/arm-core.c b/drivers/acpi/plat/arm-core.c
new file mode 100644
index 0000000..b77af0f
--- /dev/null
+++ b/drivers/acpi/plat/arm-core.c
@@ -0,0 +1,695 @@
+/*
+ * ARM/ARM64 Specific Low-Level ACPI Boot Support
+ *
+ * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh(a)intel.com>
+ * Copyright (C) 2001 Jun Nakajima <jun.nakajima(a)intel.com>
+ * Copyright (C) 2013, Al Stone <al.stone(a)linaro.org> (ARM version)
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+#include <linux/init.h>
+#include <linux/acpi.h>
+#include <linux/acpi_pmtmr.h>
+#include <linux/efi.h>
+#include <linux/cpumask.h>
+#include <linux/memblock.h>
+#include <linux/module.h>
+#include <linux/irq.h>
+#include <linux/irqdomain.h>
+#include <linux/slab.h>
+#include <linux/bootmem.h>
+#include <linux/ioport.h>
+#include <linux/pci.h>
+
+#include <asm/pgtable.h>
+#include <asm/io.h>
+#include <asm/smp.h>
+#include <asm/acpi.h>
+
+/*
+ * We never plan to use RSDT on arm/arm64 as its deprecated in spec but this
+ * variable is still required by the ACPI core
+ */
+u32 acpi_rsdt_forced;
+
+int acpi_disabled;
+EXPORT_SYMBOL(acpi_disabled);
+
+/* available_cpus here means enabled cpu in MADT */
+int available_cpus;
+
+/* Map logic cpu id to physical APIC id.
+ * APIC = GIC cpu interface on ARM
+ */
+volatile int arm_cpu_to_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = -1 };
+int boot_cpu_apic_id = -1;
+
+#define BAD_MADT_ENTRY(entry, end) ( \
+ (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
+ ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
+
+#define PREFIX "ACPI: "
+
+int acpi_noirq; /* skip ACPI IRQ initialization */
+int acpi_pci_disabled; /* skip ACPI PCI scan and IRQ initialization */
+EXPORT_SYMBOL(acpi_pci_disabled);
+
+int acpi_lapic;
+int acpi_ioapic;
+int acpi_strict;
+
+u8 acpi_sci_flags __initdata;
+int acpi_sci_override_gsi __initdata;
+int acpi_skip_timer_override __initdata;
+int acpi_use_timer_override __initdata;
+int acpi_fix_pin2_polarity __initdata;
+static u64 acpi_lapic_addr __initdata;
+
+struct acpi_arm_root acpi_arm_rsdp_info; /* info about RSDP from FDT */
+
+/*
+ * Boot-time Configuration
+ */
+
+/*
+ * The default interrupt routing model is PIC (8259). This gets
+ * overridden if IOAPICs are enumerated (below).
+ *
+ * Since we're on ARM, it clearly has to be GIC.
+ */
+enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_GIC;
+
+static unsigned int gsi_to_irq(unsigned int gsi)
+{
+ int irq = irq_create_mapping(NULL, gsi);
+
+ return irq;
+}
+
+char *__init __acpi_map_table(phys_addr_t phys, unsigned long size)
+{
+ if (!phys || !size)
+ return NULL;
+
+ return early_memremap(phys, size);
+}
+
+void __init __acpi_unmap_table(char *map, unsigned long size)
+{
+ if (!map || !size)
+ return;
+
+ early_iounmap(map, size);
+ return;
+}
+
+static int __init acpi_parse_madt(struct acpi_table_header *table)
+{
+ struct acpi_table_madt *madt = NULL;
+
+ madt = (struct acpi_table_madt *)table;
+ if (!madt) {
+ pr_warn(PREFIX "Unable to map MADT\n");
+ return -ENODEV;
+ }
+
+ if (madt->address) {
+ acpi_lapic_addr = (u64) madt->address;
+
+ pr_info(PREFIX "Local APIC address 0x%08x\n", madt->address);
+ }
+
+ return 0;
+}
+
+/* Local APIC = GIC cpu interface on ARM */
+static void acpi_register_lapic(int id, u8 enabled)
+{
+ int cpu;
+
+ if (id >= MAX_LOCAL_APIC) {
+ pr_info(PREFIX "skipped apicid that is too big\n");
+ return;
+ }
+
+ total_cpus++;
+ if (!enabled)
+ return;
+
+ available_cpus++;
+
+ /* allocate a logic cpu id for the new comer */
+ if (boot_cpu_apic_id == id) {
+ /*
+ * boot_cpu_init() already hold bit 0 in cpu_present_mask
+ * for BSP, no need to allocte again.
+ */
+ cpu = 0;
+ } else {
+ cpu = cpumask_next_zero(-1, cpu_present_mask);
+ }
+
+ /* map the logic cpu id to APIC id */
+ arm_cpu_to_apicid[cpu] = id;
+
+ set_cpu_present(cpu, true);
+ set_cpu_possible(cpu, true);
+}
+
+static int __init
+acpi_parse_gic(struct acpi_subtable_header *header, const unsigned long end)
+{
+ struct acpi_madt_generic_interrupt *processor = NULL;
+
+ processor = (struct acpi_madt_generic_interrupt *)header;
+
+ if (BAD_MADT_ENTRY(processor, end))
+ return -EINVAL;
+
+ acpi_table_print_madt_entry(header);
+
+ /*
+ * We need to register disabled CPU as well to permit
+ * counting disabled CPUs. This allows us to size
+ * cpus_possible_map more accurately, to permit
+ * to not preallocating memory for all NR_CPUS
+ * when we use CPU hotplug.
+ */
+ acpi_register_lapic(processor->gic_id,
+ processor->flags & ACPI_MADT_ENABLED);
+
+ return 0;
+}
+
+static int __init
+acpi_parse_gic_distributor(struct acpi_subtable_header *header,
+ const unsigned long end)
+{
+ struct acpi_madt_generic_distributor *distributor = NULL;
+
+ distributor = (struct acpi_madt_generic_distributor *)header;
+
+ if (BAD_MADT_ENTRY(distributor, end))
+ return -EINVAL;
+
+ acpi_table_print_madt_entry(header);
+
+ /* TODO: handle with the base_address and irq_base for irq system */
+
+ return 0;
+}
+
+int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
+{
+ *irq = gsi_to_irq(gsi);
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
+
+static int acpi_register_gsi_pic(struct device *dev, u32 gsi,
+ int trigger, int polarity)
+{
+#ifdef CONFIG_PCI
+ /*
+ * Make sure all (legacy) PCI IRQs are set as level-triggered.
+ */
+ if (trigger == ACPI_LEVEL_SENSITIVE)
+ eisa_set_level_irq(gsi);
+#endif
+
+ return gsi;
+}
+
+static int acpi_register_gsi_ioapic(struct device *dev, u32 gsi,
+ int trigger, int polarity)
+{
+ return gsi;
+}
+
+int (*__acpi_register_gsi)(struct device *dev, u32 gsi,
+ int trigger, int polarity) = acpi_register_gsi_pic;
+
+/*
+ * success: return IRQ number (>=0)
+ * failure: return < 0
+ */
+int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
+{
+ unsigned int irq;
+ unsigned int plat_gsi = gsi;
+
+ plat_gsi = (*__acpi_register_gsi)(dev, gsi, trigger, polarity);
+
+ irq = gsi_to_irq(plat_gsi);
+
+ return irq;
+}
+EXPORT_SYMBOL_GPL(acpi_register_gsi);
+
+void acpi_unregister_gsi(u32 gsi)
+{
+}
+EXPORT_SYMBOL_GPL(acpi_unregister_gsi);
+
+void __init acpi_set_irq_model_pic(void)
+{
+ acpi_irq_model = ACPI_IRQ_MODEL_PIC;
+ __acpi_register_gsi = acpi_register_gsi_pic;
+ acpi_ioapic = 0;
+}
+
+void __init acpi_set_irq_model_gic(void)
+{
+ acpi_irq_model = ACPI_IRQ_MODEL_GIC;
+ __acpi_register_gsi = acpi_register_gsi_ioapic;
+ acpi_ioapic = 1;
+}
+
+static int __initdata setup_possible_cpus = -1;
+static int __init _setup_possible_cpus(char *str)
+{
+ get_option(&str, &setup_possible_cpus);
+ return 0;
+}
+early_param("possible_cpus", _setup_possible_cpus);
+
+/*
+ * cpu_possible_mask should be static, it cannot change as cpu's
+ * are onlined, or offlined. The reason is per-cpu data-structures
+ * are allocated by some modules at init time, and dont expect to
+ * do this dynamically on cpu arrival/departure.
+ * cpu_present_mask on the other hand can change dynamically.
+ * In case when cpu_hotplug is not compiled, then we resort to current
+ * behaviour, which is cpu_possible == cpu_present.
+ * - Ashok Raj
+ *
+ * Three ways to find out the number of additional hotplug CPUs:
+ * - If the BIOS specified disabled CPUs in ACPI/mptables use that.
+ * - The user can overwrite it with possible_cpus=NUM
+ * - Otherwise don't reserve additional CPUs.
+ * We do this because additional CPUs waste a lot of memory.
+ * -AK
+ */
+void __init prefill_possible_map(void)
+{
+ int i;
+ int possible, disabled_cpus;
+
+ disabled_cpus = total_cpus - available_cpus;
+
+ if (setup_possible_cpus == -1) {
+ if (disabled_cpus > 0)
+ setup_possible_cpus = disabled_cpus;
+ else
+ setup_possible_cpus = 0;
+ }
+
+ possible = available_cpus + setup_possible_cpus;
+
+ pr_info("SMP: the system is limited to %d CPUs\n", nr_cpu_ids);
+
+ /*
+ * On armv8 foundation model --cores=4 lets nr_cpu_ids=4, so we can't
+ * get possible map correctly when more than 4 APIC entries in MADT.
+ */
+ if (possible > nr_cpu_ids)
+ possible = nr_cpu_ids;
+
+ pr_info("SMP: Allowing %d CPUs, %d hotplug CPUs\n",
+ possible, max((possible - available_cpus), 0));
+
+ for (i = 0; i < possible; i++)
+ set_cpu_possible(i, true);
+ for (; i < NR_CPUS; i++)
+ set_cpu_possible(i, false);
+}
+
+/*
+ * ACPI based hotplug support for CPU
+ */
+#ifdef CONFIG_ACPI_HOTPLUG_CPU
+#include <acpi/processor.h>
+
+static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
+{
+#ifdef CONFIG_ACPI_NUMA
+ int nid;
+
+ nid = acpi_get_node(handle);
+ if (nid == -1 || !node_online(nid))
+ return;
+ set_apicid_to_node(physid, nid);
+ numa_set_node(cpu, nid);
+#endif
+}
+
+static int _acpi_map_lsapic(acpi_handle handle, int *pcpu)
+{
+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+ union acpi_object *obj;
+ struct acpi_madt_generic_interrupt *lapic;
+ cpumask_var_t tmp_map, new_map;
+ u8 physid;
+ int cpu;
+ int retval = -ENOMEM;
+
+ if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer)))
+ return -EINVAL;
+
+ if (!buffer.length || !buffer.pointer)
+ return -EINVAL;
+
+ obj = buffer.pointer;
+ if (obj->type != ACPI_TYPE_BUFFER ||
+ obj->buffer.length < sizeof(*lapic)) {
+ kfree(buffer.pointer);
+ return -EINVAL;
+ }
+
+ lapic = (struct acpi_madt_generic_interrupt *)obj->buffer.pointer;
+
+ if (lapic->header.type != ACPI_MADT_TYPE_GENERIC_INTERRUPT ||
+ !(lapic->flags & ACPI_MADT_ENABLED)) {
+ kfree(buffer.pointer);
+ return -EINVAL;
+ }
+
+ physid = lapic->gic_id;
+
+ kfree(buffer.pointer);
+ buffer.length = ACPI_ALLOCATE_BUFFER;
+ buffer.pointer = NULL;
+ lapic = NULL;
+
+ if (!alloc_cpumask_var(&tmp_map, GFP_KERNEL))
+ goto out;
+
+ if (!alloc_cpumask_var(&new_map, GFP_KERNEL))
+ goto free_tmp_map;
+
+ cpumask_copy(tmp_map, cpu_present_mask);
+ acpi_register_lapic(physid, ACPI_MADT_ENABLED);
+
+ /*
+ * If acpi_register_lapic successfully generates a new logical cpu
+ * number, then the following will get us exactly what was mapped
+ */
+ cpumask_andnot(new_map, cpu_present_mask, tmp_map);
+ if (cpumask_empty(new_map)) {
+ pr_err("Unable to map lapic to logical cpu number\n");
+ retval = -EINVAL;
+ goto free_new_map;
+ }
+
+ acpi_processor_set_pdc(handle);
+
+ cpu = cpumask_first(new_map);
+ acpi_map_cpu2node(handle, cpu, physid);
+
+ *pcpu = cpu;
+ retval = 0;
+
+free_new_map:
+ free_cpumask_var(new_map);
+free_tmp_map:
+ free_cpumask_var(tmp_map);
+out:
+ return retval;
+}
+
+/* wrapper to silence section mismatch warning */
+int __ref acpi_map_lsapic(acpi_handle handle, int *pcpu)
+{
+ return _acpi_map_lsapic(handle, pcpu);
+}
+EXPORT_SYMBOL(acpi_map_lsapic);
+
+int acpi_unmap_lsapic(int cpu)
+{
+ arm_cpu_to_apicid[cpu] = -1;
+ set_cpu_present(cpu, false);
+ available_cpus--;
+
+ return 0;
+}
+EXPORT_SYMBOL(acpi_unmap_lsapic);
+#endif /* CONFIG_ACPI_HOTPLUG_CPU */
+
+/* Local APIC = GIC cpu interface on ARM */
+static int __init acpi_parse_madt_lapic_entries(void)
+{
+ int count;
+
+ /*
+ * do a partial walk of MADT to determine how many CPUs
+ * we have including disabled CPUs
+ */
+ count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT,
+ acpi_parse_gic, MAX_LOCAL_APIC);
+
+ if (!count) {
+ pr_err(PREFIX "No LAPIC entries present\n");
+ /* TBD: Cleanup to allow fallback to MPS */
+ return -ENODEV;
+ } else if (count < 0) {
+ pr_err(PREFIX "Error parsing LAPIC entry\n");
+ /* TBD: Cleanup to allow fallback to MPS */
+ return count;
+ }
+
+#ifdef CONFIG_SMP
+ if (available_cpus == 0) {
+ pr_info(PREFIX "Found 0 CPUS; assuming 1\n");
+ /* FIXME: should be the real GIC id read from hardware */
+ arm_cpu_to_apicid[available_cpus] = 0;
+ available_cpus = 1; /* We've got at least one of these */
+ }
+#endif
+ /* Make boot-up look pretty */
+ pr_info("%d CPUs available, %d CPUs total\n", available_cpus,
+ total_cpus);
+
+ return 0;
+}
+
+static int __init acpi_parse_fadt(struct acpi_table_header *table)
+{
+ return 0;
+}
+
+/*
+ * Parse IOAPIC related entries in MADT
+ * returns 0 on success, < 0 on error
+ * IOAPIC = GIC distributor on ARM
+ */
+static int __init acpi_parse_madt_ioapic_entries(void)
+{
+ int count;
+
+ /*
+ * ACPI interpreter is required to complete interrupt setup,
+ * so if it is off, don't enumerate the io-apics with ACPI.
+ * If MPS is present, it will handle them,
+ * otherwise the system will stay in PIC mode
+ */
+ if (acpi_disabled || acpi_noirq)
+ return -ENODEV;
+
+ count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR,
+ acpi_parse_gic_distributor, MAX_IO_APICS);
+
+ if (!count) {
+ pr_err(PREFIX "No IOAPIC entries present\n");
+ return -ENODEV;
+ } else if (count < 0) {
+ pr_err(PREFIX "Error parsing IOAPIC entry\n");
+ return count;
+ }
+
+ return 0;
+}
+
+static void __init early_acpi_process_madt(void)
+{
+ /* should I introduce CONFIG_ARM_LOCAL_APIC like x86 does? */
+ acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt);
+}
+
+static void __init acpi_process_madt(void)
+{
+ /* should I introduce CONFIG_ARM_LOCAL_APIC like x86 does? */
+ int error;
+
+ if (!acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) {
+
+ /*
+ * Parse MADT LAPIC entries
+ */
+ error = acpi_parse_madt_lapic_entries();
+ if (!error) {
+ acpi_lapic = 1;
+
+ /*
+ * Parse MADT IO-APIC entries
+ */
+ error = acpi_parse_madt_ioapic_entries();
+ if (!error)
+ acpi_set_irq_model_gic();
+ }
+ }
+
+ /*
+ * ACPI supports both logical (e.g. Hyper-Threading) and physical
+ * processors, where MPS only supports physical.
+ */
+ if (acpi_lapic && acpi_ioapic)
+ pr_info("Using ACPI (MADT) for SMP configuration "
+ "information\n");
+ else if (acpi_lapic)
+ pr_info("Using ACPI for processor (LAPIC) "
+ "configuration information\n");
+
+ return;
+}
+
+/*
+ * ========== OLD COMMENTS FROM x86 =================================
+ * acpi_boot_table_init() and acpi_boot_init()
+ * called from setup_arch(), always.
+ * 1. checksums all tables
+ * 2. enumerates lapics
+ * 3. enumerates io-apics
+ *
+ * acpi_table_init() is separate to allow reading SRAT without
+ * other side effects.
+ *
+ * side effects of acpi_boot_init:
+ * acpi_lapic = 1 if LAPIC found
+ * acpi_ioapic = 1 if IOAPIC found
+ * if (acpi_lapic && acpi_ioapic) smp_found_config = 1;
+ * if acpi_blacklisted() acpi_disabled = 1;
+ * acpi_irq_model=...
+ * ...
+ * ==================================================================
+ *
+ * We have to approach this a little different on ARMv7. We are
+ * passed in an ACPI blob and we really have no idea where in RAM
+ * it will be located. So, what should have been the physical
+ * addresses of other tables cannot really be hardcoded into the
+ * tables. What we will do is put an offset in the blob that is
+ * the offset from the beginning of the RSDP structure. However,
+ * what that means is that we have to unpack the blob and do a
+ * bit of fixup work on the offsets to turn them into kernel
+ * virtual addresses so we can pass them on for later use.
+ */
+void __init acpi_boot_table_init(void)
+{
+ /*
+ * If acpi_disabled, bail out
+ */
+ if (acpi_disabled)
+ return;
+
+ /*
+ * Initialize the ACPI boot-time table parser.
+ */
+ if (acpi_table_init()) {
+ disable_acpi();
+ return;
+ }
+}
+
+int __init early_acpi_boot_init(void)
+{
+ /*
+ * If acpi_disabled, bail out
+ */
+ if (acpi_disabled)
+ return 1;
+
+ /*
+ * Process the Multiple APIC Description Table (MADT), if present
+ */
+ early_acpi_process_madt();
+
+ return 0;
+}
+
+int __init acpi_boot_init(void)
+{
+ /*
+ * If acpi_disabled, bail out
+ */
+ if (acpi_disabled)
+ return 1;
+
+ /*
+ * set sci_int and PM timer address
+ */
+ acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt);
+
+ /*
+ * Process the Multiple APIC Description Table (MADT), if present
+ */
+ acpi_process_madt();
+
+ return 0;
+}
+
+/*
+ * make sure that the address passed for ACPI tables which is normall in
+ * system ram is removed from the kernel memory map
+ */
+void __init arm_acpi_reserve_memory()
+{
+ unsigned long section_offset;
+ unsigned long num_sections;
+ phys_addr_t addr = acpi_arm_rsdp_info.phys_address;
+ int size = acpi_arm_rsdp_info.size;
+
+ /* if ACPI tables were not passed in FDT then escape here */
+ if (!addr || !size)
+ return;
+
+ section_offset = addr - (addr & SECTION_MASK);
+ num_sections = size / SECTION_SIZE;
+ if (size % SECTION_SIZE)
+ num_sections++;
+
+ memblock_remove(addr - section_offset, num_sections * SECTION_SIZE);
+}
+
+static int __init parse_acpi(char *arg)
+{
+ if (!arg)
+ return -EINVAL;
+
+ /* "acpi=off" disables both ACPI table parsing and interpreter */
+ if (strcmp(arg, "off") == 0) {
+ disable_acpi();
+ }
+ /* acpi=strict disables out-of-spec workarounds */
+ else if (strcmp(arg, "strict") == 0) {
+ acpi_strict = 1;
+ }
+ return 0;
+}
+early_param("acpi", parse_acpi);
diff --git a/drivers/acpi/plat/arm/Makefile b/drivers/acpi/plat/arm/Makefile
deleted file mode 100644
index 9d59aaf..0000000
--- a/drivers/acpi/plat/arm/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-obj-y += boot.o
-
diff --git a/drivers/acpi/plat/arm/boot.c b/drivers/acpi/plat/arm/boot.c
deleted file mode 100644
index a912a7a..0000000
--- a/drivers/acpi/plat/arm/boot.c
+++ /dev/null
@@ -1,695 +0,0 @@
-/*
- * boot.c - Architecture-Specific Low-Level ACPI Boot Support
- *
- * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh(a)intel.com>
- * Copyright (C) 2001 Jun Nakajima <jun.nakajima(a)intel.com>
- * Copyright (C) 2013, Al Stone <al.stone(a)linaro.org> (ARM version)
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-#include <linux/init.h>
-#include <linux/acpi.h>
-#include <linux/acpi_pmtmr.h>
-#include <linux/efi.h>
-#include <linux/cpumask.h>
-#include <linux/memblock.h>
-#include <linux/module.h>
-#include <linux/irq.h>
-#include <linux/irqdomain.h>
-#include <linux/slab.h>
-#include <linux/bootmem.h>
-#include <linux/ioport.h>
-#include <linux/pci.h>
-
-#include <asm/pgtable.h>
-#include <asm/io.h>
-#include <asm/smp.h>
-#include <asm/acpi.h>
-
-/*
- * We never plan to use RSDT on arm/arm64 as its deprecated in spec but this
- * variable is still required by the ACPI core
- */
-u32 acpi_rsdt_forced;
-
-int acpi_disabled;
-EXPORT_SYMBOL(acpi_disabled);
-
-/* available_cpus here means enabled cpu in MADT */
-int available_cpus;
-
-/* Map logic cpu id to physical APIC id.
- * APIC = GIC cpu interface on ARM
- */
-volatile int arm_cpu_to_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = -1 };
-int boot_cpu_apic_id = -1;
-
-#define BAD_MADT_ENTRY(entry, end) ( \
- (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
- ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
-
-#define PREFIX "ACPI: "
-
-int acpi_noirq; /* skip ACPI IRQ initialization */
-int acpi_pci_disabled; /* skip ACPI PCI scan and IRQ initialization */
-EXPORT_SYMBOL(acpi_pci_disabled);
-
-int acpi_lapic;
-int acpi_ioapic;
-int acpi_strict;
-
-u8 acpi_sci_flags __initdata;
-int acpi_sci_override_gsi __initdata;
-int acpi_skip_timer_override __initdata;
-int acpi_use_timer_override __initdata;
-int acpi_fix_pin2_polarity __initdata;
-static u64 acpi_lapic_addr __initdata;
-
-struct acpi_arm_root acpi_arm_rsdp_info; /* info about RSDP from FDT */
-
-/*
- * Boot-time Configuration
- */
-
-/*
- * The default interrupt routing model is PIC (8259). This gets
- * overridden if IOAPICs are enumerated (below).
- *
- * Since we're on ARM, it clearly has to be GIC.
- */
-enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_GIC;
-
-static unsigned int gsi_to_irq(unsigned int gsi)
-{
- int irq = irq_create_mapping(NULL, gsi);
-
- return irq;
-}
-
-char *__init __acpi_map_table(phys_addr_t phys, unsigned long size)
-{
- if (!phys || !size)
- return NULL;
-
- return early_memremap(phys, size);
-}
-
-void __init __acpi_unmap_table(char *map, unsigned long size)
-{
- if (!map || !size)
- return;
-
- early_iounmap(map, size);
- return;
-}
-
-static int __init acpi_parse_madt(struct acpi_table_header *table)
-{
- struct acpi_table_madt *madt = NULL;
-
- madt = (struct acpi_table_madt *)table;
- if (!madt) {
- pr_warn(PREFIX "Unable to map MADT\n");
- return -ENODEV;
- }
-
- if (madt->address) {
- acpi_lapic_addr = (u64) madt->address;
-
- pr_info(PREFIX "Local APIC address 0x%08x\n", madt->address);
- }
-
- return 0;
-}
-
-/* Local APIC = GIC cpu interface on ARM */
-static void acpi_register_lapic(int id, u8 enabled)
-{
- int cpu;
-
- if (id >= MAX_LOCAL_APIC) {
- pr_info(PREFIX "skipped apicid that is too big\n");
- return;
- }
-
- total_cpus++;
- if (!enabled)
- return;
-
- available_cpus++;
-
- /* allocate a logic cpu id for the new comer */
- if (boot_cpu_apic_id == id) {
- /*
- * boot_cpu_init() already hold bit 0 in cpu_present_mask
- * for BSP, no need to allocte again.
- */
- cpu = 0;
- } else {
- cpu = cpumask_next_zero(-1, cpu_present_mask);
- }
-
- /* map the logic cpu id to APIC id */
- arm_cpu_to_apicid[cpu] = id;
-
- set_cpu_present(cpu, true);
- set_cpu_possible(cpu, true);
-}
-
-static int __init
-acpi_parse_gic(struct acpi_subtable_header *header, const unsigned long end)
-{
- struct acpi_madt_generic_interrupt *processor = NULL;
-
- processor = (struct acpi_madt_generic_interrupt *)header;
-
- if (BAD_MADT_ENTRY(processor, end))
- return -EINVAL;
-
- acpi_table_print_madt_entry(header);
-
- /*
- * We need to register disabled CPU as well to permit
- * counting disabled CPUs. This allows us to size
- * cpus_possible_map more accurately, to permit
- * to not preallocating memory for all NR_CPUS
- * when we use CPU hotplug.
- */
- acpi_register_lapic(processor->gic_id,
- processor->flags & ACPI_MADT_ENABLED);
-
- return 0;
-}
-
-static int __init
-acpi_parse_gic_distributor(struct acpi_subtable_header *header,
- const unsigned long end)
-{
- struct acpi_madt_generic_distributor *distributor = NULL;
-
- distributor = (struct acpi_madt_generic_distributor *)header;
-
- if (BAD_MADT_ENTRY(distributor, end))
- return -EINVAL;
-
- acpi_table_print_madt_entry(header);
-
- /* TODO: handle with the base_address and irq_base for irq system */
-
- return 0;
-}
-
-int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
-{
- *irq = gsi_to_irq(gsi);
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
-
-static int acpi_register_gsi_pic(struct device *dev, u32 gsi,
- int trigger, int polarity)
-{
-#ifdef CONFIG_PCI
- /*
- * Make sure all (legacy) PCI IRQs are set as level-triggered.
- */
- if (trigger == ACPI_LEVEL_SENSITIVE)
- eisa_set_level_irq(gsi);
-#endif
-
- return gsi;
-}
-
-static int acpi_register_gsi_ioapic(struct device *dev, u32 gsi,
- int trigger, int polarity)
-{
- return gsi;
-}
-
-int (*__acpi_register_gsi)(struct device *dev, u32 gsi,
- int trigger, int polarity) = acpi_register_gsi_pic;
-
-/*
- * success: return IRQ number (>=0)
- * failure: return < 0
- */
-int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
-{
- unsigned int irq;
- unsigned int plat_gsi = gsi;
-
- plat_gsi = (*__acpi_register_gsi)(dev, gsi, trigger, polarity);
-
- irq = gsi_to_irq(plat_gsi);
-
- return irq;
-}
-EXPORT_SYMBOL_GPL(acpi_register_gsi);
-
-void acpi_unregister_gsi(u32 gsi)
-{
-}
-EXPORT_SYMBOL_GPL(acpi_unregister_gsi);
-
-void __init acpi_set_irq_model_pic(void)
-{
- acpi_irq_model = ACPI_IRQ_MODEL_PIC;
- __acpi_register_gsi = acpi_register_gsi_pic;
- acpi_ioapic = 0;
-}
-
-void __init acpi_set_irq_model_gic(void)
-{
- acpi_irq_model = ACPI_IRQ_MODEL_GIC;
- __acpi_register_gsi = acpi_register_gsi_ioapic;
- acpi_ioapic = 1;
-}
-
-static int __initdata setup_possible_cpus = -1;
-static int __init _setup_possible_cpus(char *str)
-{
- get_option(&str, &setup_possible_cpus);
- return 0;
-}
-early_param("possible_cpus", _setup_possible_cpus);
-
-/*
- * cpu_possible_mask should be static, it cannot change as cpu's
- * are onlined, or offlined. The reason is per-cpu data-structures
- * are allocated by some modules at init time, and dont expect to
- * do this dynamically on cpu arrival/departure.
- * cpu_present_mask on the other hand can change dynamically.
- * In case when cpu_hotplug is not compiled, then we resort to current
- * behaviour, which is cpu_possible == cpu_present.
- * - Ashok Raj
- *
- * Three ways to find out the number of additional hotplug CPUs:
- * - If the BIOS specified disabled CPUs in ACPI/mptables use that.
- * - The user can overwrite it with possible_cpus=NUM
- * - Otherwise don't reserve additional CPUs.
- * We do this because additional CPUs waste a lot of memory.
- * -AK
- */
-void __init prefill_possible_map(void)
-{
- int i;
- int possible, disabled_cpus;
-
- disabled_cpus = total_cpus - available_cpus;
-
- if (setup_possible_cpus == -1) {
- if (disabled_cpus > 0)
- setup_possible_cpus = disabled_cpus;
- else
- setup_possible_cpus = 0;
- }
-
- possible = available_cpus + setup_possible_cpus;
-
- pr_info("SMP: the system is limited to %d CPUs\n", nr_cpu_ids);
-
- /*
- * On armv8 foundation model --cores=4 lets nr_cpu_ids=4, so we can't
- * get possible map correctly when more than 4 APIC entries in MADT.
- */
- if (possible > nr_cpu_ids)
- possible = nr_cpu_ids;
-
- pr_info("SMP: Allowing %d CPUs, %d hotplug CPUs\n",
- possible, max((possible - available_cpus), 0));
-
- for (i = 0; i < possible; i++)
- set_cpu_possible(i, true);
- for (; i < NR_CPUS; i++)
- set_cpu_possible(i, false);
-}
-
-/*
- * ACPI based hotplug support for CPU
- */
-#ifdef CONFIG_ACPI_HOTPLUG_CPU
-#include <acpi/processor.h>
-
-static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
-{
-#ifdef CONFIG_ACPI_NUMA
- int nid;
-
- nid = acpi_get_node(handle);
- if (nid == -1 || !node_online(nid))
- return;
- set_apicid_to_node(physid, nid);
- numa_set_node(cpu, nid);
-#endif
-}
-
-static int _acpi_map_lsapic(acpi_handle handle, int *pcpu)
-{
- struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
- union acpi_object *obj;
- struct acpi_madt_generic_interrupt *lapic;
- cpumask_var_t tmp_map, new_map;
- u8 physid;
- int cpu;
- int retval = -ENOMEM;
-
- if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer)))
- return -EINVAL;
-
- if (!buffer.length || !buffer.pointer)
- return -EINVAL;
-
- obj = buffer.pointer;
- if (obj->type != ACPI_TYPE_BUFFER ||
- obj->buffer.length < sizeof(*lapic)) {
- kfree(buffer.pointer);
- return -EINVAL;
- }
-
- lapic = (struct acpi_madt_generic_interrupt *)obj->buffer.pointer;
-
- if (lapic->header.type != ACPI_MADT_TYPE_GENERIC_INTERRUPT ||
- !(lapic->flags & ACPI_MADT_ENABLED)) {
- kfree(buffer.pointer);
- return -EINVAL;
- }
-
- physid = lapic->gic_id;
-
- kfree(buffer.pointer);
- buffer.length = ACPI_ALLOCATE_BUFFER;
- buffer.pointer = NULL;
- lapic = NULL;
-
- if (!alloc_cpumask_var(&tmp_map, GFP_KERNEL))
- goto out;
-
- if (!alloc_cpumask_var(&new_map, GFP_KERNEL))
- goto free_tmp_map;
-
- cpumask_copy(tmp_map, cpu_present_mask);
- acpi_register_lapic(physid, ACPI_MADT_ENABLED);
-
- /*
- * If acpi_register_lapic successfully generates a new logical cpu
- * number, then the following will get us exactly what was mapped
- */
- cpumask_andnot(new_map, cpu_present_mask, tmp_map);
- if (cpumask_empty(new_map)) {
- pr_err("Unable to map lapic to logical cpu number\n");
- retval = -EINVAL;
- goto free_new_map;
- }
-
- acpi_processor_set_pdc(handle);
-
- cpu = cpumask_first(new_map);
- acpi_map_cpu2node(handle, cpu, physid);
-
- *pcpu = cpu;
- retval = 0;
-
-free_new_map:
- free_cpumask_var(new_map);
-free_tmp_map:
- free_cpumask_var(tmp_map);
-out:
- return retval;
-}
-
-/* wrapper to silence section mismatch warning */
-int __ref acpi_map_lsapic(acpi_handle handle, int *pcpu)
-{
- return _acpi_map_lsapic(handle, pcpu);
-}
-EXPORT_SYMBOL(acpi_map_lsapic);
-
-int acpi_unmap_lsapic(int cpu)
-{
- arm_cpu_to_apicid[cpu] = -1;
- set_cpu_present(cpu, false);
- available_cpus--;
-
- return 0;
-}
-EXPORT_SYMBOL(acpi_unmap_lsapic);
-#endif /* CONFIG_ACPI_HOTPLUG_CPU */
-
-/* Local APIC = GIC cpu interface on ARM */
-static int __init acpi_parse_madt_lapic_entries(void)
-{
- int count;
-
- /*
- * do a partial walk of MADT to determine how many CPUs
- * we have including disabled CPUs
- */
- count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT,
- acpi_parse_gic, MAX_LOCAL_APIC);
-
- if (!count) {
- pr_err(PREFIX "No LAPIC entries present\n");
- /* TBD: Cleanup to allow fallback to MPS */
- return -ENODEV;
- } else if (count < 0) {
- pr_err(PREFIX "Error parsing LAPIC entry\n");
- /* TBD: Cleanup to allow fallback to MPS */
- return count;
- }
-
-#ifdef CONFIG_SMP
- if (available_cpus == 0) {
- pr_info(PREFIX "Found 0 CPUS; assuming 1\n");
- /* FIXME: should be the real GIC id read from hardware */
- arm_cpu_to_apicid[available_cpus] = 0;
- available_cpus = 1; /* We've got at least one of these */
- }
-#endif
- /* Make boot-up look pretty */
- pr_info("%d CPUs available, %d CPUs total\n", available_cpus,
- total_cpus);
-
- return 0;
-}
-
-static int __init acpi_parse_fadt(struct acpi_table_header *table)
-{
- return 0;
-}
-
-/*
- * Parse IOAPIC related entries in MADT
- * returns 0 on success, < 0 on error
- * IOAPIC = GIC distributor on ARM
- */
-static int __init acpi_parse_madt_ioapic_entries(void)
-{
- int count;
-
- /*
- * ACPI interpreter is required to complete interrupt setup,
- * so if it is off, don't enumerate the io-apics with ACPI.
- * If MPS is present, it will handle them,
- * otherwise the system will stay in PIC mode
- */
- if (acpi_disabled || acpi_noirq)
- return -ENODEV;
-
- count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR,
- acpi_parse_gic_distributor, MAX_IO_APICS);
-
- if (!count) {
- pr_err(PREFIX "No IOAPIC entries present\n");
- return -ENODEV;
- } else if (count < 0) {
- pr_err(PREFIX "Error parsing IOAPIC entry\n");
- return count;
- }
-
- return 0;
-}
-
-static void __init early_acpi_process_madt(void)
-{
- /* should I introduce CONFIG_ARM_LOCAL_APIC like x86 does? */
- acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt);
-}
-
-static void __init acpi_process_madt(void)
-{
- /* should I introduce CONFIG_ARM_LOCAL_APIC like x86 does? */
- int error;
-
- if (!acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) {
-
- /*
- * Parse MADT LAPIC entries
- */
- error = acpi_parse_madt_lapic_entries();
- if (!error) {
- acpi_lapic = 1;
-
- /*
- * Parse MADT IO-APIC entries
- */
- error = acpi_parse_madt_ioapic_entries();
- if (!error)
- acpi_set_irq_model_gic();
- }
- }
-
- /*
- * ACPI supports both logical (e.g. Hyper-Threading) and physical
- * processors, where MPS only supports physical.
- */
- if (acpi_lapic && acpi_ioapic)
- pr_info("Using ACPI (MADT) for SMP configuration "
- "information\n");
- else if (acpi_lapic)
- pr_info("Using ACPI for processor (LAPIC) "
- "configuration information\n");
-
- return;
-}
-
-/*
- * ========== OLD COMMENTS FROM x86 =================================
- * acpi_boot_table_init() and acpi_boot_init()
- * called from setup_arch(), always.
- * 1. checksums all tables
- * 2. enumerates lapics
- * 3. enumerates io-apics
- *
- * acpi_table_init() is separate to allow reading SRAT without
- * other side effects.
- *
- * side effects of acpi_boot_init:
- * acpi_lapic = 1 if LAPIC found
- * acpi_ioapic = 1 if IOAPIC found
- * if (acpi_lapic && acpi_ioapic) smp_found_config = 1;
- * if acpi_blacklisted() acpi_disabled = 1;
- * acpi_irq_model=...
- * ...
- * ==================================================================
- *
- * We have to approach this a little different on ARMv7. We are
- * passed in an ACPI blob and we really have no idea where in RAM
- * it will be located. So, what should have been the physical
- * addresses of other tables cannot really be hardcoded into the
- * tables. What we will do is put an offset in the blob that is
- * the offset from the beginning of the RSDP structure. However,
- * what that means is that we have to unpack the blob and do a
- * bit of fixup work on the offsets to turn them into kernel
- * virtual addresses so we can pass them on for later use.
- */
-void __init acpi_boot_table_init(void)
-{
- /*
- * If acpi_disabled, bail out
- */
- if (acpi_disabled)
- return;
-
- /*
- * Initialize the ACPI boot-time table parser.
- */
- if (acpi_table_init()) {
- disable_acpi();
- return;
- }
-}
-
-int __init early_acpi_boot_init(void)
-{
- /*
- * If acpi_disabled, bail out
- */
- if (acpi_disabled)
- return 1;
-
- /*
- * Process the Multiple APIC Description Table (MADT), if present
- */
- early_acpi_process_madt();
-
- return 0;
-}
-
-int __init acpi_boot_init(void)
-{
- /*
- * If acpi_disabled, bail out
- */
- if (acpi_disabled)
- return 1;
-
- /*
- * set sci_int and PM timer address
- */
- acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt);
-
- /*
- * Process the Multiple APIC Description Table (MADT), if present
- */
- acpi_process_madt();
-
- return 0;
-}
-
-/*
- * make sure that the address passed for ACPI tables which is normall in
- * system ram is removed from the kernel memory map
- */
-void __init arm_acpi_reserve_memory()
-{
- unsigned long section_offset;
- unsigned long num_sections;
- phys_addr_t addr = acpi_arm_rsdp_info.phys_address;
- int size = acpi_arm_rsdp_info.size;
-
- /* if ACPI tables were not passed in FDT then escape here */
- if (!addr || !size)
- return;
-
- section_offset = addr - (addr & SECTION_MASK);
- num_sections = size / SECTION_SIZE;
- if (size % SECTION_SIZE)
- num_sections++;
-
- memblock_remove(addr - section_offset, num_sections * SECTION_SIZE);
-}
-
-static int __init parse_acpi(char *arg)
-{
- if (!arg)
- return -EINVAL;
-
- /* "acpi=off" disables both ACPI table parsing and interpreter */
- if (strcmp(arg, "off") == 0) {
- disable_acpi();
- }
- /* acpi=strict disables out-of-spec workarounds */
- else if (strcmp(arg, "strict") == 0) {
- acpi_strict = 1;
- }
- return 0;
-}
-early_param("acpi", parse_acpi);
--
1.8.3.1
This patch set is based on Graeme's patches "ARM: ACPI: simplify directory
structure" and "ARM: ACPI: remove irq type switching from core".
Hanjun Guo (3):
ARM / ACPI: Remove acpi_lapic and acpi_ioapic related code
ARM / ACPI: Remove the global lock definition in header file
ARM / ACPI: Remove unused variables
arch/arm/include/asm/acpi.h | 11 -----------
arch/arm64/include/asm/acpi.h | 11 -----------
drivers/acpi/plat/arm-core.c | 23 +----------------------
3 files changed, 1 insertion(+), 44 deletions(-)
--
1.7.9.5
From: Al Stone <ahs3(a)redhat.com>
Initialize pwr_btn_status as disabled which (a) makes sure it is
in a proper state to start, and (b) cleans up a compiler warning
about an uninitialized variable.
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
drivers/acpi/sleep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 14df305..721e949 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -525,7 +525,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
* generate wakeup events.
*/
if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3)) {
- acpi_event_status pwr_btn_status;
+ acpi_event_status pwr_btn_status = ACPI_EVENT_FLAG_DISABLED;
acpi_get_event_status(ACPI_EVENT_POWER_BUTTON, &pwr_btn_status);
--
1.8.3.1
This patch set trys to convert GIC to ACPI which based on patches
from Amit, I rework them and try to get things simpler.
In MADT table, there are GIC cpu interface base address and
GIC distributor base address, use them to convert GIC to ACPI.
GIC should be converted after all the devices refer to GIC are
converted. But this patch set can be safely applied to linaro-acpi
git tree if we don't remove the DT node of GIC, the node of
GIC can be removed after all the devices converted to ACPI.
v2:
a) fix missed iounmap() when return in error path;
b) add stub for acpi_gic_init(void) when !CONFIG_ACPI
C) modify the GSI mapping from DT to ACPI
d) remove the hack code and modify the change log a bit
v3:
a) modify the minor typo for ACPI hwirq mapping "range [16, 31]"
b) return -ENODEV when !CONFIG_ACPI in stub function acpi_gic_init(void)
c) rebased on the latest linaro-acpi kernel
Amit Daniel Kachhap (2):
irqdomain: Add a new API irq_create_acpi_mapping()
ACPI: ARM: Update acpi_register_gsi to register with the core IRQ
subsystem
Hanjun Guo (2):
irqchip / GIC: do not set default host for GIC domain multi-times
when ACPI enabled
ARM / GIC: convert GIC to ACPI using the information in MADT
arch/arm64/kernel/irq.c | 4 ++
drivers/acpi/plat/arm/boot.c | 98 ++++++++++++++++++++++++++++++++++++------
drivers/irqchip/irq-gic.c | 5 ++-
include/linux/acpi.h | 8 ++++
kernel/irq/irqdomain.c | 27 ++++++++++++
5 files changed, 127 insertions(+), 15 deletions(-)
--
1.7.9.5
This patch set trys to convert GIC to ACPI which based on patches
from Amit, I rework two patches from him and fix two minor
bugs :)
In MADT table, there are GIC cpu interface base address and
GIC distributor base address, use them to convert GIC to ACPI.
GIC should be converted after all the devices refer to GIC are
converted. So I hack some code to test this patch set.
Amit Daniel Kachhap (2):
irqdomain: Add a new API irq_create_acpi_mapping
ACPI: ARM: Update acpi_register_gsi to register with the core IRQ
subsystem
Hanjun Guo (3):
irqchip / GIC: do not set default host for GIC domain multi-times
when ACPI enabled
ARM / GIC: convert GIC to ACPI using the information in MADT
ACPI / timer: hack to test GIC in ACPI mode
arch/arm64/kernel/irq.c | 4 ++
drivers/acpi/plat/arm/boot.c | 100 +++++++++++++++++++++++++++++-----
drivers/clocksource/arm_arch_timer.c | 11 +++-
drivers/irqchip/irq-gic.c | 9 ++-
include/linux/acpi.h | 3 +
kernel/irq/irqdomain.c | 27 +++++++++
6 files changed, 133 insertions(+), 21 deletions(-)
--
1.7.9.5
Hi,
Here is update from my side:
- send out summary of APEI work and RFC regarding next steps,
- once we have clear view on this, we will create cards
- now implementing cfi-flash driver
Regards,
Tomasz
Hi Loc, Grant,
>On Thu, 14 Nov 2013 16:01:13 -0800, Loc Ho <lho@xxxxxxx> wrote:
>> Hi Mike,
>>
>> I will be looking into covering the clock driver to support UEFI.
>> Before I do this, can someone explain to me how x86 system handle each
>> IP clock as I don't see such thing?
>
>UEFI is completely unrelated to the clock drivers, it is only a firmware
>interface for the OS loader. UEFI mostly disappears after Linux is
>loaded. Are you perhaps asking about ACPI?
>
>There isn't such a thing on x86. This is entirely new territory. On x86
>as far as I know any clock manipulation that does need to be done would
>be performed by an ACPI method, but there is no concept of an IP clock
>in the ACPI namespace, and so no standard way of describing them.
Yes, there is no standard way (ACPI device object or ACPI table) to
describe clocks for x86 in ACPI spec, but there is a table called GTDT
(Generic Timer Description Table) for ARM which contains information
for arch timer initialization.
you can refer to ACPI spec 5.0 chapter 5.2.24:
http://www.acpi.info/spec50.htm
>
>You'd be much better of talking to Al Stone and Grame Gregory about what
>their plans are for clock support in ACPI and to post your question to
>the ACPI mailing list.
We already finished the implementation of convert fixed clock and arch
timer to ACPI, and I had already post the RFC patch set for review now:
http://marc.info/?l=linaro-acpi&m=138450991609818&w=2http://marc.info/?l=linaro-acpi&m=138198249622451&w=2
Thanks
Hanjun
From: Al Stone <ahs3(a)redhat.com>
Modify the kernel configuration so that if ARM is selected, then
ACPI_REDUCED_HARDWARE is also selected.
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
drivers/acpi/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 099ca81..23522b4 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -5,6 +5,7 @@
config ACPI_ARM
bool
select EARLY_IOREMAP
+ select ACPI_REDUCED_HARDWARE
menuconfig ACPI
bool "ACPI (Advanced Configuration and Power Interface) Support"
--
1.8.3.1
This is the RFC version for converting the fixed clock to ACPI.
Since the ACPI namespace is ok at the very late stage of system
boot, so I did some major change in boot sequence for the enumeration
of fixed clock, amba bus and its child device. I think this part should
be review carefully.
For DT, it works well for armv8 foudation model after the change in
boot sequence, but the UART and amba bus are dependent on the fixed
clock, if I only convert the fixed clock to ACPI, UART will not
work. So this is the RFC version and the UART will be converted
together in next version.
Hanjun Guo (5):
Driver / clk: add platform driver for fixed clock
ACPI / ARM64: Whitelist the ACPI ID for fixed clock
ACPI / platform: add some comments for internel registry of _HID
names
ACPI / fixed-clock: Add ACPI driver for fixed clock
Clk / fixed clock: Delay the enumeration of fixed clock and make it
popssible for ACPI
arch/arm64/kernel/setup.c | 2 +-
drivers/acpi/acpi_platform.c | 7 ++--
drivers/clk/clk-fixed-rate.c | 78 +++++++++++++++++++++++++++++++++++++++++-
3 files changed, 82 insertions(+), 5 deletions(-)
--
1.7.9.5
From: Al Stone <ahs3(a)redhat.com>
Just for convenience sake, bring in the DTS files for the FVP model
so they are easier to find and modify.
These files are all from ARM github; specifically:
https://github.com/ARM-software/arm-trusted-firmware.git
Al Stone (2):
ACPI: ARM: update DTS for RTSM VE motherboard (from ARM github)
ACPI: ARM: add in DTS files for the FVP model (from ARM github)
arch/arm64/boot/dts/fvp-base-gicv2-psci.dts | 250 ++++++++++++++++++++
arch/arm64/boot/dts/fvp-base-gicv2legacy-psci.dts | 250 ++++++++++++++++++++
arch/arm64/boot/dts/fvp-base-gicv3-psci.dts | 259 +++++++++++++++++++++
arch/arm64/boot/dts/fvp-foundation-gicv2-psci.dts | 201 ++++++++++++++++
.../boot/dts/fvp-foundation-gicv2legacy-psci.dts | 201 ++++++++++++++++
arch/arm64/boot/dts/fvp-foundation-gicv3-psci.dts | 210 +++++++++++++++++
.../arm64/boot/dts/fvp-foundation-motherboard.dtsi | 197 ++++++++++++++++
arch/arm64/boot/dts/rtsm_ve-motherboard.dtsi | 38 ++-
8 files changed, 1602 insertions(+), 4 deletions(-)
create mode 100644 arch/arm64/boot/dts/fvp-base-gicv2-psci.dts
create mode 100644 arch/arm64/boot/dts/fvp-base-gicv2legacy-psci.dts
create mode 100644 arch/arm64/boot/dts/fvp-base-gicv3-psci.dts
create mode 100644 arch/arm64/boot/dts/fvp-foundation-gicv2-psci.dts
create mode 100644 arch/arm64/boot/dts/fvp-foundation-gicv2legacy-psci.dts
create mode 100644 arch/arm64/boot/dts/fvp-foundation-gicv3-psci.dts
create mode 100644 arch/arm64/boot/dts/fvp-foundation-motherboard.dtsi
--
1.8.3.1
Just to put it on the record: if you need to add/change/modify
ASL in the acpi-asl.git tree for use with the ARM FVP models,
the correct platform directory to use is rtsm_ve-aemv8a.acpi.
I think everyone probably understands this and is already doing
so; I just wanted to make sure it was explicit and recorded.
Thanks.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Linaro Enterprise Group
al.stone(a)linaro.org
-----------------------------------
This patch set trys to convert GIC to ACPI which based on patches
from Amit, I rework them and try to get things simpler.
In MADT table, there are GIC cpu interface base address and
GIC distributor base address, use them to convert GIC to ACPI.
GIC should be converted after all the devices refer to GIC are
converted. But this patch set can be safely applied to linaro-acpi
git tree if we don't remove the DT node of GIC, the node of
GIC can be removed after all the devices converted to ACPI.
v2:
a) fix missed iounmap() when return in error path;
b) add stab for acpi_gic_init(void) when !CONFIG_ACPI
C) modify the GSI mapping from DT to ACPI
d) remove the hack code and modify the change log a bit
Amit Daniel Kachhap (2):
irqdomain: Add a new API irq_create_acpi_mapping()
ACPI: ARM: Update acpi_register_gsi to register with the core IRQ
subsystem
Hanjun Guo (2):
irqchip / GIC: do not set default host for GIC domain multi-times
when ACPI enabled
ARM / GIC: convert GIC to ACPI using the information in MADT
arch/arm64/kernel/irq.c | 4 ++
drivers/acpi/plat/arm/boot.c | 98 ++++++++++++++++++++++++++++++++++++------
drivers/irqchip/irq-gic.c | 5 ++-
include/linux/acpi.h | 8 ++++
kernel/irq/irqdomain.c | 27 ++++++++++++
5 files changed, 127 insertions(+), 15 deletions(-)
--
1.7.9.5
Fix compilation error:
drivers/acpi/apei/hest.c: In function ‘acpi_hest_init’:
drivers/acpi/apei/hest.c:268:7: error: ‘acpi_disable_cmcff’ undeclared (first use in this function)
drivers/acpi/apei/hest.c:268:7: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [drivers/acpi/apei/hest.o] Error 1
MCE is X86 platform specific and should be consider only if MCE is configured.
---
drivers/acpi/apei/hest.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
index f5e37f3..6d06cce 100644
--- a/drivers/acpi/apei/hest.c
+++ b/drivers/acpi/apei/hest.c
@@ -36,7 +36,9 @@
#include <linux/io.h>
#include <linux/platform_device.h>
#include <acpi/apei.h>
+#ifdef CONFIG_X86_MCE
#include <asm/mce.h>
+#endif
#include "apei-internal.h"
@@ -126,9 +128,9 @@ EXPORT_SYMBOL_GPL(apei_hest_parse);
* Check if firmware advertises firmware first mode. We need FF bit to be set
* along with a set of MC banks which work in FF mode.
*/
+#ifdef CONFIG_X86_MCE
static int __init hest_parse_cmc(struct acpi_hest_header *hest_hdr, void *data)
{
-#ifdef CONFIG_X86_MCE
int i;
struct acpi_hest_ia_corrected *cmc;
struct acpi_hest_ia_error_bank *mc_bank;
@@ -153,9 +155,10 @@ static int __init hest_parse_cmc(struct acpi_hest_header *hest_hdr, void *data)
mc_bank = (struct acpi_hest_ia_error_bank *)(cmc + 1);
for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
mce_disable_bank(mc_bank->bank_number);
-#endif
+
return 1;
}
+#endif
struct ghes_arr {
struct platform_device **ghes_devs;
@@ -263,8 +266,10 @@ void __init acpi_hest_init(void)
goto err;
}
+#ifdef CONFIG_X86_MCE
if (!acpi_disable_cmcff)
apei_hest_parse(hest_parse_cmc, NULL);
+#endif
if (!ghes_disable) {
rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
--
1.7.9.5
From: Naresh Bhat <naresh.bhat(a)linaro.org>
While testing Brandon Anderson patches on foundation v8 model, the model use to hang
while booting, because UART is unable to find the clock source.
...
.....
ACPI: No dock devices found.
acpi_amba_add_device(): amba_device_add() failed (-2) for LINA000A:00
acpi_amba_add_device(): amba_device_add() failed (-2) for LINA000A:01
acpi_amba_add_device(): amba_device_add() failed (-2) for LINA000A:02
acpi_amba_add_device(): amba_device_add() failed (-2) for LINA000A:03
...
....
This patch issued to fix the same issue under foundation v8 platform dsdt asl file.
Naresh Bhat (1):
foundation-v8: Add clk changes
platforms/foundation-v8.acpi/dsdt.asl | 47 +++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
--
1.7.9.5
From: Al Stone <ahs3(a)redhat.com>
This series of patches starts with Hanjun's patch to create a kernel
config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I
then reviewed all of the code that touched any of several fields in the
FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced
mode [1]. Any time there was a use of one of the fields to be ignored,
I evaluated whether or not the code was implementing Hardware Reduced
mode correctly. Similarly, for each the flags in the FADT flags field
that are to be ignored in Hardware Reduced mode, the kernel code was again
scanned for proper usage. The remainder of the patches are to fix all of
the situations I could find where the kernel would not behave correctly
in this ACPI mode.
These are being submitted as an RFC to the linaro-acpi@ list so I can get
some other eyes looking at them before sending them to linux-acpi@ where
they really need to go. These seem to work just fine on the RTSM model
for ARMv7, both with and without ACPI enabled, and with and without
ACPI_REDUCED_HARDWARE enabled. However, there's no way I can think of
or test all possible scenarios so feedback would be greatly appreciated.
NB: these changes are only applicable to the LEG ACPI working tree. The
macros in patch 1/13 will have to change for the linux-acpi tree.
Changes for v3:
-- Consistent use of #if (!ACPI_REDUCED_HARDWARE)
-- Use of ACPI_HW_DEPENDENT_RETURN_{*} macros
-- Simplify wherever possible
Changes for v2:
-- Change patch series title
-- Add in the FACS global lock patch as further hardware reduced mode
cleanup that is needed
-- Remove whitespace change that should not have gotten in
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced
mode.
[0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5…
Al Stone (13):
ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode
ACPI: bus master reload not supported in reduced HW mode
ACPI: clean up compiler warning about uninitialized field
ACPI: HW reduced mode does not allow use of the FADT sci_interrupt
field
ACPI: ARM: exclude calls on ARM platforms, not include them on x86
ACPI: ensure several FADT fields are only used in HW reduced mode
ACPI: do not reserve memory regions for some FADT entries in HW
reduced mode
ACPI: in HW reduced mode, getting power latencies from FADT is not
allowed
ACPI: add clarifying comment about processor throttling in HW reduced
mode
ACPI: ACPI_FADT_C2_MP_SUPPORTED must be ignored in HW reduced mode
ACPI: use of ACPI_FADT_32BIT_TIMER is not allowed in HW reduced mode
ACPI: correct #ifdef so compilation without ACPI_REDUCED_HARDWARE
works
ACPI: ARM/ARM64: ensure the ACPI FACS global_lock is never used in HW
reduced mode
arch/arm/include/asm/acpi.h | 3 ++-
arch/arm64/include/asm/acpi.h | 3 ++-
drivers/acpi/Kconfig | 8 ++++++++
drivers/acpi/acpica/utxface.c | 3 ++-
drivers/acpi/bus.c | 7 ++++---
drivers/acpi/osl.c | 28 ++++++++++++++++++++--------
drivers/acpi/pci_link.c | 14 ++++++++------
drivers/acpi/plat/arm/boot.c | 2 ++
drivers/acpi/processor_idle.c | 19 ++++++++++++-------
drivers/acpi/processor_throttling.c | 8 ++++++++
drivers/acpi/sleep.c | 2 +-
include/acpi/acconfig.h | 2 +-
include/acpi/acpixf.h | 6 ++++++
include/acpi/platform/aclinux.h | 6 ++++++
14 files changed, 82 insertions(+), 29 deletions(-)
--
1.8.3.1
From: Al Stone <ahs3(a)redhat.com>
This series of patches starts with Hanjun's patch to create a kernel
config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I
then reviewed all of the code that touched any of several fields in the
FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced
mode [1]. Any time there was a use of one of the fields to be ignored,
I evaluated whether or not the code was implementing Hardware Reduced
mode correctly. Similarly, for each the flags in the FADT flags field
that are to be ignored in Hardware Reduced mode, the kernel code was again
scanned for proper usage. The remainder of the patches are to fix all of
the situations I could find where the kernel would not behave correctly
in this ACPI mode.
These are being submitted as an RFC to the linaro-acpi@ list so I can get
some other eyes looking at them before sending them to linux-acpi@ where
they really need to go. These seem to work just fine on the RTSM model
for ARMv7, both with and without ACPI enabled, and with and without
ACPI_REDUCED_HARDWARE enabled. However, there's no way I can think of
or test all possible scenarios so feedback would be greatly appreciated.
Changes for v2:
-- Change patch series title
-- Add in the FACS global lock patch as further hardware reduced mode
cleanup that is needed
-- Remove whitespace change that should not have gotten in
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced
mode.
[0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5…
Al Stone (13):
ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode
ACPI: bus master reload is unsupported in ACPI reduced HW mode
ACPI: clean up compiler warning about uninitialized field
ACPI: HW reduced mode does not allow use of the FADT sci_interrupt
field
ACPI: ARM: exclude calls on ARM platforms, not include them on x86
ACPI: ensure several FADT fields are only used in HW reduced mode
ACPI: do not reserve memory regions for some FADT entries in HW
reduced mode
ACPI: in HW reduced mode, getting power latencies from FADT is not
allowed
ACPI: add clarifying comment about processor throttling in HW reduced
mode
ACPI: ACPI_FADT_C2_MP_SUPPORTED must be ignored in HW reduced mode
ACPI: use of ACPI_FADT_32BIT_TIMER is not allowed in HW reduced mode
ACPI: correct #ifdefs so compiling without ACPI_REDUCED_HARDWARE works
properly
ACPI: ARM/ARM64: ensure the ACPI FACS global_lock is never used in HW
reduced mode
arch/arm/include/asm/acpi.h | 3 ++-
arch/arm64/include/asm/acpi.h | 3 ++-
drivers/acpi/Kconfig | 8 ++++++++
drivers/acpi/acpica/utxface.c | 3 ++-
drivers/acpi/bus.c | 9 +++++----
drivers/acpi/osl.c | 28 ++++++++++++++++++++--------
drivers/acpi/pci_link.c | 14 ++++++++------
drivers/acpi/plat/arm/boot.c | 2 ++
drivers/acpi/processor_idle.c | 29 ++++++++++++++++++++++++-----
drivers/acpi/processor_throttling.c | 8 ++++++++
drivers/acpi/sleep.c | 2 +-
include/acpi/acconfig.h | 2 +-
include/acpi/platform/aclinux.h | 6 ++++++
13 files changed, 89 insertions(+), 28 deletions(-)
--
1.8.3.1
On 29 October 2013 09:30, Lv Zheng <lv.zheng(a)intel.com> wrote:
> From: Bob Moore <robert.moore(a)intel.com>
>
> Surround definition of this with a #ifndef so that the kernel
> can define it elsewhere if desired.
>
> Signed-off-by: Bob Moore <robert.moore(a)intel.com>
> Signed-off-by: Lv Zheng <lv.zheng(a)intel.com>
>
Reviewed-by: Hanjun Guo <hanjun.guo(a)linaro.org>
> ---
> include/acpi/acconfig.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
> index 1c16f82..d98c670 100644
> --- a/include/acpi/acconfig.h
> +++ b/include/acpi/acconfig.h
> @@ -100,7 +100,9 @@
> * ACPI PM timer
> * FACS table (Waking vectors and Global Lock)
> */
> +#ifndef ACPI_REDUCED_HARDWARE
> #define ACPI_REDUCED_HARDWARE FALSE
> +#endif
>
>
> /******************************************************************************
> *
> --
> 1.7.10
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo(a)vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
From: Brandon Anderson <brandon.anderson(a)amd.com>
This is a proposal for ACPI driver probing of the ARM AMBA devices currently listed under ‘iofpga’ in the RTSM dts file. The main addition is drivers/amba/acpi.c which fits the role of an AMBA bus ‘connector resource’ for ACPI using struct amba_device.
I have not yet figured out the implementation details regarding clocks (handled in the dts file with clock-names). However, I have included a proposed ASL format for clock information in the DSDT example below. With the last patch that hacks the clock info, this prototype will run on the Foundation and RTSM models.
These patches require Hanjun’s fixed-clock patches to be applied first on top of a Linaro ACPI kernel: https://git.linaro.org/gitweb?p=arm/acpi/leg-kernel.git;a=summary
Please comment on both the concept and the implementation.
Brandon Anderson (3):
Remove UART and KMI entries from DTS file
Prototype of AMBA bus 'connector resource' for ACPI
Hack clock names to get prototype running
arch/arm64/boot/dts/foundation-v8-acpi.dts | 10 +-
arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts | 4 +
arch/arm64/boot/dts/rtsm_ve-motherboard-acpi.dtsi | 4 +
drivers/acpi/acpi_platform.c | 2 +
drivers/amba/Makefile | 2 +-
drivers/amba/acpi.c | 172 +++++++++++++++++++++
drivers/clk/clk-fixed-rate.c | 15 +-
7 files changed, 203 insertions(+), 6 deletions(-)
create mode 100644 drivers/amba/acpi.c
--
1.7.9.5
---
Device (AMBA) {
Name (_HID, "AMBA0000") /* the parallel to "arm,primecell" in DTS */
Name (_UID, 0)
/* Define 'apb_pclk' as a default clock source since it is
common with devices below */
Method(_DSM, 4, NotSerialized) {
Store (Package (3)
{
"clock-name", "apb_pclk", "\\_SB_.CLK0",
}, Local0)
Return (Local0)
}
Device (KMI0) {
Name (_ADR,0x1c060000)
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c060000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {44}
})
Return (RBUF)
}
}
Device (KMI1) {
Name (_ADR,0x1c070000)
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c070000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {45}
})
Return (RBUF)
}
}
Device (SER0) {
Name (_ADR,0x1c090000) // UART0
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c090000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {37}
})
Return (RBUF)
}
}
Device (SER1) {
Name (_ADR,0x1c0a0000) // UART1
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c0a0000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {38}
})
Return (RBUF)
}
}
Device (SER2) {
Name (_ADR,0x1c0b0000) // UART2
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c0b0000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {39}
})
Return (RBUF)
}
}
Device (SER3) {
Name (_ADR,0x1c0c0000) // UART3
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c0c0000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {40}
})
Return (RBUF)
}
}
}
From: Al Stone <ahs3(a)redhat.com>
This function was not defined as a pointer to a function but as a function.
This resulted in a "test is always true" warning in drivers/acpi/sleep.c where
it tested for the existence of the function.
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
arch/arm/include/asm/acpi.h | 2 +-
arch/arm64/include/asm/acpi.h | 2 +-
drivers/acpi/plat/arm/sleep.c | 11 +++++++++--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/arch/arm/include/asm/acpi.h b/arch/arm/include/asm/acpi.h
index ca7efaa..31f21fd 100644
--- a/arch/arm/include/asm/acpi.h
+++ b/arch/arm/include/asm/acpi.h
@@ -115,7 +115,7 @@ extern struct acpi_arm_root acpi_arm_rsdp_info;
void arm_acpi_reserve_memory(void);
/* Low-level suspend routine. */
-extern int acpi_suspend_lowlevel(void);
+extern int (*acpi_suspend_lowlevel)(void);
extern void prefill_possible_map(void);
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index a19b73f..aee7190 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -93,7 +93,7 @@ extern struct acpi_arm_root acpi_arm_rsdp_info;
void arm_acpi_reserve_memory(void);
/* Low-level suspend routine. */
-extern int acpi_suspend_lowlevel(void);
+extern int (*acpi_suspend_lowlevel)(void);
extern void prefill_possible_map(void);
diff --git a/drivers/acpi/plat/arm/sleep.c b/drivers/acpi/plat/arm/sleep.c
index 9129c7e..ac5e343 100644
--- a/drivers/acpi/plat/arm/sleep.c
+++ b/drivers/acpi/plat/arm/sleep.c
@@ -1,15 +1,22 @@
/*
- * sleep.c - x86-specific ACPI sleep support.
+ * sleep.c - ARM-specific ACPI sleep support.
*
* Copyright (C) 2001-2003 Patrick Mochel
* Copyright (C) 2001-2003 Pavel Machek <pavel(a)ucw.cz>
*/
+#ifdef CONFIG_ACPI_SLEEP
int acpi_suspend_lowlevel(void)
{
- /* BOZO: dummy routine; see below for actual */
+ /*
+ * TODO: connect this function to PSCI when it becomes available,
+ * and if actually needed.
+ */
return 0;
}
+#else
+int acpi_suspend_lowlevel(void);
+#endif
#ifdef CONFIG_X86
/* BOZO: disable everything for now... */
--
1.8.3.1
Hi,
This is interesting answer to my question so I am shearing it with you.
Tomasz
-------- Original Message --------
Subject: Re: APEI question
Date: Thu, 24 Oct 2013 02:38:26 -0400
From: Chen, Gong <gong.chen(a)linux.intel.com>
To: Tomasz Nowicki <tn(a)semihalf.com>
On Wed, Oct 23, 2013 at 11:16:13AM +0200, Tomasz Nowicki wrote:
> Date: Wed, 23 Oct 2013 11:16:13 +0200
> From: Tomasz Nowicki <tn(a)semihalf.com>
> To: chen gong <Chen(a)gchen.bj.intel.com>
> CC: gong.chen(a)linux.intel.com
> Subject: Re: APEI question
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101
> Thunderbird/24.0
>
> Let me put this in the different way.
>
> ghes_do_proc() process errors which are reported via APEI. It
> handles with CPER_SEC_PLATFORM_MEM and CPER_SEC_PCIE error types. I
> wander why this function is not taking care of
> CPER_SEC_PROC_GENERIC.
>
Yes, the spec has covered all kinds of situations but the reality is
cruel. Even FFM is enabled, not all errors can be covered by
firmware. Based on the fact, only memory/IO CE and IO UC errors can
be handled well by firmware by now. For processer errors, as a fact,
I never saw so-called CE errors, only UC, even fatal error. As a
result, you will get a MCE. You can consider that firmware just
*bypass* this kind of error. In some way, that's why eMCA happens
as a successor. That's all. Otherwise I will cross the red line ;-).
From: Al Stone <ahs3(a)redhat.com>
This series of patches starts with Hanjun's patch to create a kernel
config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I
then reviewed all of the code that touched any of several fields in the
FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced
mode [1]. Any time there was a use of one of the fields to be ignored,
I evaluated whether or not the code was implementing Hardware Reduced
mode correctly. Similarly, for each the flags in the FADT flags field
that are to be ignored in Hardware Reduced mode, the kernel code was again
scanned for proper usage. The remainder of the patches are to fix all of
the situations I could find where the kernel would not behave correctly
in this ACPI mode.
These are being submitted as an RFC to the linaro-acpi@ list so I can get
some other eyes looking at them before sending them to linux-acpi@ where
they really need to go. These seem to work just fine on the RTSM model
for ARMv7, both with and without ACPI enabled, and with and without
ACPI_REDUCED_HARDWARE enabled. However, there's no way I can think of
or test all possible scenarios so feedback would be greatly appreciated.
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced
mode.
[0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5…
Al Stone (12):
ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode
ACPI: bus master reload is unsupported in ACPI reduced HW mode
ACPI: clean up compiler warning about uninitialized field
ACPI: HW reduced mode does not allow use of the FADT sci_interrupt
field
ACPI: ARM: exclude calls on ARM platforms, not include them on x86
ACPI: ensure several FADT fields are only used in HW reduced mode
ACPI: do not reserve memory regions for some FADT entries in HW
reduced mode
ACPI: in HW reduced mode, getting power latencies from FADT is not
allowed
ACPI: add clarifying comment about processor throttling in HW reduced
mode
ACPI: ACPI_FADT_C2_MP_SUPPORTED must be ignored in HW reduced mode
ACPI: use of ACPI_FADT_32BIT_TIMER is not allowed in HW reduced mode
ACPI: correct #ifdefs so compiling without ACPI_REDUCED_HARDWARE works
properly
drivers/acpi/Kconfig | 8 ++++++++
drivers/acpi/acpica/utxface.c | 3 ++-
drivers/acpi/bus.c | 9 +++++----
drivers/acpi/osl.c | 28 ++++++++++++++++++++--------
drivers/acpi/pci_link.c | 14 ++++++++------
drivers/acpi/processor_idle.c | 29 ++++++++++++++++++++++++-----
drivers/acpi/processor_throttling.c | 8 ++++++++
drivers/acpi/sleep.c | 2 +-
include/acpi/acconfig.h | 2 +-
include/acpi/platform/aclinux.h | 6 ++++++
10 files changed, 83 insertions(+), 26 deletions(-)
--
1.8.3.1
From: Al Stone <ahs3(a)redhat.com>
This patch is dependent on the CONFIG_ACPI_REDUCED_HARDWARE patch
already being in place. It may even make sense to be part of that
series.
The FACS contains a global_lock that is never to be used in Hardware
Reduced mode. Instead of taking chances, this patch takes out the
macros used for the global_lock if we are in Hardware Reduced mode
so that they cannot be used.
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
arch/arm/include/asm/acpi.h | 3 ++-
arch/arm64/include/asm/acpi.h | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/acpi.h b/arch/arm/include/asm/acpi.h
index ca7efaa..cf67b09 100644
--- a/arch/arm/include/asm/acpi.h
+++ b/arch/arm/include/asm/acpi.h
@@ -82,6 +82,7 @@
/* Blob handling macros */
#define ACPI_BLOB_HEADER_SIZE 8
+#ifndef CONFIG_ACPI_REDUCED_HARDWARE
int __acpi_acquire_global_lock(unsigned int *lock);
int __acpi_release_global_lock(unsigned int *lock);
@@ -90,9 +91,9 @@ int __acpi_release_global_lock(unsigned int *lock);
#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
((Acq) = __acpi_release_global_lock(&facs->global_lock))
+#endif
/* Basic configuration for ACPI */
-/* BOZO: hardware reduced acpi only? */
#ifdef CONFIG_ACPI
extern int acpi_disabled;
extern int acpi_noirq;
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index a19b73f..bb9411f 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -60,6 +60,7 @@
/* Blob handling macros */
#define ACPI_BLOB_HEADER_SIZE 8
+#ifndef CONFIG_ACPI_REDUCED_HARDWARE
int __acpi_acquire_global_lock(unsigned int *lock);
int __acpi_release_global_lock(unsigned int *lock);
@@ -68,9 +69,9 @@ int __acpi_release_global_lock(unsigned int *lock);
#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
((Acq) = __acpi_release_global_lock(&facs->global_lock))
+#endif
/* Basic configuration for ACPI */
-/* BOZO: hardware reduced acpi only? */
#ifdef CONFIG_ACPI
extern int acpi_disabled;
extern int acpi_noirq;
--
1.8.3.1
From: Naresh Bhat <naresh.bhat(a)linaro.org>
The patches try to fix the DBG2 table compilation issue
and also tries to add a template support for DBG2 tables.
Naresh Bhat (2):
iASL: Fix Table Info handler for DBG2
iASL: Add template support for dbg2
source/common/dmtable.c | 2 +-
source/compiler/dtcompiler.h | 1 +
source/compiler/dttemplate.h | 10 ++++++++++
3 files changed, 12 insertions(+), 1 deletion(-)
--
1.7.9.5
From: Naresh Bhat <naresh.bhat(a)linaro.org>
The ASL code for SMB, FPGA, AMBA bus and the devices on the bus. The SMB and FPGA are represented as Module device. The container object that acts as a bus node in a namespace. It may contain child objects that are devices or buses. The module device is declared using the ACPI0004 hardware identifier (HID). The AMBA is represented as a separate device along with UART.
This patch is applied and tested on v8 model along with "Hanjun Guo" - Convert the fixed clock to ACPI and "Brandon Anderson" - ARM AMBA bus connector resource changes. The sample output logs on v8 model as below
root@genericarmv8:/sys# find . -name LINA*
./bus/acpi/devices/LINA0003:00
./bus/acpi/devices/LINA0005:00
./bus/acpi/devices/LINA0007:00
./bus/acpi/devices/LINA0008:00
./bus/acpi/devices/LINA0008:01
./bus/acpi/devices/LINA0008:02
./bus/acpi/devices/LINA0009:00
./bus/platform/devices/LINA0003:00
./bus/platform/devices/LINA0005:00
./bus/platform/devices/LINA0007:00
./bus/platform/devices/LINA0008:00
./bus/platform/devices/LINA0008:01
./bus/platform/devices/LINA0008:02
./bus/platform/drivers/smc91x/LINA0003:00
./bus/platform/drivers/fixed-clk/LINA0008:00
./bus/platform/drivers/fixed-clk/LINA0008:01
./bus/platform/drivers/fixed-clk/LINA0008:02
./bus/platform/drivers/arm-pmu/LINA0007:00
./bus/platform/drivers/virtio-mmio/LINA0005:00
./devices/platform/LINA0003:00
./devices/platform/LINA0005:00
./devices/platform/LINA0007:00
./devices/platform/LINA0008:00
./devices/platform/LINA0008:01
./devices/platform/LINA0008:02
./devices/LNXSYSTM:00/device:00/LINA0007:00
./devices/LNXSYSTM:00/device:00/ACPI0004:01/LINA0003:00
./devices/LNXSYSTM:00/device:00/ACPI0004:01/LINA0008:00
./devices/LNXSYSTM:00/device:00/ACPI0004:01/LINA0008:01
./devices/LNXSYSTM:00/device:00/ACPI0004:01/LINA0008:02
./devices/LNXSYSTM:00/device:00/ACPI0004:01/ACPI0004:02/LINA0005:00
./devices/LNXSYSTM:00/device:00/ACPI0004:01/ACPI0004:02/LINA0009:00
root@genericarmv8:/sys#
root@genericarmv8:/sys# find . -name AMBA*
./bus/acpi/devices/AMBA0000:00
./bus/platform/devices/AMBA0000:00
./bus/platform/drivers/amba-acpi/AMBA0000:00
./devices/platform/AMBA0000:00
./devices/LNXSYSTM:00/device:00/AMBA0000:00
root@genericarmv8:/sys#
root@genericarmv8:/sys/bus/amba/devices# ls
device:01 device:02 device:03 device:04
root@genericarmv8:/sys/bus/amba/devices#
Naresh Bhat (1):
foundation: Add ASL for bus, devices enumeration
platforms/foundation-v8.acpi/dsdt.asl | 181 +++++++++++++++++++++++++++++++--
1 file changed, 175 insertions(+), 6 deletions(-)
--
1.7.9.5
This is the RFC version for converting the fixed clock to ACPI.
Since the ACPI namespace is ok at the very late stage of system
boot, so I did some major change in boot sequence for the enumeration
of fixed clock, amba bus and its child device. I think this part should
be review carefully.
For DT, it works well for armv8 foudation model after the change in
boot sequence, but the UART and amba bus are dependent on the fixed
clock, if I only convert the fixed clock to ACPI, UART will not
work. So this is the RFC version and the UART will be converted
together in next version.
Hanjun Guo (5):
Driver / clk: add platform driver for fixed clock
ACPI / ARM64: Whitelist the ACPI ID for fixed clock
ACPI / platform: add some comments for internel registry of _HID
names
ACPI / fixed-clock: Add ACPI driver for fixed clock
Clk / fixed clock: Delay the enumeration of fixed clock and make it
popssible for ACPI
arch/arm64/kernel/setup.c | 2 +-
drivers/acpi/acpi_platform.c | 7 ++--
drivers/clk/clk-fixed-rate.c | 78 +++++++++++++++++++++++++++++++++++++++++-
3 files changed, 82 insertions(+), 5 deletions(-)
--
1.7.9.5
linux/acpi.h already does the correct thing when CONFIG_ACPI is not set
so there is no need to wrap it in #ifdef CONFIG_ACPI and in fact this
stops ACPI_PTR() working in the non ACPI case.
Signed-off-by: Graeme Gregory <graeme.gregory(a)linaro.org>
---
drivers/net/ethernet/smsc/smc91x.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 940097f..7aa517d 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -82,6 +82,7 @@ static const char version[] =
#include <linux/mii.h>
#include <linux/workqueue.h>
#include <linux/of.h>
+#include <linux/acpi.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
@@ -89,10 +90,6 @@ static const char version[] =
#include <asm/io.h>
-#ifdef CONFIG_ACPI
-#include <linux/acpi.h>
-#endif
-
#include "smc91x.h"
#ifndef SMC_NOWAIT
--
1.8.3.1
Hi,
I am proposing one cherry pick from Mark Salters tree in the same way
that we already cherry picked from Leifs for ioremap_early support.
Also changed the order of setup.c initialisation to work under ioremap_early.
I have boot tested this on the RTSM model.
Thanks
Graeme
Hi,
I am able to see APEI events (memory errors) via perft tool and now
switch my context to others types of error. According to our plan, cache
ECC error type would be next.
I want to place tracepoints at the end of every available APEI error
processing path (actually it is already done for memory errors). This
way we RAS daemon could keep its eye on them. There would be of course
more type of error coming from others ARM SoC peripherals.
GHES driver is unrolling data structure to "Common Platform Error
Record" and try to obtain error section (defined in UEFI spec). Cache
ECC fall within "Processor Error Sections". Here appear problems since
most of "Common Platform Error Records" are x86/IA64 oriented.
So my proposals would be to:
1. Implement all available APEI errors as tracepoint that is: Processor
and PCI errors
2. Mean time, create proposals for UEFI spec. toward "Common Platform
Error Record" expansion for ARM architecture. This would require
changing available structures and add new sections for SoC peripherals
(USB, Ethernet etc.).
3. In turn, new sections for SoC peripherals in UEFI spec. would require
ACPI spec. change as well, I mean new error sources for HEST table.
4. Once above proposals would be accept, we could fill in tracepoints
for new error types.
I would appreciate any input on this.
Regards,
Tomasz
hi,
The patches in the series are work in progress and as discussed with Al Stone
and Hanjun include changes in the GTDT acpi table to add missing elements for ARM
platforms. Elements added are Timer frequency, interrupt count(currently 8 supported),
timer ID(This will be used to invoke the correct controller).
Still more TODO's are identified.
* To add timer clock names.
* if this __init invoking mechanism is finalised then other similar devices can
use this like clock, GIC etc.
* GTDT can ultimately be made CTDT(Common timer descriptor table) to other classes of
timers like external exynos MCT.
Changes in V2:
* Added new fields in GTDT acpi table.
* Infrastructure to invoke the correct timer controller.
Thanks in advance.
Amit
Amit Daniel Kachhap (6):
irqdomain: Add a new API irq_create_default_mapping
ACPI: ARM: Update acpi_register_gsi to register with the core IRQ
subsystem
irqchip: gic: Fix to make dt node check optional in case of ACPI
acpi: gtdt: Update GTDT tables to add more fields
clocksource:acpi: Add macro CLOCKSOURCE_ACPI_DECLARE
clocksource: arch_timer: acpi: Use GTDT table to gather data
drivers/acpi/plat/arm/boot.c | 27 +++++++-
drivers/clocksource/arm_arch_timer.c | 111 +++++++++++++++++++++++++++++-----
drivers/clocksource/clksrc-of.c | 32 ++++++++++
drivers/irqchip/irq-gic.c | 2 +
include/acpi/actbl3.h | 22 +++++++
include/asm-generic/vmlinux.lds.h | 6 ++
include/linux/clocksource.h | 13 ++++
include/linux/irqdomain.h | 2 +
kernel/irq/irqdomain.c | 35 +++++++++++
9 files changed, 232 insertions(+), 18 deletions(-)
'dev_id' in the comments of clk_register_clkdev should
be 'dev_fmt' here.
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
drivers/clk/clkdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 442a313..825b52b 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -270,9 +270,9 @@ EXPORT_SYMBOL(clkdev_drop);
* clk_register_clkdev - register one clock lookup for a struct clk
* @clk: struct clk to associate with all clk_lookups
* @con_id: connection ID string on device
- * @dev_id: format string describing device name
+ * @dev_fmt: format string describing device name
*
- * con_id or dev_id may be NULL as a wildcard, just as in the rest of
+ * con_id or dev_fmt may be NULL as a wildcard, just as in the rest of
* clkdev.
*
* To make things easier for mass registration, we detect error clks
--
1.7.9.5
From: Naresh Bhat <naresh.bhat(a)linaro.org>
The patch set will add the DBG2 table, compilation support. I have just added only one sample SER0 device.
If DBG2 table fields, values looks ok. Then I will add 3 more devices (SER1 to SER3),
Since there are 4 UART devices in foundation-v8 model.
Signed-off-by: Naresh Bhat <naresh.bhat(a)linaro.org>
Naresh Bhat (2):
dbg2: Add dbg2 table
Add support to compile dbg2 table
platforms/foundation-v8.acpi/dbg2.asl | 47 ++++++++++++++++++++
.../foundation-v8.acpi/foundation-v8.manifest | 1 +
platforms/foundation-v8.acpi/xsdt.asl | 1 +
tools/common/build_aml.c | 1 +
tools/common/check_aml.c | 1 +
tools/common/include/check_aml.h | 1 +
6 files changed, 52 insertions(+)
create mode 100644 platforms/foundation-v8.acpi/dbg2.asl
--
1.7.9.5
EINJ table is fully implemented in kernel and no changes were needed
to bring it up on armv7/8 arch.
Along with work on EINJ coulpe of steps were done like:
1. Expand bfapei tool so it can create blob which pretend h/w registers
for EINJ driver.
2. Filling address in EINJ table according to those in blob.
3. Trigger error using existing injection kernel mechanism.
See commit for more details.
Changes for v2:
- add more descriptive commit log
Changes for v3:
- replace constant values with defines
Tomasz Nowicki (4):
bfapei: Move common functionality to separate function.
bfapei: Expand bfapei tool to EINJ table testing.
acpi, apei, einj: Fill in EINJ table according to address in EINJ
blobs.
acpi, apei, einj: Relace constant value with defines.
platforms/exynos5250-arndale.acpi/einj.asl | 20 +++---
platforms/foundation-v8.acpi/einj.asl | 20 +++---
platforms/rtsm_ve-aemv8a.acpi/einj.asl | 20 +++---
tools/bfapei/bfapei.c | 104 +++++++++++++++++++++++-----
tools/bfapei/bfapei.h | 30 ++++++--
tools/common/include/acpi.h | 77 ++++++++++++++++++++
6 files changed, 215 insertions(+), 56 deletions(-)
--
1.7.9.5
EINJ table is fully implemented in kernel and no changes were needed
to bring it up on armv7/8 arch.
Along with work on EINJ coulpe of steps were done like:
1. Expand bfapei tool so it can create blob which pretend h/w registers
for EINJ driver.
2. Filling address in EINJ table according to those in blob.
3. Trigger error using existing injection kernel mechanism.
See commit for more details.
Changes for v2:
- add more descriptive commit log
Tomasz Nowicki (3):
bfapei: Move common functionality to separate function.
bfapei: Expand bfapei tool to EINJ table testing.
acpi, apei, einj: Fill in EINJ table according to address in EINJ
blobs.
platforms/exynos5250-arndale.acpi/einj.asl | 20 +++---
platforms/foundation-v8.acpi/einj.asl | 20 +++---
platforms/rtsm_ve-aemv8a.acpi/einj.asl | 20 +++---
tools/bfapei/bfapei.c | 101 ++++++++++++++++++++++------
tools/bfapei/bfapei.h | 30 +++++++--
tools/common/include/acpi.h | 57 ++++++++++++++++
6 files changed, 192 insertions(+), 56 deletions(-)
--
1.7.9.5
-- Treść oryginalnej wiadomości --
Temat: Re: [Linaro-acpi] [PATCH 0/3] Hacks for APEI tables test.
Data: Thu, 10 Oct 2013 09:45:54 +0200
Nadawca: Tomasz Nowicki <tomasz.nowicki(a)linaro.org>
Adresat: Al Stone <al.stone(a)linaro.org>
W dniu 09.10.2013 22:33, Al Stone pisze:
> On 09/06/2013 08:07 AM, Tomasz Nowicki wrote:
>> These commits were created to make APEI tables testable. All should be
>> pushed
>> to some test brunch so anybody could test it on his own, reused etc.
>>
>> Tomasz Nowicki (3):
>> acpi, apei, erst: Reserve no cachable region for persistent storage.
>> acpi, apei, einj: Hack EINJ driver to enable injection GHES and
>> kernel panic from userspace.
>> apci, apei, arm64: Make some space for APEI blob.
>>
>> arch/arm64/boot/dts/foundation-v8-acpi.dts | 2 +-
>> drivers/acpi/apei/einj.c | 27
>> +++++++++++++++++++++++++++
>> drivers/acpi/apei/erst.c | 2 +-
>> 3 files changed, 29 insertions(+), 2 deletions(-)
>>
>
> So I think these patches are okay as they are. Are you
> working on this for UEFI, also? I'd like to see a separate
> patch enabling this to work for the UEFI case also as soon
> as we can.
1. Since we can trigger APEI errors using simulated SCI we do not need
second patch and only fist and third patch are on special branch right now.
2. This patch set should work for UEFI but I need to check how to load
APEI blob from UEFI. So yes this require additional invesitation or
eventual development. Thanks for input on this. I will add another card
for this.
Tomasz
From: Al Stone <ahs3(a)redhat.com>
The current version requires one to know the size of the package
a priori; this is almost impossible if the package is composed of
strings of variable length. This change allows the utility to
allocate a buffer of the proper size if asked.
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
drivers/acpi/utils.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 552248b..fc2cd32 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -169,11 +169,20 @@ acpi_extract_package(union acpi_object *package,
/*
* Validate output buffer.
*/
- if (buffer->length < size_required) {
+ if (buffer->length == ACPI_ALLOCATE_BUFFER) {
+ buffer->pointer = ACPI_ALLOCATE(size_required);
+ if (!buffer->pointer)
+ return AE_NO_MEMORY;
buffer->length = size_required;
- return AE_BUFFER_OVERFLOW;
- } else if (buffer->length != size_required || !buffer->pointer) {
- return AE_BAD_PARAMETER;
+ memset(buffer->pointer, 0, size_required);
+ } else {
+ if (buffer->length < size_required) {
+ buffer->length = size_required;
+ return AE_BUFFER_OVERFLOW;
+ } else if (buffer->length != size_required ||
+ !buffer->pointer) {
+ return AE_BAD_PARAMETER;
+ }
}
head = buffer->pointer;
--
1.8.3.1
These commits were created to make APEI tables testable. All should be pushed
to some test brunch so anybody could test it on his own, reused etc.
Tomasz Nowicki (3):
acpi, apei, erst: Reserve no cachable region for persistent storage.
acpi, apei, einj: Hack EINJ driver to enable injection GHES and
kernel panic from userspace.
apci, apei, arm64: Make some space for APEI blob.
arch/arm64/boot/dts/foundation-v8-acpi.dts | 2 +-
drivers/acpi/apei/einj.c | 27 +++++++++++++++++++++++++++
drivers/acpi/apei/erst.c | 2 +-
3 files changed, 29 insertions(+), 2 deletions(-)
--
1.7.9.5
The patch below adds in an early_ioremap for aarch64 allowing
the ACPI code to function. It's still under discussion upstream
and will likely change but it will allow work to continue on
aarch64 in the short-term.
Please test and let us know if it works or if it uncovers any
other interesting issues.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Linaro Enterprise Group
al.stone(a)linaro.org
-----------------------------------
This is re-use existing patch submitted by Huang Ying <ying.huang(a)intel.com>
with one small modification (see commits). The first idea was to use just
printk to inform about any errors that were not consumed by OS.
Errors listed in HEST table should point to the same "Error status block" ESB
structures as BERT does. OS handling errors should clear errors status bit
in ESB for given error at the end of error recovery procedure. Case where error
appeared to be too serious OS can reset machine immediately without clearing
bit in ESB. During boot, kernel examine each error status bit from ESB list
(pointed from BERT) and see if there are any unhandled errors.
BERT table was tested along with HEST and EINJ driver, in the following way:
1. Fill in ESB using EINJ hacked driver and do not clear erros status in ESB,
this way unhandler error is simulated and BERT table could be used later:
root@localhost:~# echo 1 > /sys/kernel/debug/apei/einj/error_inject
2. Reboot machin and check whether BERT driver notice injected error:
...
[ 2.518179] [Hardware Error]: Error record from previous boot:
[ 2.523342] [Hardware Error]: APEI generic hardware error status
[ 2.548457] [Hardware Error]: severity: 1, fatal
[ 2.574705] [Hardware Error]: section: 0, severity: 0, recoverable
[ 2.584010] [Hardware Error]: flags: 0x00
[ 2.587937] [Hardware Error]: section_type: memory error
...
3. Kernel clear status bit so next boot would not print it again.
This is a cleaned up version of patches posted earlier by Al Stone.
I have split them into patches with attempt to make only one change
per patch.
Graeme
From: Al Stone <ahs3(a)redhat.com>
This patch adds a stub function for arch_fix_phys_package_id() for
those kernel configurations that need it.
Found while trying to build a VExpress configuration.
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
arch/arm/include/asm/topology.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h
index a6ff5cc..70d9c47 100644
--- a/arch/arm/include/asm/topology.h
+++ b/arch/arm/include/asm/topology.h
@@ -66,6 +66,7 @@ static inline void init_cpu_topology(void) { }
static inline void store_cpu_topology(unsigned int cpuid) { }
static inline int cluster_to_logical_mask(unsigned int socket_id,
cpumask_t *cluster_mask) { return -EINVAL; }
+static inline void arch_fix_phys_package_id(int num, u32 slot) { };
#endif
--
1.8.3.1
Lots of device drivers especially for platform/I2C/SPI bus devices,
they want to be initialized earlier than other devices, so the driver
use initcall such as subsys_initcall for the device initialization.
But for those drivers, lots of them just do nothing special in
xxx_initcall/module_exit, and produce lots of boilerplate.
This patch set introduces a helper macro initcall_driver() to
eliminate lots of boilerplate just like module_driver() did, and use
it for platform/I2C/SPI bus devices.
I use following command under the lastest kernel source code:
$grep -r -E "*_initcall" drivers/ | cut -d":" -f1 |xargs grep -E
"return platform_driver_register|return i2c_add_driver|return spi_register_driver"
| cut -d":" -f1 | xargs grep "module_exit" | wc -l
and get 205 hits, so if we use helper macro initcall_driver(),
we can reduce thousands lines of code.
Hanjun Guo (4):
driver core: introduce helper macro initcall_driver()
platform device: introduce helper macro initcall_platform_driver()
i2c: introduce helper macro initcall_i2c_driver()
spi: introduce helper macro initcall_spi_driver()
include/linux/device.h | 27 +++++++++++++++++++++++++++
include/linux/i2c.h | 11 +++++++++++
include/linux/platform_device.h | 11 +++++++++++
include/linux/spi/spi.h | 11 +++++++++++
4 files changed, 60 insertions(+)
--
1.7.9.5
hi,
The patches in the series are just in work in progress and intended to clear
some doubts as pointed below. Any comment/direction is helpful from the linaro
acpi group.
1) Basic controllers like GIC and timer need to be initialised before platform drivers
are ready so question is how to invoke the __init of these devices. Is there any function
to raw parse the ACPI tables similar to existing DT API's?
2) Some important elements like clock frequency is missing from the GTDT table.
how to get them?
Thanks in advance.
Amit Daniel Kachhap (3):
irqdomain: Add a new API irq_create_default_mapping
ACPI: ARM: Update acpi_register_gsi to register with the core IRQ
subsystem
ACPI: clocksource: arch_timer: Use GTDT table to gather data
drivers/acpi/plat/arm/boot.c | 27 ++++++++++++++--
drivers/clocksource/arm_arch_timer.c | 58 ++++++++++++++++++++++++++++++++++
include/linux/irqdomain.h | 2 +
kernel/irq/irqdomain.c | 35 ++++++++++++++++++++
4 files changed, 119 insertions(+), 3 deletions(-)
This patch set just did one simple thing: convert to module_platform_driver()
in video driver to simplify the code.
Hanjun Guo (10):
Video / hecubafb: Use module_platform_driver() to simplify code
Video / bfin-t350mcqb-fb: Use module_platform_driver() to simplify
code
Video / metronomefb: Use module_platform_driver() to simplify code
Video / jz4740_fb: Use module_platform_driver() to simplify code
Video / da8xx-fb: Use module_platform_driver() to simplify code
Video / cobalt_lcdfb: Use module_platform_driver() to simplify code
Video / broadsheetfb: Use module_platform_driver() to simplify code
Video / bf54x-lq043fb: Use module_platform_driver() to simplify code
Video / au1200fb: Use module_platform_driver() to simplify code
Video / au1100fb: Use module_platform_driver() to simplify code
drivers/video/au1100fb.c | 14 +-------------
drivers/video/au1200fb.c | 16 +---------------
drivers/video/bf54x-lq043fb.c | 14 +-------------
drivers/video/bfin-t350mcqb-fb.c | 14 +-------------
drivers/video/broadsheetfb.c | 14 +-------------
drivers/video/cobalt_lcdfb.c | 14 +-------------
drivers/video/da8xx-fb.c | 14 +-------------
drivers/video/hecubafb.c | 14 +-------------
drivers/video/jz4740_fb.c | 13 +------------
drivers/video/metronomefb.c | 14 +-------------
10 files changed, 10 insertions(+), 131 deletions(-)
--
1.7.9.5
In acpi_bus_register_driver(), there is an if (acpi_disabled) check,
so the if(acpi_disabled) before it is reduplicate, remove it.
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
drivers/staging/quickstart/quickstart.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/staging/quickstart/quickstart.c b/drivers/staging/quickstart/quickstart.c
index 4247d60..9f6ebdb 100644
--- a/drivers/staging/quickstart/quickstart.c
+++ b/drivers/staging/quickstart/quickstart.c
@@ -390,10 +390,6 @@ static int __init quickstart_init(void)
{
int ret;
- /* ACPI Check */
- if (acpi_disabled)
- return -ENODEV;
-
/* ACPI driver register */
ret = acpi_bus_register_driver(&quickstart_acpi_driver);
if (ret)
--
1.7.9.5
"APIC" should be "ACPI" here.
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
drivers/acpi/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index fbdb82e..611ce90 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1121,7 +1121,7 @@ int acpi_bus_register_driver(struct acpi_driver *driver)
EXPORT_SYMBOL(acpi_bus_register_driver);
/**
- * acpi_bus_unregister_driver - unregisters a driver with the APIC bus
+ * acpi_bus_unregister_driver - unregisters a driver with the ACPI bus
* @driver: driver to unregister
*
* Unregisters a driver with the ACPI bus. Searches the namespace for all
--
1.7.9.5
From: Al Stone <ahs3(a)redhat.com>
This series of patches first sets up the efi_map_regions()
function, which is in turn used by setup_arch() to initialize
ACPI tables loaded from RAM. For this to work properly, there
were bugs to be fixed in both the EFI and ACPI code; these
fixes get the two to agree on where the ACPI data is in RAM,
and how it is to be addressed at early boot.
Al Stone (4):
ARM: EFI: make efi_remap_regions() visible for use in setup_arch()
ARM: ACPI: insert WARN_ON to make error condition more obvious
ARM: clean up the io.h header file
ACPI: ARM: use the correct ioremap sequence when loading and using
ACPI data
arch/arm/include/asm/efi.h | 1 +
arch/arm/include/asm/io.h | 9 ++-------
arch/arm/kernel/efi.c | 31 +++++++++++++++++++++++--------
arch/arm/kernel/setup.c | 9 ++++++---
drivers/acpi/acpica/tbxface.c | 1 +
drivers/acpi/osl.c | 12 ++++++------
drivers/acpi/plat/arm/boot.c | 19 +++++++------------
include/linux/acpi.h | 2 +-
include/linux/acpi_io.h | 4 ++++
9 files changed, 51 insertions(+), 37 deletions(-)
--
1.8.3.1
This patch set convert PMU driver to ACPI for ARMv8 arch. Despite driver is
initialized in early boot stage, no ACPI related actions are taken then. All PMU
resources coming from ACPI tables are use by others units once bus is enumerated.
Changes for v2:
- remove MODULE_DEVICE_TABLE macro since perf_event is not kernel module
Tomasz Nowicki (3):
ACPI, ARMv8: Whitelist armv8-pmu driver for ACPI.
armv8, dts: Move device resources to DSTD ACPI table.
armv8, pmu: Add the match table and pointers for ACPI probing to the
driver.
arch/arm64/boot/dts/foundation-v8-acpi.dts | 4 ++++
arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts | 4 ++++
arch/arm64/kernel/perf_event.c | 13 +++++++++++++
drivers/acpi/acpi_platform.c | 1 +
4 files changed, 22 insertions(+)
--
1.7.9.5
On hardware reduced platforms, there is no support for the following:
- PM Event and Control registers
- SCI interrupt (and handler)
- Fixed Events
- General Purpose Events (GPEs)
- Global Lock
- ACPI PM timer
- FACS table (Waking vectors and Global Lock)
acpi_gbl_reduced_hardware is a global flag and can be used to prevent
misbehavior on hardware reduced platforms, and this flag is initialized at
the very beginning of the system boot when FADT is parsed, this flag is set
to 1 when the FACP Hardware Reduced flag is set, so we can use it to prevent
accessing registers which do not exist on reduced hardware platform.
but when FACP Hardware Reduced flag is set, ACPI drivers will still access
some registers directly which do not exist on reduced hardware platform
and cause boot failure:
[ 9.024370] Unable to handle kernel paging request at virtual address ffffffbffbe00001
[ 9.024423] pgd = ffffffc00007d000
[ 9.024468] [ffffffbffbe00001] *pgd=000000008007f003, *pmd=0000000000000000
[ 9.024538] Internal error: Oops: 96000006 [#1] SMP
[ 9.024577] Modules linked in:
[ 9.024627] CPU: 0 Not tainted (3.9.0+ #3)
[ 9.024691] PC is at acpi_os_read_port+0x58/0xc8
[ 9.024753] LR is at acpi_hw_read_port+0x4c/0xc4
[ 9.024810] pc : [<ffffffc0002810cc>] lr : [<ffffffc0002a4fc4>] pstate: 600003c5
....
[ 9.031956] Call trace:
[ 9.032021] [<ffffffc0002810cc>] acpi_os_read_port+0x58/0xc8
[ 9.032094] [<ffffffc0002a4fc4>] acpi_hw_read_port+0x4c/0xc4
[ 9.032165] [<ffffffc0002a4198>] acpi_hw_read+0x6c/0x100
[ 9.032237] [<ffffffc0002a4250>] acpi_hw_read_multiple+0x24/0x70
[ 9.032312] [<ffffffc0002a457c>] acpi_hw_register_read+0xa8/0x164
[ 9.032386] [<ffffffc0002a52dc>] acpi_write_bit_register+0x9c/0x194
[ 9.032472] [<ffffffc0002bffb4>] acpi_processor_get_power_info+0x6c4/0x748
[ 9.032550] [<ffffffc000565220>] acpi_processor_power_init+0xac/0x138
[ 9.032630] [<ffffffc0003f3c00>] acpi_processor_start+0x48/0x138
[ 9.032704] [<ffffffc000565118>] acpi_processor_add+0x43c/0x498
[ 9.032784] [<ffffffc000283a74>] acpi_device_probe+0x3c/0x198
[ 9.032862] [<ffffffc0002ef0fc>] driver_probe_device+0x90/0x348
[ 9.032940] [<ffffffc0002ef450>] __driver_attach+0x9c/0xa0
[ 9.033015] [<ffffffc0002ed40c>] bus_for_each_dev+0x4c/0x8c
[ 9.033090] [<ffffffc0002eeb98>] driver_attach+0x20/0x28
[ 9.033166] [<ffffffc0002ee6e0>] bus_add_driver+0xfc/0x254
[ 9.033244] [<ffffffc0002ef8b0>] driver_register+0x6c/0x184
[ 9.033325] [<ffffffc000284894>] acpi_bus_register_driver+0x34/0x44
[ 9.033400] [<ffffffc000559c60>] acpi_processor_init+0x28/0x40
[ 9.033469] [<ffffffc000081438>] do_one_initcall+0x100/0x138
[ 9.033544] [<ffffffc0005448c8>] kernel_init_freeable+0x128/0x1cc
[ 9.033620] [<ffffffc0003f2f90>] kernel_init+0x10/0xcc
[ 9.033700] Code: d2bf7c02 f2dff7e2 f2ffffe2 8b020000 (79400000)
[ 9.033843] ---[ end trace 64376967e6bc20a9 ]---
[ 9.033995] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
So acpi_gbl_reduced_hardware should be used to check if reduced hardware or
not, if it is reduced hardware, just return with some error and do not access
the no-existent registers.
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
drivers/acpi/acpica/hwregs.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index 8d2e866..4c270c3 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -265,6 +265,11 @@ acpi_status acpi_hw_clear_acpi_status(void)
ACPI_FUNCTION_TRACE(hw_clear_acpi_status);
+ /* If Hardware Reduced flag is set, there are no GPEs */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %8.8X%8.8X\n",
ACPI_BITMASK_ALL_FIXED_STATUS,
ACPI_FORMAT_UINT64(acpi_gbl_xpm1a_status.address)));
@@ -305,6 +310,10 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
{
ACPI_FUNCTION_ENTRY();
+ if (acpi_gbl_reduced_hardware) {
+ return (NULL);
+ }
+
if (register_id > ACPI_BITREG_MAX) {
ACPI_ERROR((AE_INFO, "Invalid BitRegister ID: 0x%X",
register_id));
@@ -337,6 +346,11 @@ acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control)
ACPI_FUNCTION_TRACE(hw_write_pm1_control);
+ /* If Hardware Reduced flag is set, there are no PM Control registers */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
status =
acpi_hw_write(pm1a_control, &acpi_gbl_FADT.xpm1a_control_block);
if (ACPI_FAILURE(status)) {
@@ -370,6 +384,11 @@ acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value)
ACPI_FUNCTION_TRACE(hw_register_read);
+ /* If Hardware Reduced flag is set, there are no PM Control registers */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
switch (register_id) {
case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
@@ -465,6 +484,11 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
ACPI_FUNCTION_TRACE(hw_register_write);
+ /* If Hardware Reduced flag is set, there are no PM Control registers */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
switch (register_id) {
case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
/*
--
1.7.9.5
From: Al Stone <ahs3(a)redhat.com>
The first two versions of this patch set were in different submissions.
The primary difference with this version is that I've combined and
simplified the multiple sets into one comprehensive set, cleaned up
the ordering of the patches, and made corrections based on feedback
on v2.
The intent of this patch set is to enable the Arndale pinctrl devices
under ACPI instead of FDT. The ACPI ASL has been submitted as a
separate patch set. This patch set includes three of the four devices
defined for Arndale. The final device defines GPIO interrupts which
will be the subject of a later patch set (interrupts require a diversion
into enabling GICs first).
NB: the first two patches are generic and can apply to all ACPI
branches. The remainder are specific to Arndale and the acpi-ltfixes
branch.
Al Stone (8):
ACPI: make an error message a little cleaner
ACPI: improve acpi_extract_package() utility
ACPI: ARM: arndale: enable ACPI in the Samsung pinctrl driver
ACPI: ARM: arndale: add CONFIG_ACPI ifdefs to pinctrl driver
ACPI: ARM: arndale: move pin controller 4 of 4 from FDT to ACPI
ACPI: ARM: arndale: move pin controller 3 of 4 from FDT to ACPI
ACPI: ARM: arndale: move pin controller 2 of 4 from FDT to ACPI
ACPI: ARM: arndale: whitelist the samsung-pinctrl driver for ACPI
arch/arm/boot/dts/exynos5250-arndale.dts | 26 ++
arch/arm/boot/dts/exynos5250-pinctrl.dtsi | 2 +
arch/arm/boot/dts/exynos5250.dtsi | 6 +-
drivers/acpi/acpi_platform.c | 3 +
drivers/acpi/osl.c | 2 +-
drivers/acpi/utils.c | 17 +-
drivers/pinctrl/pinctrl-samsung.c | 513 +++++++++++++++++++++++++++++-
drivers/pinctrl/pinctrl-samsung.h | 3 +
8 files changed, 559 insertions(+), 13 deletions(-)
--
1.8.3.1
EINJ table is fully implemented in kernel and no changes were needed
to bring it up on armv7/8 arch.
Along with work on EINJ coulpe of steps were done like:
1. Expand bfapei tool so it can create blob which pretend h/w registers
for EINJ driver.
2. Filling address in EINJ table according to those in blob.
3. Trigger error using existing injection kernel mechanism.
See commit for more details.
Tomasz Nowicki (3):
bfapei: Move common functionality to separate function.
bfapei: Expand bfapei tool to EINJ table testing.
acpi, apei, einj: Fill in EINJ table according to address in EINJ
blobs.
platforms/exynos5250-arndale.acpi/einj.asl | 20 +++---
platforms/foundation-v8.acpi/einj.asl | 20 +++---
platforms/rtsm_ve-aemv8a.acpi/einj.asl | 20 +++---
tools/bfapei/bfapei.c | 101 ++++++++++++++++++++++------
tools/bfapei/bfapei.h | 30 +++++++--
tools/common/include/acpi.h | 57 ++++++++++++++++
6 files changed, 192 insertions(+), 56 deletions(-)
--
1.7.9.5
This patch set convert PMU driver to ACPI for ARMv8 arch. Despite driver is
initialized in early boot stage, no ACPI related actions are taken then. All PMU
resources coming from ACPI tables are use by others units once bus is enumerated.
Tomasz Nowicki (3):
ACPI, ARMv8: Whitelist armv8-pmu driver for ACPI.
armv8, dts: Move device resources to DSTD ACPI table.
armv8, pmu: Add the match table and pointers for ACPI probing to the
driver.
arch/arm64/boot/dts/foundation-v8-acpi.dts | 4 ++++
arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts | 4 ++++
arch/arm64/kernel/perf_event.c | 14 ++++++++++++++
drivers/acpi/acpi_platform.c | 1 +
4 files changed, 23 insertions(+)
--
1.7.9.5
ACPI spec define that devices can be notified with some well
defined values. Handlers from system list are called for
notify values within 0-0x7F. In turn, handlers from device list
are called for notify value greater than 0x80. Till now only system
handler could be called. Now we are able to notify devices with all
notify values range that means we can emulate SCI line e.g. to trigger
APCI errors.
Signed-off-by: Tomasz Nowicki <tomasz.nowicki(a)linaro.org>
---
drivers/acpi/sci_emu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/sci_emu.c b/drivers/acpi/sci_emu.c
index 2f13ca1..08af8e9 100644
--- a/drivers/acpi/sci_emu.c
+++ b/drivers/acpi/sci_emu.c
@@ -55,7 +55,10 @@ static void sci_notify_client(char *acpi_name, u32 event)
*/
obj_desc = acpi_ns_get_attached_object(node);
if (obj_desc) {
- if (obj_desc->common_notify.notify_list[0]) {
+ if (((event <= ACPI_MAX_SYS_NOTIFY) &&
+ obj_desc->common_notify.notify_list[ACPI_SYSTEM_HANDLER_LIST]) ||
+ (((event > ACPI_MAX_SYS_NOTIFY) &&
+ obj_desc->common_notify.notify_list[ACPI_DEVICE_HANDLER_LIST]))) {
/*
* Release the lock and queue the item for later
* exectuion
--
1.7.9.5
From: Mark Rutland <mark.rutland(a)arm.com>
We currently do an ldr from GICC_CTLR to w0, then immediately overwrite
w0 with a mov. Reading the GICC_CTLR has no effect on the state of the
GIC, so there's no reason to do the ldr. It's also inconsistent with the
way we set the GICD_CTLR.
Fix this.
Signed-off-by: Mark Rutland <mark.rutland(a)arm.com>
---
boot.S | 1 -
1 file changed, 1 deletion(-)
diff --git a/boot.S b/boot.S
index a1f25e2..7c28e84 100644
--- a/boot.S
+++ b/boot.S
@@ -49,7 +49,6 @@ _start:
str w0, [x1], #4
2: ldr x1, =GIC_CPU_BASE // GICC_CTLR
- ldr w0, [x1]
mov w0, #3 // EnableGrp0 | EnableGrp1
str w0, [x1]
--
1.7.9.5
On hardware reduced platforms, there is no support for the following:
- PM Event and Control registers
- SCI interrupt (and handler)
- Fixed Events
- General Purpose Events (GPEs)
- Global Lock
- ACPI PM timer
- FACS table (Waking vectors and Global Lock)
but when FACP Hardware Reduced flag is set, ACPI drivers will still access
power management registers directly which will cause oops when system booted.
acpi_gbl_reduced_hardware is a global flag and can be used to prevent
misbehavior on hardware reduced platforms, and this flag is initialized at
the very beginning of the system boot when FADT is parsed, so we can use it
to prevent accessing PM registers.
There are still lots of other places to be fixed, this is the first patch
to fix hte bug we met when --cores=1;
I will finish a patch set and send to upstream if you guys have no
objections. I think we should start a discussion in ACPI mail list for
this bug on hardware reduced platforms now.
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
drivers/acpi/acpica/hwregs.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index 8d2e866..4c270c3 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -265,6 +265,11 @@ acpi_status acpi_hw_clear_acpi_status(void)
ACPI_FUNCTION_TRACE(hw_clear_acpi_status);
+ /* If Hardware Reduced flag is set, there are no GPEs */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %8.8X%8.8X\n",
ACPI_BITMASK_ALL_FIXED_STATUS,
ACPI_FORMAT_UINT64(acpi_gbl_xpm1a_status.address)));
@@ -305,6 +310,10 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
{
ACPI_FUNCTION_ENTRY();
+ if (acpi_gbl_reduced_hardware) {
+ return (NULL);
+ }
+
if (register_id > ACPI_BITREG_MAX) {
ACPI_ERROR((AE_INFO, "Invalid BitRegister ID: 0x%X",
register_id));
@@ -337,6 +346,11 @@ acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control)
ACPI_FUNCTION_TRACE(hw_write_pm1_control);
+ /* If Hardware Reduced flag is set, there are no PM Control registers */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
status =
acpi_hw_write(pm1a_control, &acpi_gbl_FADT.xpm1a_control_block);
if (ACPI_FAILURE(status)) {
@@ -370,6 +384,11 @@ acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value)
ACPI_FUNCTION_TRACE(hw_register_read);
+ /* If Hardware Reduced flag is set, there are no PM Control registers */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
switch (register_id) {
case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
@@ -465,6 +484,11 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
ACPI_FUNCTION_TRACE(hw_register_write);
+ /* If Hardware Reduced flag is set, there are no PM Control registers */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
switch (register_id) {
case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
/*
--
1.7.9.5
Hi,
Update from my side:
- have got invitation letter to US Connect
- run ACPI kernel on RTSMv8 model, environment preparation
- now working on converting PMU driver to ACPI
Tomasz
Values set within all APEI tables have no hardware meaning and
are valid combining with kernel hacks. These changes allow only
to confirm that APEI tables (HEST, ERST, BERT) are supported by
kernel and no issues were observed on arm/arm64 architectures.
Tomasz Nowicki (6):
acpi, apei, ghes: Enable APEI firmware first mode by APEI bit.
acpi, apei, hed: Add Hardware Error Device (HED) to SB bus.
acpi, apei, einj: Fill ACPI tables to enable EINJ driver.
acpi, apei: Fix EINJ and HEST tables.
acpi, apei, bert: Point to the same error block status memory region
as HEST points.
acpi, apei, erst: Point to region where we can pretend registers,
persistent sotrage.
platforms/exynos5250-arndale.acpi/bert.asl | 4 +-
platforms/exynos5250-arndale.acpi/dsdt.asl | 27 +++++
platforms/exynos5250-arndale.acpi/einj.asl | 2 +-
platforms/exynos5250-arndale.acpi/erst.asl | 34 +++----
platforms/exynos5250-arndale.acpi/hest.asl | 148 +---------------------------
platforms/foundation-v8.acpi/bert.asl | 4 +-
platforms/foundation-v8.acpi/dsdt.asl | 27 +++++
platforms/foundation-v8.acpi/einj.asl | 2 +-
platforms/foundation-v8.acpi/erst.asl | 34 +++----
platforms/foundation-v8.acpi/hest.asl | 148 +---------------------------
10 files changed, 98 insertions(+), 332 deletions(-)
--
1.7.9.5
From: Al Stone <ahs3(a)redhat.com>
I should have sent these out for comment much sooner. Once these are
in good shape, the next steps are to send patches for verifying that
the pinconf code is working properly, connecting up the GPIO interrupts
using ACPI, and then conversion of all of the pin controllers for
Arndale (this patch converts one of four).
This patch puts most of the infrastructure in place so that in the
3.11 kernel the Arndale pin controllers can be converted from FDT to
ACPI. The changes in ASL are included in a separate patch. What this
allows is for the pin controllers to be described in either FDT or ACPI
for Arndale and -- in conjunction with the ASL changes -- shows how to
describe a Samsung controller in ACPI.
Changes for v2:
-- Add patch 6 which allows compilation regardless of whether
CONFIG_ACPI is used or not
Al Stone (6):
ACPI: ARM: arndale: remove GPZ GPIO definition from DT so it can be in
ACPI
ACPI: ARM: arndale: whitelist the samsung-pinctrl driver for ACPI
ACPI: make an error message a little clearer
ACPI: improve acpi_extract_package() utility
ACPI: ARM: arndale: enable ACPI in the Samsung pinctrl driver
ACPI: ARM: arndale: add CONFIG_ACPI ifdef's to pinctrl driver
arch/arm/boot/dts/exynos5250-pinctrl.dtsi | 2 +
arch/arm/boot/dts/exynos5250.dtsi | 6 +-
drivers/acpi/acpi_platform.c | 3 +
drivers/acpi/osl.c | 2 +-
drivers/acpi/utils.c | 17 +-
drivers/pinctrl/pinctrl-samsung.c | 517 +++++++++++++++++++++++++++++-
drivers/pinctrl/pinctrl-samsung.h | 3 +
7 files changed, 536 insertions(+), 14 deletions(-)
--
1.8.3.1
This patch set is the kernel part of code for cpu hotplug.
I got a patch in upstream but not accepted by mainline, this patch
emulate an ACPI SCI interrupt to emulate a hot-plug event. Useful
for testing ACPI based hot-plug on systems that don't have the
necessary firmware support. With this patch, I can test the hot-add
and hot-remove repeatly.
This patch set is intended to close the cpu hotplug related cards
in JIRA, just for review purpose, *should not* pushed to our linaro
acpi.
I have created an acpi-hotplug-next branch in our git tree for these
patches.
This patch set includes 3 parts, the forst part is the kernel code,
and the second is the ASL code fix, the third part is the boot wrapper.
Hanjun Guo (4):
Revert "ARM64 / CPU hot-plug: Skeleton logic cpu online/offline for
cpu hot-plug"
ACPI: Enable SCI_EMULATE to manually simulate physical hotplug
testing
arm / ACPI: Remove __cpuinit and fix __init attribute location
arm: fix cpu hot add failure
Mark Rutland (6):
arm64: reorganise smp_enable_ops
arm64: factor out spin-table boot method
arm64: read enable-method for CPU0
arm64: add CPU_HOTPLUG infrastructure
arm64: add PSCI CPU_OFF-based hotplug support
HACK: arm64: dts: foundation: add PSCI data
arch/arm64/Kconfig | 2 +-
arch/arm64/boot/dts/foundation-v8.dts | 19 +--
arch/arm64/include/asm/irq.h | 1 +
arch/arm64/include/asm/smp.h | 46 +++++--
arch/arm64/kernel/cputable.c | 2 +-
arch/arm64/kernel/head.S | 12 +-
arch/arm64/kernel/irq.c | 61 +++++++++
arch/arm64/kernel/process.c | 7 ++
arch/arm64/kernel/smp.c | 222 ++++++++++++++++++---------------
arch/arm64/kernel/smp_psci.c | 54 ++++++--
arch/arm64/kernel/smp_spin_table.c | 85 ++++++++++++-
arch/arm64/kernel/vmlinux.lds.S | 1 -
drivers/acpi/Kconfig | 10 ++
drivers/acpi/Makefile | 1 +
drivers/acpi/plat/arm/boot.c | 20 +--
drivers/acpi/sci_emu.c | 145 +++++++++++++++++++++
16 files changed, 538 insertions(+), 150 deletions(-)
create mode 100644 drivers/acpi/sci_emu.c
--
1.7.9.5
From: Al Stone <ahs3(a)redhat.com>
The first two patches in this series have been submitted before;
this series just combines all of the Arndale GPIO changes so far.
The last of the three converts yet another GPIO device to ACPI.
All that remains is to convert the final controller. To make that
work, the GIC and GIC combiner will need to work first and that I'm
still investigating.
Al Stone (3):
ACPI: ARM: arndale: move definition of GPZ GPIO from DT to ACPI
ACPI: ARM: arndale: convert GPIO controller 3 of 4 to ACPI
ACPI: ARM: arndale: convert GPIO controller 2 of 4 to ACPI
platforms/exynos5250-arndale.acpi/ssdt0.asl | 554 +++++++++++++++++++++++++++-
1 file changed, 553 insertions(+), 1 deletion(-)
--
1.8.3.1
Hi everyone,
I read the wiki about ACPI Table Prioritization:
https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/TablePriorities
and I noticed that CSRT is in the *Never Tables* priority, here I got
some different opinions.
Yes, CSRT or Core System Resources Table is a proprietary ACPI table
introduced by Microsoft, but This table can contain devices that are not in
the system DSDT table. In particular DMA controllers, Timer, interrupt might
be described here.
we can get DMA description from DMAR (DMA Remapping Table) tables on Intel platform,
but on ARM SoCs, there is no table to describe DMA, only CSRT is available.
Actually, the support code of CSRT in Linux kernel already have submitted
by Intel on Jan 17 this year, but only DMA is supported, still have something
more to do (if needed).
So, why not use the CSRT table to describe DMA?
Thanks
Hanjun
v1->v2: Return specific error value instead of just return -1, and
correct some grammar mistake in changelog.
For cpu hot add, evaluate _MAT or parse MADT will did twice to get
APIC id:
acpi_processor_add()
acpi_processor_get_info()
acpi_get_cpuid() will evaluate _MAT or parse MADT;
acpi_processor_hotadd_init()
acpi_map_lsapic() will evaluate _MAT again;
This patch set introduces apic_id in struct processor to save parsed
APIC id, and use it to remove the duplicated _MAT evaluation.
Further more, the new logical cpu number will be generated in
acpi_register_lapic(), this can be returned to remove the cpumask
allocation and operation to simplify _acpi_map_lsapic().
There are also some cleanups for the ACPI processor dirver code.
Hanjun Guo (2):
ACPI / processor: remove unnecessary if (!pr) check
ACPI / processor: Remove outdated comments
Jiang Liu (4):
ACPI / processor: Introduce apic_id in struct processor to save
parsed APIC id
ACPI / processor: use apic_id and remove duplicated _MAT evaluation
x86 / ACPI: simplify _acpi_map_lsapic()
ACPI / processor: remove some dead code in acpi_processor_get_info()
arch/ia64/kernel/acpi.c | 38 ++----------------
arch/x86/include/asm/mpspec.h | 2 +-
arch/x86/kernel/acpi/boot.c | 88 +++++++++--------------------------------
arch/x86/kernel/apic/apic.c | 8 ++--
drivers/acpi/acpi_processor.c | 22 +++--------
drivers/acpi/processor_core.c | 26 +++++++++---
include/acpi/processor.h | 3 ++
include/linux/acpi.h | 2 +-
8 files changed, 60 insertions(+), 129 deletions(-)
--
1.7.9.5
From: Al Stone <ahs3(a)redhat.com>
This adds another GPIO/pinctrl device to Arndale. In the process,
logic errors in the portions of the Samsung pinctrl driver that
were using ACPI were weeded out.
Al Stone (2):
ACPI: ARM: arndale: move GPIO controller 3 of 4 from FDT to ACPI
ACPI: ARM: arndale: Enable pinctrl for configuring many controllers
via ACPI
arch/arm/boot/dts/exynos5250-arndale.dts | 26 +++++++++++++++
arch/arm/boot/dts/exynos5250-pinctrl.dtsi | 2 +-
arch/arm/boot/dts/exynos5250.dtsi | 6 ++--
drivers/pinctrl/pinctrl-samsung.c | 53 ++++++++++++++++---------------
4 files changed, 59 insertions(+), 28 deletions(-)
--
1.8.3.1