This patch set is introducing ARM64 PCI hostbridge init based on ACPI,
which based on Jiang Liu's patch set "Consolidate ACPI PCI root common
code into ACPI core":
https://lkml.org/lkml/2015/5/14/98
This patch set including three parts:
- the first part is PATCH 1, which should be merged into Jiang Liu's
patch set to fix the compile error on ARM64 when ACPI enabled.
- the senconed part is the refactoring of mmconfig to let that mechanism
can be used for ARM64 too, it's Tomasz's work but he is moving to other
work and pretty busy for now, so I will take care of those patches,
Tomasz will show up when some comments need to be addressed :)
In this version of mmconfig refactor patches, I removed the rename
of mmconfig -> ecam patch, because mmconfig is in multi places, and need
much more effort to convert them all to ecam, Bjorn, if you don't
like it, I can add them back.
- The third part is about the ARM64 PCI hostbridge init based on ACPI,
first I fixed a compile error for XEN PCI on ARM64 when PCI_MMCONFIG=y,
and then introduce PCI init based on Jiang Liu and Tomasz's patch set.
patch for ARM64 ACPI PCI still reserve the bus sysdata to get the domain
number, because Yijing's patch set is still under review, will be removed
when Yijing's patch set hits upstream.
This patch set was tested by Suravee on Seattle board with legacy interrupt
(not MSI), and it works, also tested on qemu by Graeme.
You can get the code from:
git://git.linaro.org/leg/acpi/acpi.git, devel branch
Comments are welcomed.
Thanks
Hanjun
Hanjun Guo (3):
ARM64 / PCI: introduce struct pci_controller for ACPI
XEN / PCI: Remove the dependence on arch x86 when PCI_MMCONFIG=y
ARM64 / PCI / ACPI: support for ACPI based PCI hostbridge init
Tomasz Nowicki (8):
x86, pci: Clean up comment about buggy MMIO config space access for
AMD Fam10h CPUs.
x86, pci: Abstract PCI config accessors and use AMD Fam10h workaround
exclusively.
x86, pci: Reorder logic of pci_mmconfig_insert() function
x86, pci, acpi: Move arch-agnostic MMCONFIG (aka ECAM) and ACPI code
out of arch/x86/ directory
pci, acpi, mcfg: Provide generic implementation of MCFG code
initialization.
x86, pci: mmconfig_{32,64}.c code refactoring - remove code
duplication.
x86, pci, ecam: mmconfig_64.c becomes default implementation for ECAM
driver.
pci, acpi, mcfg: Share ACPI PCI config space accessors.
arch/arm64/Kconfig | 7 +
arch/arm64/include/asm/pci.h | 10 ++
arch/arm64/kernel/pci.c | 245 ++++++++++++++++++++++++++--
arch/x86/Kconfig | 4 +
arch/x86/include/asm/pci_x86.h | 34 +---
arch/x86/pci/Makefile | 4 +-
arch/x86/pci/acpi.c | 1 +
arch/x86/pci/mmconfig-shared.c | 301 +++++++++++-----------------------
arch/x86/pci/mmconfig_32.c | 35 +---
arch/x86/pci/mmconfig_64.c | 153 ------------------
arch/x86/pci/numachip.c | 25 +--
drivers/acpi/Makefile | 1 +
drivers/acpi/mcfg.c | 103 ++++++++++++
drivers/pci/Kconfig | 10 ++
drivers/pci/Makefile | 5 +
drivers/pci/ecam.c | 358 +++++++++++++++++++++++++++++++++++++++++
drivers/pci/pci.c | 26 +--
drivers/xen/pci.c | 7 +-
include/linux/acpi.h | 2 +
include/linux/ecam.h | 56 +++++++
20 files changed, 923 insertions(+), 464 deletions(-)
delete mode 100644 arch/x86/pci/mmconfig_64.c
create mode 100644 drivers/acpi/mcfg.c
create mode 100644 drivers/pci/ecam.c
create mode 100644 include/linux/ecam.h
--
1.9.1
This patch set introduce self-probe infrastructure to init IRQ
controllers and stacked irqdomain support for ACPI based GICv2/3
init.
The self-probe infrastructure for ACPI GIC init is similar as
IRQCHIP_DECLARE() and based on the GIC version support in ACPI
MADT table.
We introduce acpi_irq_domain for GICv2/3 core domain to support
stacked irqdomain, and pass the gsi (global system interrupt) as
the agument (void *arg) for gic_irq_domain_alloc(), then we can
alloc virqs via acpi_register_gsi() with stacked irqdomain.
In order to make ACPI related GIC init code slef-contained, I
consolidated all the GIC init code into drivers/irqchip/irq-gic-acpi.c.
update from RFC version:
- Consolidate all the GIC init code into drivers/irqchip/irq-gic-acpi.c
Hanjun Guo (8):
irqchip / GIC: Add GIC version support in ACPI MADT
irqchip / GIC / ACPI: Use IRQCHIP_ACPI_DECLARE to simplify GICv2 init
code
irqchip / gic: Add stacked irqdomain support for ACPI based GICv2 init
ACPI / gsi: Add gsi_mutex to synchronize
acpi_register_gsi()/acpi_unregister_gsi()
irqchip / GICv3: Add ACPI support for GICv3+ initialization
irqchip / GICv3: Add stacked irqdomain support for ACPI based init
irqchip / GICv2 / ACPI: Consolidate GICv2 ACPI related init code
irqchip / GICv3 / ACPI: Consolidate GICv3 ACPI related init code
Tomasz Nowicki (3):
ACPICA: Introduce GIC version for arm based system
ACPI / irqchip: Add self-probe infrastructure to initialize IRQ
controller
irqchip / GICv3: Refactor gic_of_init() for GICv3 driver
arch/arm64/Kconfig | 1 +
arch/arm64/include/asm/irq.h | 13 --
arch/arm64/kernel/acpi.c | 25 ---
drivers/acpi/Makefile | 1 +
drivers/acpi/gsi.c | 41 +++--
drivers/acpi/irq.c | 40 +++++
drivers/irqchip/Kconfig | 3 +
drivers/irqchip/Makefile | 1 +
drivers/irqchip/irq-gic-acpi.c | 318 +++++++++++++++++++++++++++++++++++
drivers/irqchip/irq-gic-v3.c | 149 +++++++++-------
drivers/irqchip/irq-gic.c | 129 ++------------
drivers/irqchip/irqchip.h | 12 ++
include/acpi/actbl1.h | 17 +-
include/asm-generic/vmlinux.lds.h | 13 ++
include/linux/acpi.h | 14 ++
include/linux/acpi_irq.h | 4 +-
include/linux/irqchip/arm-gic-acpi.h | 13 +-
include/linux/irqchip/arm-gic-v3.h | 10 ++
include/linux/mod_devicetable.h | 7 +
19 files changed, 577 insertions(+), 234 deletions(-)
create mode 100644 drivers/acpi/irq.c
create mode 100644 drivers/irqchip/irq-gic-acpi.c
--
1.9.1
The ACPI processor driver is currently tied too closely
to the ACPI C-states (CST), P-states (PSS) and other related
constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces
alternative methods to CST and PSS. These new mechanisms
are described within each ACPI Processor object and so they
need to be scanned whenever a new Processor object is detected.
This patch introduces two new Kconfig symbols to allow for
finer configurability among the various options for controlling
CPU idle and performance states. There is no change in functionality
and these options are defaulted to enabled to maintain previous
behaviour.
The following patchwork introduces CPPC: A newer method of
controlling CPU performance. The OS is not expected to support CPPC
and PSS at runtime. So the kconfig option lets us make these two
mutually exclusive at compile time.
Signed-off-by: Ashwin Chaugule <ashwin.chaugule(a)linaro.org>
---
drivers/acpi/Kconfig | 41 +++++++++++----
drivers/acpi/Makefile | 7 +--
drivers/acpi/processor_driver.c | 85 ++++++++++++++++++++-----------
drivers/cpufreq/Kconfig | 2 +-
drivers/cpufreq/Kconfig.x86 | 2 +
include/acpi/processor.h | 109 ++++++++++++++++++++++++++++++++++------
6 files changed, 187 insertions(+), 59 deletions(-)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index ab2cbb5..d98d304 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -163,23 +163,42 @@ config ACPI_FAN
config ACPI_DOCK
bool "Dock"
help
- This driver supports ACPI-controlled docking stations and removable
- drive bays such as the IBM Ultrabay and the Dell Module Bay.
+ This driver supports ACPI-controlled docking stations and removable
+ drive bays such as the IBM Ultrabay and the Dell Module Bay.
+
+config ACPI_CST
+ bool "ACPI C states (CST) driver"
+ depends on ACPI_PROCESSOR
+ select CPU_IDLE
+ default y
+ help
+ This driver installs ACPI as the idle handler for Linux and uses
+ ACPI C2 and C3 processor states to save power on systems that
+ support it.
+
+config ACPI_PSS
+ bool "ACPI P States (PSS) driver"
+ depends on ACPI_PROCESSOR
+ select THERMAL
+ default y
+ help
+ This driver implements ACPI methods for controlling CPU performance
+ using PSS methods as described in the ACPI spec. It also enables support
+ for ACPI based performance throttling (TSS) and ACPI based thermal
+ monitoring. It is required by several flavors of cpufreq
+ performance-state drivers.
config ACPI_PROCESSOR
tristate "Processor"
- select THERMAL
- select CPU_IDLE
- depends on X86 || IA64
+ depends on X86 || IA64 || ARM64
default y
help
- This driver installs ACPI as the idle handler for Linux and uses
- ACPI C2 and C3 processor states to save power on systems that
- support it. It is required by several flavors of cpufreq
- performance-state drivers.
+ This driver adds support for the ACPI Processor package. It is required
+ by several flavors of cpufreq performance-state, thermal, throttling and
+ idle drivers.
- To compile this driver as a module, choose M here:
- the module will be called processor.
+ To compile this driver as a module, choose M here:
+ the module will be called processor.
config ACPI_IPMI
tristate "IPMI"
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 8a063e2..30b2bfc 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -82,9 +82,10 @@ obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o
obj-$(CONFIG_ACPI_BGRT) += bgrt.o
# processor has its own "processor." module_param namespace
-processor-y := processor_driver.o processor_throttling.o
-processor-y += processor_idle.o processor_thermal.o
-processor-$(CONFIG_CPU_FREQ) += processor_perflib.o
+processor-y := processor_driver.o
+processor-$(CONFIG_ACPI_CST) += processor_idle.o
+processor-$(CONFIG_ACPI_PSS) += processor_perflib.o \
+ processor_throttling.o processor_thermal.o
obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index d9f7158..f61c09b 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -163,34 +163,23 @@ static struct notifier_block __refdata acpi_cpu_notifier = {
.notifier_call = acpi_cpu_soft_notify,
};
-static int __acpi_processor_start(struct acpi_device *device)
+#ifdef CONFIG_ACPI_PSS
+static int acpi_pss_init(struct acpi_processor *pr, struct acpi_device *device)
{
- struct acpi_processor *pr = acpi_driver_data(device);
- acpi_status status;
int result = 0;
- if (!pr)
- return -ENODEV;
-
- if (pr->flags.need_hotplug_init)
- return 0;
-
-#ifdef CONFIG_CPU_FREQ
acpi_processor_ppc_has_changed(pr, 0);
-#endif
+
acpi_processor_get_throttling_info(pr);
if (pr->flags.throttling)
pr->flags.limit = 1;
- if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver)
- acpi_processor_power_init(pr);
-
pr->cdev = thermal_cooling_device_register("Processor", device,
&processor_cooling_ops);
if (IS_ERR(pr->cdev)) {
result = PTR_ERR(pr->cdev);
- goto err_power_exit;
+ return result;
}
dev_dbg(&device->dev, "registered as cooling_device%d\n",
@@ -204,6 +193,7 @@ static int __acpi_processor_start(struct acpi_device *device)
"Failed to create sysfs link 'thermal_cooling'\n");
goto err_thermal_unregister;
}
+
result = sysfs_create_link(&pr->cdev->device.kobj,
&device->dev.kobj,
"device");
@@ -213,17 +203,61 @@ static int __acpi_processor_start(struct acpi_device *device)
goto err_remove_sysfs_thermal;
}
- status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
- acpi_processor_notify, device);
- if (ACPI_SUCCESS(status))
- return 0;
-
sysfs_remove_link(&pr->cdev->device.kobj, "device");
err_remove_sysfs_thermal:
sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
err_thermal_unregister:
thermal_cooling_device_unregister(pr->cdev);
- err_power_exit:
+
+ return result;
+}
+
+static void acpi_pss_exit(struct acpi_processor *pr,
+ struct acpi_device *device)
+{
+ if (pr->cdev) {
+ sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
+ sysfs_remove_link(&pr->cdev->device.kobj, "device");
+ thermal_cooling_device_unregister(pr->cdev);
+ pr->cdev = NULL;
+ }
+}
+#else
+static inline int acpi_pss_init(struct acpi_processor *pr,
+ struct acpi_device *device)
+{
+ return 0;
+}
+
+static inline void acpi_pss_exit(struct acpi_processor *pr,
+ struct acpi_device *device) {}
+#endif /* CONFIG_ACPI_PSS */
+
+static int __acpi_processor_start(struct acpi_device *device)
+{
+ struct acpi_processor *pr = acpi_driver_data(device);
+ acpi_status status;
+ int result = 0;
+
+ if (!pr)
+ return -ENODEV;
+
+ if (pr->flags.need_hotplug_init)
+ return 0;
+
+ if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver)
+ acpi_processor_power_init(pr);
+
+ result = acpi_pss_init(pr, device);
+ if (result)
+ goto err_power_exit;
+
+ status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
+ acpi_processor_notify, device);
+ if (ACPI_SUCCESS(status))
+ return 0;
+
+err_power_exit:
acpi_processor_power_exit(pr);
return result;
}
@@ -252,15 +286,10 @@ static int acpi_processor_stop(struct device *dev)
pr = acpi_driver_data(device);
if (!pr)
return 0;
-
acpi_processor_power_exit(pr);
- if (pr->cdev) {
- sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
- sysfs_remove_link(&pr->cdev->device.kobj, "device");
- thermal_cooling_device_unregister(pr->cdev);
- pr->cdev = NULL;
- }
+ acpi_pss_exit(pr, device);
+
return 0;
}
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index 659879a..2f36e2a 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -223,7 +223,7 @@ endif
if IA64
config IA64_ACPI_CPUFREQ
tristate "ACPI Processor P-States driver"
- depends on ACPI_PROCESSOR
+ depends on ACPI_PROCESSOR && ACPI_PSS && ACPI_CST
help
This driver adds a CPUFreq driver which utilizes the ACPI
Processor Performance States.
diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86
index c59bdcb..ee285a8 100644
--- a/drivers/cpufreq/Kconfig.x86
+++ b/drivers/cpufreq/Kconfig.x86
@@ -18,6 +18,7 @@ config X86_INTEL_PSTATE
config X86_PCC_CPUFREQ
tristate "Processor Clocking Control interface driver"
depends on ACPI && ACPI_PROCESSOR
+ depends on ACPI_PSS && ACPI_CST
help
This driver adds support for the PCC interface.
@@ -32,6 +33,7 @@ config X86_PCC_CPUFREQ
config X86_ACPI_CPUFREQ
tristate "ACPI Processor P-States driver"
depends on ACPI_PROCESSOR
+ depends on ACPI_PSS && ACPI_CST
help
This driver adds a CPUFreq driver which utilizes the ACPI
Processor Performance States.
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 4188a4d..659edd6 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -222,16 +222,6 @@ struct acpi_processor_errata {
} piix4;
};
-extern int acpi_processor_preregister_performance(struct
- acpi_processor_performance
- __percpu *performance);
-
-extern int acpi_processor_register_performance(struct acpi_processor_performance
- *performance, unsigned int cpu);
-extern void acpi_processor_unregister_performance(struct
- acpi_processor_performance
- *performance,
- unsigned int cpu);
/* note: this locks both the calling module and the processor module
if a _PPC object exists, rmmod is disallowed then */
@@ -275,20 +265,55 @@ static inline void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx
/* in processor_perflib.c */
-#ifdef CONFIG_CPU_FREQ
+#ifdef CONFIG_ACPI_PSS
+extern int acpi_processor_preregister_performance(struct
+ acpi_processor_performance
+ __percpu *performance);
+
+extern int acpi_processor_register_performance(struct acpi_processor_performance
+ *performance, unsigned int cpu);
+extern void acpi_processor_unregister_performance(struct
+ acpi_processor_performance
+ *performance,
+ unsigned int cpu);
void acpi_processor_ppc_init(void);
void acpi_processor_ppc_exit(void);
int acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag);
extern int acpi_processor_get_bios_limit(int cpu, unsigned int *limit);
#else
+static inline int acpi_processor_preregister_performance(struct
+ acpi_processor_performance
+ __percpu *performance)
+{
+ return -ENODEV;
+
+}
+
+static inline int acpi_processor_register_performance(struct acpi_processor_performance
+ *performance, unsigned int cpu)
+{
+ return -ENODEV;
+
+}
+
+static inline void acpi_processor_unregister_performance(struct
+ acpi_processor_performance
+ *performance,
+ unsigned int cpu)
+{
+ return;
+}
+
static inline void acpi_processor_ppc_init(void)
{
return;
}
+
static inline void acpi_processor_ppc_exit(void)
{
return;
}
+
static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr,
int event_flag)
{
@@ -302,12 +327,12 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr,
}
return 0;
}
+
static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
{
return -ENODEV;
}
-
-#endif /* CONFIG_CPU_FREQ */
+#endif /* CONFIG_ACPI_PSS */
/* in processor_core.c */
phys_cpuid_t acpi_get_phys_id(acpi_handle, int type, u32 acpi_id);
@@ -318,6 +343,7 @@ int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id);
void acpi_processor_set_pdc(acpi_handle handle);
/* in processor_throttling.c */
+#ifdef CONFIG_ACPI_PSS
int acpi_processor_tstate_has_changed(struct acpi_processor *pr);
int acpi_processor_get_throttling_info(struct acpi_processor *pr);
extern int acpi_processor_set_throttling(struct acpi_processor *pr,
@@ -330,12 +356,63 @@ extern void acpi_processor_reevaluate_tstate(struct acpi_processor *pr,
unsigned long action);
extern const struct file_operations acpi_processor_throttling_fops;
extern void acpi_processor_throttling_init(void);
+#else
+static inline int acpi_processor_tstate_has_changed(struct acpi_processor *pr)
+{
+ return 0;
+}
+
+static inline int acpi_processor_get_throttling_info(struct acpi_processor *pr)
+{
+ return -ENODEV;
+}
+
+static inline int acpi_processor_set_throttling(struct acpi_processor *pr,
+ int state, bool force)
+{
+ return -ENODEV;
+}
+
+static inline void acpi_processor_reevaluate_tstate(struct acpi_processor *pr,
+ unsigned long action)
+{
+ return;
+}
+
+static inline void acpi_processor_throttling_init(void)
+{
+ return;
+}
+#endif /* CONFIG_ACPI_PSS */
+
/* in processor_idle.c */
+extern struct cpuidle_driver acpi_idle_driver;
+#ifdef CONFIG_ACPI_CST
int acpi_processor_power_init(struct acpi_processor *pr);
int acpi_processor_power_exit(struct acpi_processor *pr);
int acpi_processor_cst_has_changed(struct acpi_processor *pr);
int acpi_processor_hotplug(struct acpi_processor *pr);
-extern struct cpuidle_driver acpi_idle_driver;
+#else
+static inline int acpi_processor_power_init(struct acpi_processor *pr)
+{
+ return -ENODEV;
+}
+
+static inline int acpi_processor_power_exit(struct acpi_processor *pr)
+{
+ return -ENODEV;
+}
+
+static inline int acpi_processor_cst_has_changed(struct acpi_processor *pr)
+{
+ return -ENODEV;
+}
+
+static inline int acpi_processor_hotplug(struct acpi_processor *pr)
+{
+ return -ENODEV;
+}
+#endif /* CONFIG_ACPI_CST */
#ifdef CONFIG_PM_SLEEP
void acpi_processor_syscore_init(void);
@@ -347,8 +424,8 @@ static inline void acpi_processor_syscore_exit(void) {}
/* in processor_thermal.c */
int acpi_processor_get_limit_info(struct acpi_processor *pr);
+#ifdef CONFIG_ACPI_PSS
extern const struct thermal_cooling_device_ops processor_cooling_ops;
-#ifdef CONFIG_CPU_FREQ
void acpi_thermal_cpufreq_init(void);
void acpi_thermal_cpufreq_exit(void);
#else
@@ -360,6 +437,6 @@ static inline void acpi_thermal_cpufreq_exit(void)
{
return;
}
-#endif
+#endif /* CONFIG_ACPI_PSS */
#endif
--
1.9.1
Don't try to read the RSDP structure or RSDT/XSDT tables
from memory with the -c option. These are now provided
as files in /sysfs, and this allows acpidump to function
when /dev/mem is not available, which will be the case
for Aarch64 servers.
Signed-off-by: Roy Franz <roy.franz(a)linaro.org>
---
Graeme - all this is tested with your patch, which looks good. It takes
care of what acpidump needs from sysfs.
Al - this fixes acpidump. Are there other utilities that I need to look at
within acpica-tools?
This produces almost the same output with/without the "-c" option,
with the /sysfs files being used with "-c", with the following differences:
* Table address are 0x0 with -c, since we don't get them from the sysfs files
* the tables are listed in a different order.
I have verified with strace that no /dev/mem accesses are made with
"-c".
An issue that this patch doesn't address, is what should be the default,
and what should be done if /dev/mem is missing, or there but not readable.
source/os_specific/service_layers/oslinuxtbl.c | 87 +++++++++++++-------------
1 file changed, 43 insertions(+), 44 deletions(-)
diff --git a/source/os_specific/service_layers/oslinuxtbl.c b/source/os_specific/service_layers/oslinuxtbl.c
index e090a3c..95cc674 100644
--- a/source/os_specific/service_layers/oslinuxtbl.c
+++ b/source/os_specific/service_layers/oslinuxtbl.c
@@ -686,70 +686,69 @@ OslTableInitialize (
return (AE_OK);
}
+ if (!Gbl_DumpCustomizedTables)
+ {
/* Get RSDP from memory */
- Status = OslLoadRsdp ();
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
+ Status = OslLoadRsdp ();
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
- /* Get XSDT from memory */
+ /* Get XSDT from memory */
- if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt)
- {
- if (Gbl_Xsdt)
+ if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt)
{
- free (Gbl_Xsdt);
- Gbl_Xsdt = NULL;
+ if (Gbl_Xsdt)
+ {
+ free (Gbl_Xsdt);
+ Gbl_Xsdt = NULL;
+ }
+
+ Gbl_Revision = 2;
+ Status = OslGetBiosTable (ACPI_SIG_XSDT, 0,
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Xsdt), &Address);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
}
- Gbl_Revision = 2;
- Status = OslGetBiosTable (ACPI_SIG_XSDT, 0,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Xsdt), &Address);
- if (ACPI_FAILURE (Status))
+ /* Get RSDT from memory */
+
+ if (Gbl_Rsdp.RsdtPhysicalAddress)
{
- return (Status);
+ if (Gbl_Rsdt)
+ {
+ free (Gbl_Rsdt);
+ Gbl_Rsdt = NULL;
+ }
+
+ Status = OslGetBiosTable (ACPI_SIG_RSDT, 0,
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Rsdt), &Address);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
}
- }
- /* Get RSDT from memory */
+ /* Get FADT from memory */
- if (Gbl_Rsdp.RsdtPhysicalAddress)
- {
- if (Gbl_Rsdt)
+ if (Gbl_Fadt)
{
- free (Gbl_Rsdt);
- Gbl_Rsdt = NULL;
+ free (Gbl_Fadt);
+ Gbl_Fadt = NULL;
}
- Status = OslGetBiosTable (ACPI_SIG_RSDT, 0,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Rsdt), &Address);
+ Status = OslGetBiosTable (ACPI_SIG_FADT, 0,
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Fadt), &Gbl_FadtAddress);
if (ACPI_FAILURE (Status))
{
return (Status);
}
- }
- /* Get FADT from memory */
-
- if (Gbl_Fadt)
- {
- free (Gbl_Fadt);
- Gbl_Fadt = NULL;
- }
-
- Status = OslGetBiosTable (ACPI_SIG_FADT, 0,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Fadt), &Gbl_FadtAddress);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- if (!Gbl_DumpCustomizedTables)
- {
/* Add mandatory tables to global table list first */
-
Status = OslAddTableToList (ACPI_RSDP_NAME, 0);
if (ACPI_FAILURE (Status))
{
--
1.9.1
This patch series introduce support for _CCA object, which is currently
used mainly by ARM64 platform to specify DMA coherency attribute for
devices when booting with ACPI.
A copy of ACPIv6 can be found here:
http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf
This patch also introduces a new APIS:
1. acpi_check_dma() as part of ACPI API.
2. device_dma_is_coherent() as part of unified device property API.
This simplifies the logic in device drivers to determine device coherency
attribute regardless of booting with DT vs ACPI.
This has been tested on AMD-Seattle platform, which implements _CCA
object as described in the AMD Opteron A1100 Series Processor ACPI Porting Guide:
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/Seattle_ACPI…
Changes from V4 (https://lkml.org/lkml/2015/5/15/669):
* Patch1:
- Move the arch_setup_dma_ops() call from acpi_create_platform_device()
to acpi_bind_one() to support other bus types (per Rafael).
- Rename acpi_device_flags.is_coherent to acpi_device_flags.coherent_dma.
(per Rafael)
- Refactor acpi_dma_is_supported() and acpi_dma_is_coherent() to
acpi_check_dma() to simplify the new interface.
- Only support _CCA=1 for now. See acpi_check_dma() (per Arnd and Catalin)
* Patch2:
- Add acked-by Catalin.
* Patch3:
- Use ACPI_COMPANION() instead of acpi_node().
- Remove has_acpi_companion() check since already done by acpi_node().
(per Will)
* Remove the patch "Generic function for setting up PCI device DMA coherency"
introduced in V4. (per Bjorn)
Changes from V3 (https://lkml.org/lkml/2015/5/7/1004):
* Remove ARCH64_SUPPORT_ACPI_CCA_ZERO and just use CONFIG_ARM64.
(per Catalin and Rafael)
* Do not need to call arch_setup_dma_ops() for acpi_device->dev.
(per Rafael)
* [3/6] (New) We also need to call arch_setup_dma_ops() for pci
devices and check the CCA of the host bridge. Similar logic
exists for OF. So, I refactor of_pci_dma_configure() to
the more generic version pci_dma_configure(), and add support
for ACPI.
Changes from V2 (https://lkml.org/lkml/2015/5/5/510):
* Reword ACPI_MUST_HAVE_CCA to ACPI_CCA_REQUIRED (per Rafael)
* Reword ACPI_SUPPORT_CCA_ZERO to ARCH64_SUPPORT_ACPI_CCA_ZERO
(per Rafael and Arnd)
* Misc code styling clean up (per Rafael)
* Only print missing _CCA warning message in debug mode.
* Refactor logic in acpi_setup_device_dma() into
if acpi_dma_is_supported() then call arch_setup_dma_ops().
* Do not allocate device dma_mask if !acpi_dma_is_supported()
(per Arnd).
* Re-use the dummy functions with the same signature.
Changes from V1 (https://lkml.org/lkml/2015/4/29/290):
* Remove supports for 32-bit ARM since doesn't currently
supporting ACPI (Per Catalin suggestions.)
* Do not call arch_setup_dma_ops() and when _CCA is missing.
(per Arnd suggestion)
* Add CONFIG_ACPI_SUPPORT_CCA_ZERO kernel config flag to
allow architectures to specify the behavior when _CCA=0.
* Add dummy_dma_ops for ARM64 (per Catalin suggestions).
* Fixed build error when ACPI is not configured by defining
acpi_dma_is_coherent() for when CONFIG_ACPI is not set.
* Introduce device_dma_is_coherent().
* Use device_dma_is_coherent in crypto/ccp and amd-xgbe driver.
Changes from RFC: (https://lkml.org/lkml/2015/4/1/389)
* New logic for deriving and propagating coherent attribute from
parent devices. (by Mark)
* Introducing acpi_dma_is_coherent() API (Per Tom suggestion)
* Introducing CONFIG_ACPI_MUST_HAVE_CCA kernel configuration.
* Rebased to linux-4.1-rc1
Suravee Suthikulpanit (5):
ACPI / scan: Parse _CCA and setup device coherency
arm64 : Introduce support for ACPI _CCA object
device property: Introduces device_dma_is_coherent()
crypto: ccp - Unify coherency checking logic with
device_dma_is_coherent()
amd-xgbe: Unify coherency checking logic with device_dma_is_coherent()
arch/arm64/Kconfig | 1 +
arch/arm64/include/asm/dma-mapping.h | 18 +++++-
arch/arm64/mm/dma-mapping.c | 92 +++++++++++++++++++++++++++++++
drivers/acpi/Kconfig | 3 +
drivers/acpi/acpi_platform.c | 2 +-
drivers/acpi/glue.c | 5 ++
drivers/acpi/scan.c | 35 ++++++++++++
drivers/base/property.c | 14 +++++
drivers/crypto/ccp/ccp-platform.c | 60 +-------------------
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 27 +--------
include/acpi/acpi_bus.h | 37 ++++++++++++-
include/linux/acpi.h | 5 ++
include/linux/property.h | 2 +
13 files changed, 212 insertions(+), 89 deletions(-)
--
2.1.0
From: Fu Wei <fu.wei(a)linaro.org>
This patchset:
(1)Introduce Documentation/devicetree/bindings/watchdog/sbsa-gwdt.txt
for FDT info of SBSA Generic Watchdog, and give two examples of
adding SBSA Generic Watchdog device node into the dts files:
foundation-v8.dts and amd-seattle-soc.dtsi.
(2)Introduce "pretimeout" into the watchdog framework, and update
Documentation/watchdog/watchdog-kernel-api.txt to introduce:
(1)the new elements in the watchdog_device and watchdog_ops struct;
(2)the new API "watchdog_init_timeouts".
(3)Introduce ARM SBSA watchdog driver:
a.Use linux kernel watchdog framework;
b.Work with FDT on ARM64;
c.Use "pretimeout" in watchdog framework;
d.In first timeout, do panic to save system context;
e.Support getting timeout and pretimeout from parameter and FDT
at the driver init stage.
(4)Parse SBSA Generic Watchdog Structure in GTDT table of ACPI,
and create a platform device with that information.
This platform device can be used by This Watchdog driver.
This patchset has been tested with watchdog daemon
(ACPI/FDT, module/build-in) on the following platforms:
(1)ARM Foundation v8 model
(2)AMD Seattle B0
Changelog:
v3: Delete "export arch_timer_get_rate" patch.
Driver back to use arch_timer_get_cntfrq.
Improve watchdog_init_timeouts function and update relevant documentation.
Improve watchdog_timeout_invalid and watchdog_pretimeout_invalid.
Improve foundation-v8.dts: delete the unnecessary tag of device node.
Remove "ARM64 || COMPILE_TEST" from Kconfig.
Add comments in arch/arm64/kernel/acpi.c
Fix typoes and incorrect comments.
v2: Improve watchdog-kernel-api.txt documentation for pretimeout support.
Export "arch_timer_get_rate" in arm_arch_timer.c.
Add watchdog_init_timeouts API for pretimeout support in framework.
Improve suspend and resume foundation in driver
Improve timeout/pretimeout values init code in driver.
Delete unnecessary items of the sbsa_gwdt struct and #define.
Delete all unnecessary debug info in driver.
Fix 64bit division bug.
Use the arch_timer interface to get watchdog clock rate.
Add MODULE_DEVICE_TABLE for platform device id.
Fix typoes.
v1: The first version upstream patchset to linux mailing list.
Fu Wei (6):
Documentation: add sbsa-gwdt.txt documentation
ARM64: add SBSA Generic Watchdog device node in foundation-v8.dts
ARM64: add SBSA Generic Watchdog device node in amd-seattle-soc.dtsi
Watchdog: introdouce "pretimeout" into framework
Watchdog: introduce ARM SBSA watchdog driver
ACPI: import watchdog info of GTDT into platform device
.../devicetree/bindings/watchdog/sbsa-gwdt.txt | 36 ++
Documentation/watchdog/watchdog-kernel-api.txt | 47 +-
arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi | 11 +
arch/arm64/boot/dts/arm/foundation-v8.dts | 10 +
arch/arm64/kernel/acpi.c | 145 +++++++
drivers/watchdog/Kconfig | 11 +
drivers/watchdog/Makefile | 1 +
drivers/watchdog/sbsa_gwdt.c | 474 +++++++++++++++++++++
drivers/watchdog/watchdog_core.c | 95 +++--
drivers/watchdog/watchdog_dev.c | 50 +++
include/linux/watchdog.h | 33 +-
11 files changed, 880 insertions(+), 33 deletions(-)
create mode 100644 Documentation/devicetree/bindings/watchdog/sbsa-gwdt.txt
create mode 100644 drivers/watchdog/sbsa_gwdt.c
--
1.9.1
Don't try to read the RSDP structure or RSDT/XSDT tables
from memory with the -c option. These are now provided
as files in /sysfs, and this allows acpidump to function
when /dev/mem is not available, which is the case when
booted in UEFI secure boot mode, and also for ARM servers.
Signed-off-by: Roy Franz <roy.franz(a)linaro.org>
---
This produces almost the same output with/without the "-c" option,
with the /sysfs files being used with "-c", with the following differences:
* Table address are 0x0 with -c, since we don't get them from the sysfs files
* the tables are listed in a different order.
This has been tested against the following Linux patch which is being submitted
upstream:
https://lists.linaro.org/pipermail/linaro-acpi/2015-May/004549.html
source/os_specific/service_layers/oslinuxtbl.c | 87 +++++++++++++-------------
1 file changed, 43 insertions(+), 44 deletions(-)
diff --git a/source/os_specific/service_layers/oslinuxtbl.c b/source/os_specific/service_layers/oslinuxtbl.c
index e090a3c..95cc674 100644
--- a/source/os_specific/service_layers/oslinuxtbl.c
+++ b/source/os_specific/service_layers/oslinuxtbl.c
@@ -686,70 +686,69 @@ OslTableInitialize (
return (AE_OK);
}
+ if (!Gbl_DumpCustomizedTables)
+ {
/* Get RSDP from memory */
- Status = OslLoadRsdp ();
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
+ Status = OslLoadRsdp ();
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
- /* Get XSDT from memory */
+ /* Get XSDT from memory */
- if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt)
- {
- if (Gbl_Xsdt)
+ if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt)
{
- free (Gbl_Xsdt);
- Gbl_Xsdt = NULL;
+ if (Gbl_Xsdt)
+ {
+ free (Gbl_Xsdt);
+ Gbl_Xsdt = NULL;
+ }
+
+ Gbl_Revision = 2;
+ Status = OslGetBiosTable (ACPI_SIG_XSDT, 0,
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Xsdt), &Address);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
}
- Gbl_Revision = 2;
- Status = OslGetBiosTable (ACPI_SIG_XSDT, 0,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Xsdt), &Address);
- if (ACPI_FAILURE (Status))
+ /* Get RSDT from memory */
+
+ if (Gbl_Rsdp.RsdtPhysicalAddress)
{
- return (Status);
+ if (Gbl_Rsdt)
+ {
+ free (Gbl_Rsdt);
+ Gbl_Rsdt = NULL;
+ }
+
+ Status = OslGetBiosTable (ACPI_SIG_RSDT, 0,
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Rsdt), &Address);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
}
- }
- /* Get RSDT from memory */
+ /* Get FADT from memory */
- if (Gbl_Rsdp.RsdtPhysicalAddress)
- {
- if (Gbl_Rsdt)
+ if (Gbl_Fadt)
{
- free (Gbl_Rsdt);
- Gbl_Rsdt = NULL;
+ free (Gbl_Fadt);
+ Gbl_Fadt = NULL;
}
- Status = OslGetBiosTable (ACPI_SIG_RSDT, 0,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Rsdt), &Address);
+ Status = OslGetBiosTable (ACPI_SIG_FADT, 0,
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Fadt), &Gbl_FadtAddress);
if (ACPI_FAILURE (Status))
{
return (Status);
}
- }
- /* Get FADT from memory */
-
- if (Gbl_Fadt)
- {
- free (Gbl_Fadt);
- Gbl_Fadt = NULL;
- }
-
- Status = OslGetBiosTable (ACPI_SIG_FADT, 0,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Fadt), &Gbl_FadtAddress);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- if (!Gbl_DumpCustomizedTables)
- {
/* Add mandatory tables to global table list first */
-
Status = OslAddTableToList (ACPI_RSDP_NAME, 0);
if (ACPI_FAILURE (Status))
{
--
1.9.1
From: "Jonathan (Zhixiong) Zhang" <zjzhang(a)codeaurora.org>
On a platform with APEI (ACPI Platform Error Interface) enabled, firmware
updates a memory region with hardware error record using nocache
attribute. When OS reads the region, since it maps the region with cache
attribute even though EFI memory map defines this region as uncached, OS
gets stale data and errorneously reports there is no new HW error.
When ghes driver maps the memory region, it uses the cache attribute
according to EFI memory map, if EFI memory map feature is enabled.
Since both arch/x86 and arc/ia64 implemented architecture agnostic EFI
memory map attribue lookup function, the code is moved from arch/x86
and arch/ia64 into EFI subsystem.
Jonathan (Zhixiong) Zhang (2):
efi: arch, x86: arch, ia64: rearrange EFI memmap related functions
acpi, apei: use EFI memmap to map GHES memory
arch/ia64/kernel/efi.c | 11 -----------
arch/x86/platform/efi/efi.c | 18 ------------------
drivers/acpi/apei/ghes.c | 13 +++++++++++++
drivers/firmware/efi/efi.c | 27 +++++++++++++++++++++++++++
include/linux/efi.h | 1 +
5 files changed, 41 insertions(+), 29 deletions(-)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project