Currently, the virt machine model generates Device Tree information dynamically based on the existing devices in the system. This patch series extends the same concept but for ACPI information instead. A total of seven tables have been
implemented in this patch series, which is the minimum for a basic ARM support.
The set of generated tables are:
- RSDP
- XSDT
- MADT
- GTDT
- FADT
- FACS
- DSDT
The tables are created in standalone buffers, taking into account the
needed information passed from the virt machine model. When the generation
is finalized, the individual buffers are compacted to a single ACPI binary
blob, where it is injected on the guest memory space in a fixed location.
The guest kernel can find the ACPI tables by providing to it the physical
address of the ACPI blob (e.g. acpi_rsdp=0x47000000 boot argument).
This series has been tested on the Foundation Model 0.8 build 5206 and
the Juno development board. For kernel and driver support it is based
on the "Introduce ACPI for ARM64 based on ACPI 5.1" and
"Drivers for Juno to boot from ACPI" patch series from Hanjun Guo.
Alexander Spyridakis (7):
hw/i386: Move ACPI header definitions in an arch-independent location
hw/arm/virt-acpi: Basic skeleton for dynamic generation of ACPI tables
hw/arm/virt-acpi: Generate RSDP and XSDT, add helper functions
hw/arm/virt-acpi: Generate FACS and FADT, update ACPI headers
hw/arm/virt-acpi: GIC and Arch Timer definitions in MADT and GTDT
hw/arm/virt-acpi: Generation of DSDT including virt devices
hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables
hw/arm/Makefile.objs | 2 +-
hw/arm/boot.c | 26 +++
hw/arm/virt-acpi.c | 555 ++++++++++++++++++++++++++++++++++++++++++++
hw/arm/virt.c | 54 ++++-
hw/i386/acpi-build.c | 2 +-
hw/i386/acpi-defs.h | 368 -----------------------------
include/hw/acpi/acpi-defs.h | 535 ++++++++++++++++++++++++++++++++++++++++++
include/hw/arm/arm.h | 2 +
include/hw/arm/virt-acpi.h | 73 ++++++
tests/bios-tables-test.c | 2 +-
10 files changed, 1244 insertions(+), 375 deletions(-)
create mode 100644 hw/arm/virt-acpi.c
delete mode 100644 hw/i386/acpi-defs.h
create mode 100644 include/hw/acpi/acpi-defs.h
create mode 100644 include/hw/arm/virt-acpi.h
--
1.9.1
These patches add the DBG2/SPCR tables for FVP/Juno for kernel testing.
They allow a kernel to find a serial console without console= line.
They have been tested using the Redhat patches for SPCR support which are
work in progress!
Thanks
Graeme
This patch series introduce ACPI support for AHCI platform driver.
Existing ACPI support for AHCI assumes the device controller is a PCI device.
Since there is no ACPI _CID for generic AHCI controller, the driver
could not use it for matching devices. Therefore, this patch introduces
a mechanism for drivers to match devices using ACPI _CLS method.
_CLS contains PCI-defined class-code.
This patch series also modifies ACPI modalias to add class-code to the
exisiting format, which currently only uses _HID and _CIDs. This is required
to support loadable modules w/ _CLS.
This patch series is rebased from and tested with:
http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v9
This topic was discussed earlier here (as part of introducing support for
AMD Seattle SATA controller):
http://marc.info/?l=linux-arm-kernel&m=141083492521584&w=2
Changes from V3 (https://lkml.org/lkml/2015/2/8/106)
* Instead of introducing new structure acpi_device_cls, add cls into
the acpi_device_id, and modify the __acpi_match_device
to also match for cls. (per Mika suggestion.)
* Add loadable module support, which requires changes in ACPI
modalias. (per Mika suggestion.)
* Rebased and tested with acpi-5.1-v9
Changes from V2 (https://lkml.org/lkml/2015/1/5/662)
* Update with review comment from Rafael in patch 1/2
* Rebased and tested with acpi-5.1-v8
Changes from V1 (https://lkml.org/lkml/2014/12/19/345)
* Rebased to 3.19.0-rc2
* Change from acpi_cls in device_driver to acpi_match_cls (Hanjun comment)
* Change the matching logic in acpi_driver_match_device() due to the new
special PRP0001 _HID.
* Simplify the return type of acpi_match_device_cls() to boolean.
Changes from RFC (https://lkml.org/lkml/2014/12/17/446)
* Remove #ifdef and make non-ACPI version of the acpi_match_device_cls
as inline. (per Arnd)
* Simplify logic to retrieve and evaluate _CLS handle. (per Hanjun)
Suravee Suthikulpanit (2):
ACPI / scan: Add support for ACPI _CLS device matching
ata: ahci_platform: Add ACPI _CLS matching
drivers/acpi/acpica/acutils.h | 3 ++
drivers/acpi/acpica/nsxfname.c | 20 +++++++++--
drivers/acpi/acpica/utids.c | 71 +++++++++++++++++++++++++++++++++++++++
drivers/acpi/scan.c | 17 ++++++++--
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 9 +++++
include/acpi/acnames.h | 1 +
include/acpi/actypes.h | 4 ++-
include/linux/mod_devicetable.h | 1 +
scripts/mod/devicetable-offsets.c | 1 +
scripts/mod/file2alias.c | 13 +++++--
11 files changed, 133 insertions(+), 9 deletions(-)
--
2.1.0
From: Al Stone <al.stone(a)linaro.org>
The use of the ACPI _OSI method in Linux has a long and sordid history.
Instead of perpetuating past complications on new architectures, the
consensus amongst those writing the ACPI specification and those using
it seems to be to ultimately deprecate the use of _OSI. A change request
has been submitted (but not yet decided upon) to modify the ACPI spec
accordingly.
In the meantime, these patches rearrange the implementation of _OSI so
that it can be deprecated, or ultimately removed completely, on at least
arm64 platforms. This is done by separating out the _OSI implementation
and moving it into a new file. For x86 and ia64, there is no change in
functionality. But, this allows us to provide a separate implementation
of _OSI for arm64 that generates a warning that it has been deprecated,
and always returns false; i.e., that the capability being queried for,
whether OS name or functionality, is not supported. Patches 0005
through 0008 provide these changes; the first four patches are solely
cleanup to the file drivers/acpi/osl.c made so that checkpatch will not
complain.
The final patch changes the default value for the _OS_ method for arm64
only. Since there is no need to pretend to be older versions of Windows,
or any other OS at all, the _OS_ method will return "Linux" on arm64.
One can still use the acpi_os_name kernel parameter if there is a need
to use some other value.
The first seven patches do not depend on arm64 support for ACPI and could
be used independently. The last two patches make much more sense when used
in conjunction with Hanjun's patches for ACPI 5.1 on arm64 [0]. In fact,
patch 0008 cannot be applied without [0].
These have been through some simple testing on two different x86 laptops,
and all seems well (Lenovo t440s and t430s ThinkPads). The arm64 code has
been tested on an AMD Seattle system. Unfortunately, for ia64, all I could
do was cross-compile the code; I have no access to hardware to test on.
NB: the first four patches are solely cleanup to drivers/acpi/osl.c based
on the results from checkpatch and can be treated independently. However,
the remainder of the patch set assumes this cleanup has been done. There
are some checkpatch warnings still remaining in osl.c -- specifically about
use of volatiles and one line of 81 characters -- that these patches
intentionally do not correct as they do not appear to need correcting.
Changes in v3:
-- add in cleanup to osl.c based on checkpatch output
-- put arch-specific _OSI implementation in the correct place (arch/*)
-- modify CONFIG item names and make them so they are not user selectable
-- get rid of the BLACKLIST config item; it wasn't really needed.
Changes in v2:
-- significant simplification based on Rafael's comments
-- ACPI spec change request has now been submitted
[0] https://lkml.org/lkml/2015/2/2/261
Al Stone (9):
ACPI: fix all errors reported by cleanpatch.pl in osl.c
ACPI: clear up warnings on use of printk reported by checkpatch.pl
ACPI: clean up checkpatch warnings for various bits of syntax
ACPI: clean up checkpatch warnings for items with possible semantic
value
ACPI: move acpi_os_handler() so it can be made arch-dependent later
ACPI: move _OSI support functions to allow arch-dependent
implementation
ACPI: enable arch-specific compilation for _OSI and the blacklist
ACPI: arm64: use an arch-specific ACPI _OSI method and ACPI blacklist
ACPI: arm64: use "Linux" as ACPI_OS_NAME for _OS on arm64
arch/arm64/Kconfig | 6 +
arch/arm64/kernel/Makefile | 2 +-
arch/arm64/kernel/acpi-blacklist.c | 20 ++
arch/arm64/kernel/acpi-osi.c | 25 +++
drivers/acpi/Kconfig | 3 +
drivers/acpi/Makefile | 5 +
drivers/acpi/osi.c | 245 +++++++++++++++++++++++
drivers/acpi/osl.c | 387 ++++++++-----------------------------
include/acpi/acconfig.h | 2 +
include/acpi/platform/aclinux.h | 4 +
include/linux/acpi.h | 14 +-
11 files changed, 406 insertions(+), 307 deletions(-)
create mode 100644 arch/arm64/kernel/acpi-blacklist.c
create mode 100644 arch/arm64/kernel/acpi-osi.c
create mode 100644 drivers/acpi/osi.c
--
2.1.0
With ACPI arm64 core paches and NUMA patch from Ganapatrao,
I prepared those ACPI based NUMA support for ARM64.
v1->v2:
- fix the warning about not released a early remapped
memory;
- rebase on top of 4.0-rc1 and v9 of ACPI patch set.
Ashok, sorry for sending out the patch set late, and
your patch for " ARM64 / ACPI : Probe _PXM during pci acpi scan"
need based on PCI patches, I will pick it up later.
Note: Haven't tested on real hardware...
git repo:
https://git.linaro.org/leg/acpi/acpi.git branch numa
Ganapatrao Kulkarni (1):
arm64:numa: adding numa support for arm64 platforms
Hanjun Guo (4):
ACPI / NUMA: Use pr_fmt() instead of printk
ACPI / NUMA: Replace ACPI_DEBUG_PRINT() with pr_debug()
ARM64 / ACPI: NUMA support based on SRAT and SLIT
ACPI / NUMA: Enable ACPI based NUMA on ARM64
arch/arm64/Kconfig | 32 +++
arch/arm64/include/asm/acpi.h | 6 +
arch/arm64/include/asm/mmzone.h | 32 +++
arch/arm64/include/asm/numa.h | 51 ++++
arch/arm64/kernel/Makefile | 2 +
arch/arm64/kernel/acpi_numa.c | 208 +++++++++++++++
arch/arm64/kernel/dt_numa.c | 302 +++++++++++++++++++++
arch/arm64/kernel/setup.c | 11 +
arch/arm64/kernel/smp.c | 2 +
arch/arm64/mm/Makefile | 1 +
arch/arm64/mm/init.c | 34 ++-
arch/arm64/mm/numa.c | 573 ++++++++++++++++++++++++++++++++++++++++
drivers/acpi/Kconfig | 2 +-
drivers/acpi/numa.c | 108 +++++---
include/linux/acpi.h | 15 ++
15 files changed, 1329 insertions(+), 50 deletions(-)
create mode 100644 arch/arm64/include/asm/mmzone.h
create mode 100644 arch/arm64/include/asm/numa.h
create mode 100644 arch/arm64/kernel/acpi_numa.c
create mode 100644 arch/arm64/kernel/dt_numa.c
create mode 100644 arch/arm64/mm/numa.c
--
1.9.1
On 2015年01月08日 17:26, Ashok Kumar wrote:
> On Thu, Jan 08, 2015 at 04:00:37PM +0800, Hanjun Guo wrote:
>> On 2015???01???07??? 21:32, Ashok Kumar wrote:
>>> Also provided pcibus_to_node and cpumask_of_pcibus
>>> based on x86.
>>>
>>> Signed-off-by: Ashok Kumar <ashoks(a)broadcom.com>
>>> ---
>>> Hanjun,
>>> This patch is based on your acpi numa patchset and leg-kernel.
>>> Tested it on qemu using generic pci host controller.
>>> could you add this to your set of patches if it is fine?
>>> Thanks!
>>
>> sure, I will. thanks for your patch!
>>
>> I already fixed the call trace of early_ioremap memory
>> leak, will send another version.
> Hanjun,
>
> Thanks!
>
> I just noticed the call to numa_add_memblk in acpi_numa_memory_affinity_init should use ma->length
> as the second param. The syntax of numa_add_memblk is numa_add_memblk(u32 nid, u64 base, u64 size).
Hi Ashok,
I'm going to send another version of ACPI patches but
I can't add your _PXM patch in my patch set, it depends
on PCI patches, I will add them when PCI patch is ready.
Thanks
Hanjun
Hi,
This is the v8 of ACPI core patches for ARM64 based on ACPI 5.1, there are
some updates since v7:
- Add two more documantation to explain why we need ACPI in ARM64 servers
by Grant, and recommendations and prohibitions on the use of the numerous
ACPI tables and objects by Al Stone.
- Add two patches which is need to map acpi tables after acpi_gbl_permanent_mmap
is set
- Add another patch "dt / chosen: Add linux,uefi-stub-generated-dtb property"
to address that if firmware providing no dtb, we can try ACPI configuration data
even if no "acpi=force" is passed in early parameters. (I think ACPI for XEN and
kexec need consider sperately as disscussed, correct me if I'm wrong).
- Add CC in the patch to the subsystem maintainers and modify the subject
of the patch to explicitly show the subsystem touched by this patch set,
please help us to review and ack them if they make sense, thanks.
- Add Tested-by from Qualcomm and Redhat;
- Make ACPI depends on PCI suggested by Catalin;
- Clean up SMP init function as Lorenzo suggested, remove physical
CPU hot-plug code in the patch;
- Address some comments from Marc and explicitly state that will
implment statcked irqdomain and GIC init framework when GICv3 and
ITS, GICv2m are implemented;
- Rebased on top of 3.19-rc7.
previous version is here:
v7: https://lkml.org/lkml/2015/1/14/586
v6: https://lkml.org/lkml/2015/1/4/40
Any comments are welcome :)
Thanks
Hanjun
Al Stone (4):
ARM64 / ACPI: Get RSDP and ACPI boot-time tables
ARM64 / ACPI: Introduce early_param for "acpi" and pass acpi=force to
enable ACPI
ARM64 / ACPI: Select ACPI_REDUCED_HARDWARE_ONLY if ACPI is enabled on
ARM64
arm64: ACPI: additions of ACPI documentation for arm64
Graeme Gregory (6):
acpi: add arm64 to the platforms that use ioremap
ACPI / sleep: Introduce sleep_arm.c
ARM64 / ACPI: If we chose to boot from acpi then disable FDT
ARM64 / ACPI: Get PSCI flags in FADT for PSCI init
ARM64 / ACPI: Enable ARM64 in Kconfig
Documentation: ACPI for ARM64
Hanjun Guo (8):
ARM64 / ACPI: Introduce PCI stub functions for ACPI
dt / chosen: Add linux,uefi-stub-generated-dtb property
ARM64 / ACPI: Disable ACPI if FADT revision is less than 5.1
ACPI / table: Print GIC information when MADT is parsed
ARM64 / ACPI: Parse MADT for SMP initialization
ACPI / processor: Make it possible to get CPU hardware ID via GICC
ARM64 / ACPI: Introduce ACPI_IRQ_MODEL_GIC and register device's gsi
clocksource / arch_timer: Parse GTDT to initialize arch timer
Mark Salter (2):
acpi: fix acpi_os_ioremap for arm64
arm64: allow late use of early_ioremap
Tomasz Nowicki (1):
irqchip: Add GICv2 specific ACPI boot support
Documentation/arm/uefi.txt | 3 +
Documentation/arm64/acpi_object_usage.txt | 592 ++++++++++++++++++++++++++++++
Documentation/arm64/arm-acpi.txt | 506 +++++++++++++++++++++++++
Documentation/arm64/why_use_acpi.txt | 231 ++++++++++++
Documentation/kernel-parameters.txt | 3 +-
arch/arm64/Kconfig | 3 +
arch/arm64/include/asm/acenv.h | 18 +
arch/arm64/include/asm/acpi.h | 103 ++++++
arch/arm64/include/asm/cpu_ops.h | 1 +
arch/arm64/include/asm/fixmap.h | 3 +
arch/arm64/include/asm/pci.h | 6 +
arch/arm64/include/asm/psci.h | 3 +-
arch/arm64/include/asm/smp.h | 5 +-
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/acpi.c | 362 ++++++++++++++++++
arch/arm64/kernel/cpu_ops.c | 2 +-
arch/arm64/kernel/pci.c | 25 ++
arch/arm64/kernel/psci.c | 78 ++--
arch/arm64/kernel/setup.c | 58 ++-
arch/arm64/kernel/smp.c | 2 +-
arch/arm64/kernel/time.c | 7 +
drivers/acpi/Kconfig | 3 +-
drivers/acpi/Makefile | 4 +
drivers/acpi/bus.c | 3 +
drivers/acpi/osl.c | 6 +-
drivers/acpi/processor_core.c | 37 ++
drivers/acpi/sleep_arm.c | 28 ++
drivers/acpi/tables.c | 43 +++
drivers/clocksource/arm_arch_timer.c | 132 +++++--
drivers/firmware/efi/libstub/fdt.c | 8 +
drivers/irqchip/irq-gic.c | 102 +++++
drivers/irqchip/irqchip.c | 3 +
include/acpi/acpi_io.h | 6 +
include/linux/acpi.h | 16 +
include/linux/clocksource.h | 6 +
include/linux/irqchip/arm-gic-acpi.h | 31 ++
36 files changed, 2374 insertions(+), 66 deletions(-)
create mode 100644 Documentation/arm64/acpi_object_usage.txt
create mode 100644 Documentation/arm64/arm-acpi.txt
create mode 100644 Documentation/arm64/why_use_acpi.txt
create mode 100644 arch/arm64/include/asm/acenv.h
create mode 100644 arch/arm64/include/asm/acpi.h
create mode 100644 arch/arm64/kernel/acpi.c
create mode 100644 drivers/acpi/sleep_arm.c
create mode 100644 include/linux/irqchip/arm-gic-acpi.h
--
1.9.1