Support for configuring bootconsole and console via the ACPI tables
DBG2 (Debug Port Table 2) [1] and SPCR (Serial Port Console Redirection
Table) [2], defined by Microsoft, has been discussed on and off over the
years.
[1] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639131(v=vs.85)…
[2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85)…
Licensing concerns have prevented this happening in the past, but as of
10 August 2015, these tables have both been released also under OWF 1.0
(http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0)
which is think is noncontroversially GPL-compatible?
This set is a first attempt at implementing this.
Submitting as an RFC since the SPCR handling currently depends on the
console driver being initialized after subsystem initcalls. Workaround
to enable testing surrounding infrastructure in 5/5, _really_ not
intended to be merged.
(Suggestions for acceptable ways of working around this appreciated.)
For testing the DBG2 stuff with pl011, you would need:
- A patch to unbreak pl011 earlycon, like
http://permalink.gmane.org/gmane.linux.ports.arm.kernel/433219
- A QEMU that generates DBG2 tables, like current HEAD with the
addition of
http://lists.nongnu.org/archive/html/qemu-devel/2015-09/msg01719.html
SPCR support is included in QEMU's ARM mach-virt since 2.4 release.
DBG2 support has an Intel copyright notice added to it since my starting
point was Lv Zheng's 2012 DBGP/DBG2 set (although not much of the
original remains - this is quite a cut-down version).
Leif Lindholm (4):
arm64: move acpi/dt decision earlier in boot process
of/serial: move earlycon early_param handling to serial
acpi/serial: add DBG2 earlycon support
HACK: serial: move pl011 initcall to device_initcall
Torez Smith (1):
tty/console: use SPCR table to define console
arch/arm64/kernel/acpi.c | 55 +++++----
drivers/acpi/Makefile | 1 +
drivers/acpi/console.c | 260 +++++++++++++++++++++++++++++++++++++++
drivers/of/fdt.c | 13 +-
drivers/tty/serial/amba-pl011.c | 2 +-
drivers/tty/serial/earlycon.c | 18 ++-
drivers/tty/serial/serial_core.c | 14 ++-
include/linux/acpi.h | 13 ++
include/linux/of_fdt.h | 1 +
include/linux/serial_core.h | 9 +-
10 files changed, 337 insertions(+), 49 deletions(-)
create mode 100644 drivers/acpi/console.c
--
2.1.4
From: Fu Wei <fu.wei(a)linaro.org>
ACPI/APEI is designed to verifiy/report H/W errors, like Corrected
Error(CE) and Uncorrected Error(UC). It contains four tables: HEST,
ERST, EINJ and BERT. The first three tables have been merged for
a long time, but because of lacking BIOS support for BERT, the
support for BERT is pending until now. Recently on ARM 64 platform
it is has been supported. So here we come.
The following log is a BERT record after system reboot because of
hitting a fatal error.
BERT: Obtained BERT iomem region <00000000fe801000-00000000fe802000> for BERT.
[Hardware Error]: Error record from previous boot:
[Hardware Error]: event severity: fatal
[Hardware Error]: Error 0, type: fatal
[Hardware Error]: section_type: memory error
[Hardware Error]: physical_address: 0x00000000fe800000
[Hardware Error]: physical_address_mask: 0x0000000000000fff
[Hardware Error]: card: 0 module: 1 bank: 0 device: 1 row: 1 column: 1 bit_pos
Changelog:
v2: Delete EXPORT_SYMBOL_GPL(bert_disable), because "bert_disable" is only used
in bert.c for now.
Do some code-style cleanups.
v1: The first upstream version submitted in linux-acpi mailing list:
http://www.spinics.net/lists/linux-acpi/msg57384.html
Huang Ying (1):
ACPI, APEI, Boot Error Record Table (BERT) support
Tomasz Nowicki (1):
acpi, apei, bert: Clear error status at the end of error handling
Documentation/kernel-parameters.txt | 3 +
drivers/acpi/apei/Makefile | 2 +-
drivers/acpi/apei/bert.c | 165 ++++++++++++++++++++++++++++++++++++
include/acpi/apei.h | 1 +
4 files changed, 170 insertions(+), 1 deletion(-)
create mode 100644 drivers/acpi/apei/bert.c
--
2.4.3
>From the functionality point of view this series might be split into two logic parts:
1. Making MMCONFIG code arch-agnostic which allows all architectures to collect
PCI config regions and used when necessary.
2. Using generic MMCONFIG code and introducing ACPI based PCI hostbridge
initialization for ARM64
Patches has been built on top of:
[Patch v7 0/7] Consolidate ACPI PCI root common code into ACPI core
https://lkml.org/lkml/2015/10/14/31
Git branch can be found here:
https://git.linaro.org/leg/acpi/acpi.git/shortlog/refs/heads/pci-acpi-upstr…
This has been tested on Cavium ThunderX 1 socket server.
Any help in reviewing and testing is very appreciated.
Hanjun Guo (1):
XEN / PCI: Remove the dependence on arch x86 when PCI_MMCONFIG=y
Tomasz Nowicki (10):
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: Provide default RAW ACPI PCI config space accessors.
pci, acpi, ecam: Add flag to indicate whether ECAM region was hot
added or not.
x86, pci: Use previously added ECAM hot_added flag to remove ECAM
regions.
pci, acpi: Provide generic way to assign bus domain number.
arm64, pci, acpi: Support for ACPI based PCI hostbridge init
arch/arm64/Kconfig | 6 +
arch/arm64/kernel/pci.c | 208 ++++++++++++++++++++++++++++++++--
arch/x86/Kconfig | 4 +
arch/x86/include/asm/pci_x86.h | 28 +----
arch/x86/pci/acpi.c | 17 +--
arch/x86/pci/mmconfig-shared.c | 250 +++++++----------------------------------
arch/x86/pci/mmconfig_32.c | 11 +-
arch/x86/pci/mmconfig_64.c | 67 +----------
arch/x86/pci/numachip.c | 1 +
drivers/acpi/Makefile | 1 +
drivers/acpi/mcfg.c | 104 +++++++++++++++++
drivers/acpi/pci_root.c | 2 +-
drivers/pci/Kconfig | 10 ++
drivers/pci/Makefile | 5 +
drivers/pci/ecam.c | 234 ++++++++++++++++++++++++++++++++++++++
drivers/pci/pci.c | 30 ++++-
drivers/xen/pci.c | 7 +-
include/linux/acpi.h | 2 +
include/linux/ecam.h | 44 ++++++++
19 files changed, 691 insertions(+), 340 deletions(-)
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 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
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.Support getting timeout and pretimeout from parameter and FDT
at the driver init stage.
e.In the first timeout, do panic to save system context;
f.In the second stage, user can still feed the dog without
cleaning WS0. By this feature, we can avoid the panic infinite
loops, while backing up a large system context in a server.
g.In the second stage, can trigger WS1 by setting pretimeout = 0
if necessary.
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 platform
This patchset has been tested with kdump successfully.
Changelog:
v8: Rebase to latest kernel version(4.3-rc7).
Separate the patches of GTDT support and arm_arch_timer. This
clocksource relevant patch will upstreamed in a individual patchset.
Update all the default timeout and pretimeout to 30s and 60s.
Improve documentation and inline comments.
Fix a bug in pretimeout support which makes timeout and pretimeout
parameters initialization fail.
v7: Rebase to latest kernel version(4.2-rc7).
Improve FDT support: geting resource by order, instead of name.
According to the FDT support, Update the example dts file, gtdt.c
and sbsa_gwdt.c.
Pass the sparse test, and fix the warning.
Fix the max_pretimeout and max_timeout value overflow bug.
Delete the WCV output value.
v6: Improve the dtb example files: reduce the register frame size to 4K.
Improve pretimeout support:
(1) improve watchdog_init_timeouts function
(2) rename watchdog_check_min_max_timeouts back to the original name
(1) improve watchdog_timeout_invalid/watchdog_pretimeout_invalid
Add the new features in the sbsa_gwdt driver:
(1) In the second stage, user can feed the dog without cleaning WS0.
(2) In the second stage, user can trigger WS1 by setting pretimeout = 0.
(3) expand the max value of pretimeout, in case 10 second is not enough
for a kdump kernel reboot in panic.
v5: Improve pretimeout support:
(1)fix typo in documentation and comments.
(2)fix the timeout limits validation bug.
Simplify sbsa_gwdt driver:
(1)integrate all the registers access functions into caller.
v4: Refactor GTDT support code: remove it from arch/arm64/kernel/acpi.c,
put it into drivers/acpi/gtdt.c file.
Integrate the GTDT code of drivers/clocksource/arm_arch_timer.c into
drivers/acpi/gtdt.c.
Improve pretimeout support, fix "pretimeout == 0" problem.
Simplify sbsa_gwdt driver:
(1)timeout/pretimeout limits setup;
(2)keepalive function;
(3)delete "clk == 0" check;
(4)delete WS0 status bit check in interrupt routine;
(5)sbsa_gwdt_set_wcv function.
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 (7):
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: add GTDT table parse driver into ACPI driver
Watchdog: enable ACPI GTDT support for ARM SBSA watchdog driver
Fu Wei (5):
Documentation: add sbsa-gwdt driver 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
.../devicetree/bindings/watchdog/sbsa-gwdt.txt | 46 +++
Documentation/watchdog/watchdog-kernel-api.txt | 55 ++-
Documentation/watchdog/watchdog-parameters.txt | 6 +
arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi | 8 +
arch/arm64/boot/dts/arm/foundation-v8.dts | 7 +
drivers/watchdog/Kconfig | 14 +
drivers/watchdog/Makefile | 1 +
drivers/watchdog/sbsa_gwdt.c | 459 +++++++++++++++++++++
drivers/watchdog/watchdog_core.c | 127 ++++--
drivers/watchdog/watchdog_dev.c | 53 +++
include/linux/watchdog.h | 39 +-
11 files changed, 773 insertions(+), 42 deletions(-)
create mode 100644 Documentation/devicetree/bindings/watchdog/sbsa-gwdt.txt
create mode 100644 drivers/watchdog/sbsa_gwdt.c
--
2.4.3
From: Fu Wei <fu.wei(a)linaro.org>
This patchset:
(1)Introduce ACPI GTDT parser: drivers/acpi/gtdt.c
Parse all kinds of timer in GTDT table of ACPI:arch timer,
memory-mapped timer and SBSA Generic Watchdog timer.
This driver can help to simplify all the relevant timer drivers,
and separate all the ACPI GTDT knowledge from them.
(2)Simplify ACPI code for arch timer in arm_arch_timer.c
(3)Add memory-mapped timer support in arm_arch_timer.c
[PATCH 2/3] and [PATCH 3/3] depend on a patchset
[PATCH v2 0/5] ACPI probing infrastructure,
https://lkml.org/lkml/2015/9/13/126, which has been accepted by upstream
maintainer, and has been merged in linux-next.git, tag: next-20151013.
The SBSA Generic Watchdog info parsing support have been tested with
a upstreaming SBSA Generic Watchdog driver:
https://lkml.org/lkml/2015/10/27/466
on the following platforms:
(1)ARM Foundation v8 model
(2)AMD Seattle platform
ARM memory-mapped timer support of this patchset has been tested
on the following platforms:
(1)ARM Foundation v8 model
Changelog:
v1: The first upstreaming version.
Fu Wei (3):
ACPI: add GTDT table parse driver into ACPI driver
clocksource: simplify ACPI code in arm_arch_timer.c
clocksource: add memory-mapped timer support in arm_arch_timer.c
drivers/acpi/Kconfig | 9 +
drivers/acpi/Makefile | 1 +
drivers/acpi/gtdt.c | 367 +++++++++++++++++++++++++++++++++++
drivers/clocksource/arm_arch_timer.c | 176 +++++++++++++----
include/clocksource/arm_arch_timer.h | 19 ++
include/linux/acpi.h | 17 ++
6 files changed, 554 insertions(+), 35 deletions(-)
create mode 100644 drivers/acpi/gtdt.c
--
2.4.3
In the ACPI 6.0 spec, the flags field of the MADT GICC subtable uses
three bits, not two. Correct the flag mask to do the test properly.
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
src/acpi/madt/madt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
index f776745..1f19848 100644
--- a/src/acpi/madt/madt.c
+++ b/src/acpi/madt/madt.c
@@ -226,7 +226,7 @@ static int madt_test1(fwts_framework *fw)
"MADT GIC C Structure reserved field should be zero, "
"instead got 0x%" PRIx32 ".", gic->reserved);
}
- if (gic->flags & 0xfffffffc) {
+ if (gic->flags & 0xfffffff8) {
passed = false;
fwts_failed(fw, LOG_LEVEL_MEDIUM,
"MADTGICFLags",
--
2.4.3
According to section 5.2.12.10 of the ACPI 6.0 spec, the reserved field
starts at byte offset 5 and is 3 bytes long. However, the subtable data
structure being used makes it only 1 byte long. This is incorrect, so
fix it.
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
src/lib/include/fwts_acpi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
index 5cc4cb4..cf8f4b8 100644
--- a/src/lib/include/fwts_acpi.h
+++ b/src/lib/include/fwts_acpi.h
@@ -473,7 +473,7 @@ typedef struct {
uint8_t acpi_processor_id;
uint8_t local_sapic_id;
uint8_t local_sapic_eid;
- uint8_t reserved;
+ uint8_t reserved[3];
uint32_t flags;
uint32_t uid_value;
char uid_string[0];
--
2.4.3