>From the functionality point of view this series might be split into the
following logic parts:
1. Make MMCONFIG code arch-agnostic which allows all architectures to collect
PCI config regions and used when necessary.
2. Move non-arch specific bits to the core code.
3. Use MMCONFIG code and implement generic ACPI based PCI host
controller driver.
4. Enable above driver on ARM64
Patches has been built on top of 4.4-rc4 and can be found here:
git@github.com:semihalf-nowicki-tomasz/linux.git (pci-acpi-v2)
NOTE, this patch set depends on Matthew's patches:
http://www.spinics.net/lists/linux-pci/msg45950.htmlhttps://github.com/Vality/linux/tree/pci-fixes
This has been tested on Cavium ThunderX 1 socket server and QEMU.
Any help in reviewing and testing is very appreciated.
v1 -> v2
- moved non-arch specific piece of code to dirver/acpi/ directory
- fixed IO resource handling
- introduced PCI config accessors quirks matching
- moved ACPI_COMPANION_SET to generic code
Liu Jiang (1):
ACPI, PCI: Refine the way to handle translation_offset for ACPI
resources
Tomasz Nowicki (22):
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.
XEN / PCI: Remove the dependence on arch x86 when PCI_MMCONFIG=y
pci, acpi, mcfg: Provide default RAW ACPI PCI config space accessors.
arm64, acpi: Use empty PCI config space accessors from mcfg.c file.
pci, acpi, ecam: Add flag to indicate whether ECAM region was hot
added or not.
x86, pci: Cleanup platform specific MCFG data using previously added
ECAM hot_added flag.
arm64, pci: Remove useless boot time IRQ assignment when booting with
DT.
pci, acpi: Move ACPI host bridge device companion assignment to core
code.
x86, ia64, pci: Remove ACPI companion device from platform specific
data.
pci, acpi: Provide generic way to assign bus domain number.
x86, ia64, pci: Convert arches to use PCI_DOMAINS_GENERIC.
x86, ia64: Include acpi_pci_{add|remove}_bus to the default
pcibios_{add|remove}_bus implementation.
acpi, mcfg: Implement two calls that might be used to inject/remove
MCFG region.
x86, acpi, pci: Use equivalent function introduced in previous patch.
acpi, mcfg: Add default PCI config accessors implementation and
initial support for related quirks.
pci, acpi: Support for ACPI based PCI hostbridge init
pci, acpi: Match PCI config space accessors against platfrom specific
quirks.
arm64, pci, acpi: Start using ACPI based PCI host bridge driver for
ARM64.
arch/arm64/Kconfig | 10 ++
arch/arm64/kernel/pci.c | 35 ------
arch/ia64/Kconfig | 3 +
arch/ia64/include/asm/pci.h | 3 -
arch/ia64/pci/pci.c | 53 +++-----
arch/x86/Kconfig | 7 ++
arch/x86/include/asm/pci.h | 10 --
arch/x86/include/asm/pci_x86.h | 28 +----
arch/x86/pci/acpi.c | 43 ++-----
arch/x86/pci/common.c | 10 --
arch/x86/pci/irq.c | 10 --
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 | 203 +++++++++++++++++++++++++++++++
drivers/acpi/pci_root.c | 5 +-
drivers/acpi/resource.c | 12 +-
drivers/pci/Kconfig | 10 ++
drivers/pci/Makefile | 5 +
drivers/pci/ecam.c | 234 +++++++++++++++++++++++++++++++++++
drivers/pci/host/Kconfig | 6 +
drivers/pci/host/Makefile | 1 +
drivers/pci/host/pci-host-acpi.c | 138 +++++++++++++++++++++
drivers/pci/pci.c | 29 ++++-
drivers/pci/probe.c | 5 +
drivers/xen/pci.c | 7 +-
include/asm-generic/vmlinux.lds.h | 7 ++
include/linux/acpi.h | 2 +
include/linux/ecam.h | 61 ++++++++++
include/linux/pci-acpi.h | 17 +++
32 files changed, 817 insertions(+), 467 deletions(-)
create mode 100644 drivers/acpi/mcfg.c
create mode 100644 drivers/pci/ecam.c
create mode 100644 drivers/pci/host/pci-host-acpi.c
create mode 100644 include/linux/ecam.h
--
1.9.1
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: 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
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:
v2: Rebase to latest kernel version(4.4-rc3).
Fix the bug about the config problem,
use CONFIG_ACPI_GTDT instead of CONFIG_ACPI in arm_arch_timer.c
v1: The first upstreaming version: https://lkml.org/lkml/2015/10/28/553
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 | 178 +++++++++++++----
include/clocksource/arm_arch_timer.h | 19 ++
include/linux/acpi.h | 17 ++
6 files changed, 555 insertions(+), 36 deletions(-)
create mode 100644 drivers/acpi/gtdt.c
--
2.5.0
>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
Hi Folks,
Just a few notes that might be useful to someone else.
I mentioned before that we'll want to see ACPI_INITRD_TABLE_OVERRIDE
support on arm64 in due course for use during bringup of new systems. It
is commonly used on x86 to provide handy updated ACPI tables via a
prepended initrd cpio that is attached to the regular initrd image,
which is infinitely better than respinning firmware each time you want
to provide updated tables (yes yes, we all know the "devicetree"
directive in GRUB does this with DT and that's great and wonderful). I
know that someone is working on it, but I had a need for an interim
solution over the weekend for some hardware I am bringing up here.
The problem is that there's no mapping for the pages containing the
ramdisk data prior to paging_init. x86 does a bit of hoop jumping (and I
think they have certain assumptions about linear mapping too) and splits
the initrd setup into a couple of different phases, which we may well
need to do also if we want to be able to call something like:
#if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD)
acpi_initrd_override((void *)initrd_start, initrd_end -
initrd_start);
#endif
prior to acpi_boot_table_init in arch/arm64/kernel/setup.c. That routine
will correctly map memory for data it copies out of the cpio, but it
assumes that the initrd is already mapped. For the very nasty hack I
want over the weekend, I added some extra fixmaps and then do an
early_memremap on the physical address of first page of the initrd (the
cpio is tiny, and is always prepended and this is very nasty). Viz:
[ 0.000000] JCM: using fixmap for first page of ramdisk...
[ 0.000000] JCM: first physical page of ramdisk: [mem REDACTED]
[ 0.000000] JCM: first virtual page of ramdisk: [mem REDACTED]
[ 0.000000] XXXX ACPI table found in initrd
[kernel/firmware/acpi/xxxx.aml][0xxxx]
[ 0.000000] XXXX ACPI table found in initrd
[kernel/firmware/acpi/xxxx.aml][0xxx]
[ 0.000000] XXXX ACPI table found in initrd
[kernel/firmware/acpi/xxxx.aml][0xxxx]
So maybe I'll get what I want working, but a head's up to whoever from
Linaro ends up looking into the broader implementation that I think
you'll need to rework initrd mapping as part of that. Unless of course
I'm missing something. Which is more than possible.
Jon.
Hi Folks,
A quick note that I'm poking at a test kernel with
ACPI_INITRD_TABLE_OVERRIDE support. I don't condone this for production
kernels, but for testing fixes to DSDT's and SSDT's it can be very
useful to insert updated tables into the initrd (this is commonplace on
x86 during development). If someone already poked at this, let me know
if you plan to post something upstream, etc.
Jon.