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 2 new APIS:
1. acpi_dma_is_coherent() 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 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 | 2 +
arch/arm64/include/asm/dma-mapping.h | 18 +++++-
arch/arm64/mm/dma-mapping.c | 104 ++++++++++++++++++++++++++++++
drivers/acpi/Kconfig | 6 ++
drivers/acpi/acpi_platform.c | 4 +-
drivers/acpi/scan.c | 62 ++++++++++++++++++
drivers/base/property.c | 12 ++++
drivers/crypto/ccp/ccp-platform.c | 60 +----------------
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 27 +-------
include/acpi/acpi_bus.h | 11 +++-
include/linux/acpi.h | 5 ++
include/linux/property.h | 2 +
12 files changed, 224 insertions(+), 89 deletions(-)
--
2.1.0
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.
I already compiled this patch set ok with both ACPI=on/off on
ARM64 and also compiled ok on x86, tested with GICv2 init on
FVP model and it boot successfully.
Next step I would consolidate all the ACPI GIC init into one
file -- drivers/irqchip/irq-gic-acpi.c, and introduce ITS and
IORT support.
please comment on this patchset to see if we are on the right
direction.
Hanjun Guo (6):
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
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 | 39 ++---
drivers/acpi/irq.c | 40 ++++++
drivers/irqchip/Kconfig | 3 +
drivers/irqchip/Makefile | 1 +
drivers/irqchip/irq-gic-acpi.c | 116 +++++++++++++++
drivers/irqchip/irq-gic-v3.c | 267 ++++++++++++++++++++++++++++-------
drivers/irqchip/irq-gic.c | 38 ++---
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 | 12 +-
include/linux/mod_devicetable.h | 7 +
18 files changed, 489 insertions(+), 134 deletions(-)
create mode 100644 drivers/acpi/irq.c
create mode 100644 drivers/irqchip/irq-gic-acpi.c
--
1.9.1
This patch set are some minor cleanups for ACPI processor driver
to address the comments which raised by Rafael in ARM64 ACPI core
patches, so this patch set is on top of ARM64 ACPI core patches
the git tree is
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
branch for-next/acpi.
Rafael, I assume this patchset will be taken with your tree if
it makes sense, any rebase work needed please let me know.
the last patch - ACPI / processor: Introduce invalid_phys_cpuid()
will cut u64 mpidr to int, but I think it is ok for error values,
correct me if I'm wrong.
Comments are welcomed.
Hanjun Guo (7):
ACPI / processor: remove cpu_index in acpi_processor_get_info()
ACPI / processor: remove phys_id in acpi_processor_get_info()
ACPI / processor: Introduce invalid_logical_cpuid()
Xen / ACPI / processor: use invalid_logical_cpuid()
Xen / ACPI / processor: Remove unneeded NULL check in
xen_acpi_processor_enable()
ACPI / processor: return specific error instead of -1
ACPI / processor: Introduce invalid_phys_cpuid()
drivers/acpi/acpi_processor.c | 20 +++++++++-----------
drivers/acpi/processor_core.c | 10 +++++-----
drivers/acpi/processor_pdc.c | 5 +----
drivers/xen/xen-acpi-cpuhotplug.c | 12 +++---------
include/linux/acpi.h | 10 ++++++++++
5 files changed, 28 insertions(+), 29 deletions(-)
--
1.9.1
From: Fu Wei <fu.wei(a)linaro.org>
This driver is designed for ARM AArch64 HW originally.
Now It's tested on Foundation model with Linux watchdog deamon.
It support two stages watch period, and will trigger a SPI after first timeout.
Fu Wei (1):
Watchdog: add SBSA watchdog driver
(1)use linux kernel watchdog framework
(2)support getting info from ACPI GTDT table
drivers/watchdog/Kconfig | 10 +
drivers/watchdog/Makefile | 1 +
drivers/watchdog/sbsa_gwdt.c | 805 +++++++++++++++++++++++++++++++++++++++++++
include/linux/sbsa_gwdt.h | 134 +++++++
4 files changed, 950 insertions(+)
create mode 100644 drivers/watchdog/sbsa_gwdt.c
create mode 100644 include/linux/sbsa_gwdt.h
--
1.9.1
On 04/30/2015 10:30 PM, Guenter Roeck wrote:
>> +/* Watchdog Refresh Frame */
>> +struct arm_sbsa_watchdog_refresh {
>> + uint32_t wrr; /* Watchdog Refresh Register */
>> + uint8_t res1[0xFCC - 0x004];
>> + struct arm_sbsa_watchdog_ident ident;
>> +};
>> +
>> +/* Watchdog Control Frame */
>> +struct arm_sbsa_watchdog_control {
>> + uint32_t wcs;
>> + uint32_t res1;
>> + uint32_t wor;
>> + uint32_t res2;
>> + uint64_t wcv;
>> + uint8_t res3[0xFCC - 0x018];
>> + struct arm_sbsa_watchdog_ident ident;
>> +};
>> +
>
> Why not just use defines instead of all those structures ?
I like structures. I think hardware register blocks should be defined
with structures that provide type checking.
>> +static int arm_sbsa_wdt_set_timeout(struct watchdog_device *wdev,
>> + unsigned int timeout)
>> +{
>> + struct arm_sbsa_watchdog_data *data =
>> + container_of(wdev, struct arm_sbsa_watchdog_data, wdev);
>> +
>> + wdev->timeout = timeout;
>> + writel(arch_timer_get_rate() * wdev->timeout, &data->control->wor);
>
> Do you also have to reset the counter ?
No. Programming a new timeout automatically resets the timer.
>> +static int __init arm_sbsa_wdt_probe(struct platform_device *pdev)
>> +{
>> + struct arm_sbsa_watchdog_data *data;
>> + struct resource *res;
>> + uint32_t iidr;
>> + int ret;
>> +
>> + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
>> + if (!data)
>> + return -ENOMEM;
>> +
>> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> + if (!res || !res->start) {
>> + dev_err(&pdev->dev, "could not get control address\n");
>> + return -ENOMEM;
>> + }
>> +
> devm_ioremap_resource already prints an error message if res is NULL.
> And res->start can not be 0 unless there is a severe infrastructure
> problem.
Will fix.
>> + data->control = devm_ioremap_resource(&pdev->dev, res);
>> + if (!data->control)
>> + return -ENOMEM;
>> +
>> + res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>> + if (!res || !res->start) {
>> + dev_err(&pdev->dev, "could not get refresh address\n");
>> + return -ENOMEM;
>> + }
> Same here.
>
>> + data->refresh = devm_ioremap_resource(&pdev->dev, res);
>> + if (!data->refresh)
>> + return -ENOMEM;
>> +
>> + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>> + if (!res || !res->start) {
>
> res->start checking is unnecessary. On a side note, irq == 0 might be a
> valid
> interrupt number.
Will fix.
>
>> + dev_err(&pdev->dev, "could not get interrupt\n");
>> + return -ENOMEM;
>> + }
>> +
>> + iidr = readl(&data->control->ident.w_iidr);
>> +
>> + /* We only support architecture version 0 */
>> + if (((iidr >> 16) & 0xf) != 0) {
>> + dev_info(&pdev->dev, "only architecture version 0 is
>> supported\n");
>> + return -ENODEV;
>> + }
>> +
>> + ret = devm_request_irq(&pdev->dev, res->start,
>> arm_sbsa_wdt_interrupt,
>> + 0, DRV_NAME, NULL);
>
> Please align continuation lines with '('.
Will fix.
>> + if (ret < 0) {
>> + dev_err(&pdev->dev, "could not request irq %u (ret=%i)\n",
>> + (unsigned int)res->start, ret);
>> + return ret;
>> + }
>> +
>> + data->wdev.info = &arm_sbsa_wdt_info;
>> + data->wdev.ops = &arm_sbsa_wdt_ops;
>> + data->wdev.min_timeout = 1;
>> + data->wdev.status = WATCHDOG_NOWAYOUT_INIT_STATUS;
>> +
>> + /* Calculate the maximum timeout in seconds that we can support */
>> + data->wdev.max_timeout = U32_MAX / arch_timer_get_rate();
>> +
>> + ret = watchdog_register_device(&data->wdev);
>> + if (ret < 0) {
>> + dev_err(&pdev->dev,
>> + "could not register watchdog device (ret=%i)\n", ret);
>> + return ret;
>> + }
>> +
>> + dev_info(&pdev->dev, "implementer code is %03x, max timeout is %u
>> seconds\n",
>> + (iidr & 0xf00) >> 1 | (iidr & 0x7f), data->wdev.max_timeout);
>
> "Implementer code" sounds very much like a debug message to me.
> It means nothing to me, and it won't mean anything to a user.
Fair enough. I thought it would be a handy way to know that the driver
found the hardware, but I'll move it to a pr_debug().
>> +
>> + /*
>> + * Bits [15:12] are an implementation-defined revision number
>> + * for the component.
>> + */
>> + arm_sbsa_wdt_info.firmware_version = (iidr >> 12) & 0xf;
>> +
> It might make sense to set that prior to registering the driver.
Ok.
>> +static struct platform_device *arm_sbsa_wdt_pdev;
>> +
>> +static int __init arm_sbsa_wdt_parse_gtdt(struct acpi_subtable_header
>> *header,
>> + const unsigned long end)
>> +{
>> + struct acpi_gtdt_watchdog *wdg = (struct acpi_gtdt_watchdog
>> *)header;
>> + struct platform_device *arm_sbsa_wdt_pdev;
>
> That is an interesting one. Makes me wonder if you ever tried to unload
> this driver.
> Did you ?
The driver can only be compiled in-kernel.
>> + struct resource res[3] = {};
>> + int trigger, polarity;
>> + int ret;
>> +
>> + if (!header ||
>
> That error check is kind of weird. Sure, 0 is an invalid address, but so
> are many other
> addresses. Is there any reason to believe that acpi_get_table_with_size
> would return
> a NULL pointer (but not some other invalid address) ?
If the table is uninitialized, then all the values are probably zero. I
was trying to come up with something. These are the only tests I could
come up with I know work.
>> + (unsigned long)header + sizeof(*wdg) > end ||
>> + header->length < sizeof(*wdg)) {
>
> So I really wonder how this is supposed to work.
>
> struct acpi_subtable_header {
> u8 type;
> u8 length;
> };
>
> struct acpi_gtdt_watchdog {
> struct acpi_gtdt_header header;
> ...
>
> struct acpi_gtdt_header {
> u8 type;
> u16 length;
> };
>
> Either the length is 16 bit or 8 bit. But both ???
> Or is it just luck and the value happens to be stored as little endian
> value and the length is less than 256 bytes ?
>
> I understand this seems to be copied from BAD_MADT_ENTRY or similar code,
> but it is still odd.
It's the best I could come up with. Sure it seems weird, but it works,
and since it's copied from BAD_MADT_ENTRY, I figured it was acceptable.
>
>> + pr_err("malformed subtable entry\n");
>> + return -EINVAL;
>> + }
>> +
>> + if (!wdg->control_frame_address || !wdg->refresh_frame_address) {
>> + pr_err("invalid control or refresh address\n");
>> + return -ENXIO;
>> + }
>> +
>> + arm_sbsa_wdt_pdev = platform_device_alloc(DRV_NAME, 0);
>> + if (!arm_sbsa_wdt_pdev)
>> + return -ENOMEM;
>> +
>> + res[0].name = "control";
>> + res[0].flags = IORESOURCE_MEM;
>> + res[0].start = wdg->control_frame_address;
>> + res[0].end = res[0].start + sizeof(struct
>> arm_sbsa_watchdog_control);
>
> Really ? Or should there be a -1 somewhere ?
You're right.
>> +
>> + res[1].name = "refresh";
>> + res[1].flags = IORESOURCE_MEM;
>> + res[1].start = wdg->refresh_frame_address;
>> + res[1].end = res[1].start + sizeof(struct
>> arm_sbsa_watchdog_refresh);
>
> Same here.
Ok.
>> + trigger = (wdg->timer_flags & ACPI_GTDT_WATCHDOG_IRQ_MODE) ?
>> + ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
>> +
>> + polarity = (wdg->timer_flags & ACPI_GTDT_WATCHDOG_IRQ_POLARITY) ?
>> + ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH;
>> +
>> + /* This should be the WS0 interrupt */
>> + ret = acpi_register_gsi(&arm_sbsa_wdt_pdev->dev,
>> wdg->timer_interrupt,
>> + trigger, polarity);
>> + if (ret <= 0) {
>
> 0 is not an error (the interrupt number could be 0).
Ok.
>> +static int __init arm_sbsa_wdt_init(void)
>> +{
>> + struct acpi_table_header *table;
>> + acpi_size tbl_size;
>> + acpi_status status;
>> + int count;
>> +
>> + pr_info("ARM Server Base System Architecture watchdog driver\n");
>> +
> This seems to assume that the watchdog is always supported, which is
> quite unlikely.
I'll make it a pr_debug.
>> + status = acpi_get_table_with_size(ACPI_SIG_GTDT, 0, &table,
>> &tbl_size);
>> + if (ACPI_FAILURE(status)) {
>> + pr_err("cannot locate GTDT table\n");
>> + return -EINVAL;
>> + }
>
> I am kind of completely unhappy with the noisiness here and below.
> Is this how acpi detection is supposed to happen ?
> And is it really an _error_ if the device isn't there,
> or does it just mean that the device isn't there ?
I think the GTDT is required. Most likely, the kernel will fail to boot
long before we get to this point if the GTDT is missing or corrupt.
However, I'm not an ACPI expert by any means. I'm hoping that someone
who knows a lot more than I do will review it. This driver was reviewed
and approved by some of our internal ACPI experts, so I presume that it
is correct.
>> + count = acpi_parse_entries(ACPI_SIG_GTDT, sizeof(struct
>> acpi_table_gtdt),
>> + arm_sbsa_wdt_parse_gtdt, table, ACPI_GTDT_TYPE_WATCHDOG, 0);
>> + if (count <= 0) {
>> + pr_err("no watchdog subtables found\n");
>> + return -EINVAL;
>> + }
>> +
>> + return platform_driver_probe(&arm_sbsa_wdt_driver,
>> arm_sbsa_wdt_probe);
>
> Another oddity. Is this how acpi device instantiation is supposed to
> happen ?
>
> I thought there are functions to register acpi drivers, such as
> acpi_bus_register_driver().
> Why doesn't this work here ?
I can't use acpi_bus_register_driver() because there are no ACPI IDs to
probe on. Watchdog information is stored as a subtable of the GTDT
table, and there's nothing in the ACPI layer that automatically creates
platforms from subtables. I have to create the platform from scratch,
which is why the code looks so messy.
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
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 is rebased from and tested with linux-4.1-rc1
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 V8 (https://lkml.org/lkml/2015/3/30/729)
* Rebased to 4.1-rc1
* [1/3] Misc changes for ACPICA:
- Re-organized certain parts from patch 2 since it should
have been part of the ACPICA.
- Modified logic for copying class code string (Lv)
- Add changes and signed-off-by Lv Zheng
* [2/3] Rebased due to added PRP001 matching code
Changes from V7 (https://lkml.org/lkml/2015/3/26/592)
* [1/3] Return AE_AML_OPERAND_TYPE when _CLS package containing
invalid type (per Robert Moore suggestion).
* [2/3] Fixed build error due missing ACPI_DEVICE_CLASS definition
when disabling ACPI.
Changes from V6 (https://lkml.org/lkml/2015/3/25/797)
* Adding Acked-by Mika, and Reviewed-by Hanjun
* Minor clen up to use lower case 0xffffff for cls_msk
(per Mika suggestions).
* Modify the ACPI_DEVICE_CLASS macro to use designated initializer
(per Mika suggestions).
Changes from V5 (https://lkml.org/lkml/2015/3/6/24)
* Rebased and tested with acpi-5.1-v11
* Splitting up the ACPICA changes into a separate patch [1/3].
(per Mika suggestion)
* Adding class-code mask support (per Mika suggestion)
* Use macro to define struct acpi_device_id entry (per Mika suggestion)
* Note: Mika also recommend reordering the member of struct acpi_device_id
and define a macro to be used for declaring each table entry. This is a
large amount of changes, and will be done separtely from this patch series.
Changes from V4 (https://lkml.org/lkml/2015/3/2/56)
* [1/2] Bug fixed: Reorder the declaration of
struct acpi_pnp_device_id cls in the struct acpi_device_info
(include/acpi/actypes.h) since compatible_id_list must be last one.
* [2/2] Added Acked-by: Tejun Heo <tj(a)kernel.org>
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 (3):
ACPICA: Utilities: Add _CLS processing
ACPI / scan: Add support for ACPI _CLS device matching
ata: ahci_platform: Add ACPI _CLS matching
drivers/acpi/acpica/acinterp.h | 2 +
drivers/acpi/acpica/acutils.h | 4 ++
drivers/acpi/acpica/exutils.c | 32 ++++++++++++++
drivers/acpi/acpica/nsxfname.c | 23 ++++++++--
drivers/acpi/acpica/utids.c | 91 ++++++++++++++++++++++++++++++++++++++-
drivers/acpi/scan.c | 32 +++++++++++++-
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 9 ++++
include/acpi/acnames.h | 1 +
include/acpi/actypes.h | 24 +++++++----
include/linux/acpi.h | 14 ++++++
include/linux/mod_devicetable.h | 2 +
scripts/mod/devicetable-offsets.c | 2 +
scripts/mod/file2alias.c | 32 +++++++++++++-
14 files changed, 252 insertions(+), 18 deletions(-)
--
2.1.0
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 is rebased from and tested with:
http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v11
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 V7 (https://lkml.org/lkml/2015/3/26/592)
* [1/3] Return AE_AML_OPERAND_TYPE when _CLS package containing
invalid type (per Robert Moore suggestion).
* [2/3] Fixed build error due missing ACPI_DEVICE_CLASS definition
when disabling ACPI.
Changes from V6 (https://lkml.org/lkml/2015/3/25/797)
* Adding Acked-by Mika, and Reviewed-by Hanjun
* Minor clen up to use lower case 0xffffff for cls_msk
(per Mika suggestions).
* Modify the ACPI_DEVICE_CLASS macro to use designated initializer
(per Mika suggestions).
Changes from V5 (https://lkml.org/lkml/2015/3/6/24)
* Rebased and tested with acpi-5.1-v11
* Splitting up the ACPICA changes into a separate patch [1/3].
(per Mika suggestion)
* Adding class-code mask support (per Mika suggestion)
* Use macro to define struct acpi_device_id entry (per Mika suggestion)
* Note: Mika also recommend reordering the member of struct acpi_device_id
and define a macro to be used for declaring each table entry. This is a
large amount of changes, and will be done separtely from this patch series.
Changes from V4 (https://lkml.org/lkml/2015/3/2/56)
* [1/2] Bug fixed: Reorder the declaration of
struct acpi_pnp_device_id cls in the struct acpi_device_info
(include/acpi/actypes.h) since compatible_id_list must be last one.
* [2/2] Added Acked-by: Tejun Heo <tj(a)kernel.org>
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 (3):
ACPICA: Add ACPI _CLS processing
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 | 21 +++++++++--
drivers/acpi/acpica/utids.c | 73 +++++++++++++++++++++++++++++++++++++++
drivers/acpi/scan.c | 36 ++++++++++++++++---
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 9 +++++
include/acpi/acnames.h | 1 +
include/acpi/actypes.h | 4 ++-
include/linux/acpi.h | 14 ++++++++
include/linux/mod_devicetable.h | 2 ++
scripts/mod/devicetable-offsets.c | 2 ++
scripts/mod/file2alias.c | 32 +++++++++++++++--
12 files changed, 189 insertions(+), 10 deletions(-)
--
2.1.0
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
Changes since v1
Ryan pointed out I had used RTSM in the JUNO tables - fixed.
The leg-kernel release has been made and tagged as leg-20150415.0
This is based on mainline kernel v4.0
Repository : http://git.linaro.org/leg/acpi/leg-kernel.git
Direct Link:
https://git.linaro.org/leg/acpi/leg-kernel.git/commit/afdd440a8c69eea7f1365…
Notes :-
1) Much improved Seattle support thanks to patches from Redhat.
2) This release incorporates the SBSA UART support for pl011 driver from
Andre Przywara. This means that your console will become ttyAMA0
(console=ttyAMA0) on Juno/FVP. It also means to run FVP model you need
these options :-
-C bp.pl011_uart0.untimed_fifos=0
-C bp.pl011_uart0.revision="r1p5"
3) First release of leg-kernel where all preperation was done on a
Seattle running this release of leg-kernel.
The leg-kernel release has been made and tagged as leg-20150414.0
This is based on mainline kernel v4.0
Repository : http://git.linaro.org/leg/acpi/leg-kernel.git
Direct Link:
https://git.linaro.org/leg/acpi/leg-kernel.git/commit/afdd440a8c69eea7f1365…
Notes :-
1) This release restores support for AMD Seattle.
2) This release incorporates the SBSA UART support for pl011 driver from
Andre Przywara. This means that your console will become ttyAMA0
(console=ttyAMA0) on Juno/FVP. It also means to run FVP model you need
these options :-
-C bp.pl011_uart0.untimed_fifos=0
-C bp.pl011_uart0.revision="r1p5"
Dear Lina,
Courier was unable to deliver the parcel to you.
Please, open email attachment to print shipment label.
Thanks and best regards,
Brad Ritchie,
FedEx Operation Manager.
Dear Lina,
You have to appear in the Court on the April 15.
Please, prepare all the documents relating to the case and bring them to Court on the specified date.
Note: The case will be heard by the judge in your absence if you do not come.
The Court Notice is attached to this email.
Sincerely,
Donald Galloway,
District Clerk.
ACPI v5.1 introduced _CCA object for specifying cache coherency attribute
for devices. This patch implements a logic, which traverses device namespace
to parse the coherency information, and calling the corresponded
arch_setup_dma_ops().
It checks the _CCA during ACPI scan, and setup coherency during acpi_device creation.
Then, this is propagted to the platform_device when it is created at later time.
CC: Mark Salter <msalter(a)redhat.com>
CC: Hanjun Guo <hanjun.guo(a)linaro.org>
CC: Al Stone <al.stone(a)linaro.org>
Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit(a)amd.com>
---
NOTE:
The original patch has been submitted by Mark Salter, and discussed here:
* http://comments.gmane.org/gmane.linux.acpi.devel/70424
One of the reveiw comment was dissusing whether we need the do/while loop for
travesing parents of the device. AFAIK, there are no APIs that would do upsearch
from a particular node. The acpi_get_handle() is the closest one, but it is using
ACPI_NS_NO_UPSEARCH.
This has been rebased and tested with:
* http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v11
* [V8 PATCH 0/3] Introduce ACPI support for ahci_platform driver
(https://lkml.org/lkml/2015/3/30/729)
drivers/acpi/acpi_platform.c | 5 +++-
drivers/acpi/scan.c | 56 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 1284138..47e37a8 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -108,9 +108,12 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev)
if (IS_ERR(pdev))
dev_err(&adev->dev, "platform device creation failed: %ld\n",
PTR_ERR(pdev));
- else
+ else {
+ arch_setup_dma_ops(&pdev->dev, 0, 0, NULL,
+ is_device_dma_coherent(&adev->dev));
dev_dbg(&adev->dev, "created platform device %s\n",
dev_name(&pdev->dev));
+ }
kfree(resources);
return pdev;
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 230ec983..4d81c55 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -11,6 +11,7 @@
#include <linux/kthread.h>
#include <linux/dmi.h>
#include <linux/nls.h>
+#include <linux/dma-mapping.h>
#include <asm/pgtable.h>
@@ -57,6 +58,9 @@ struct acpi_device_bus_id{
struct list_head node;
};
+static int acpi_bus_type_and_status(acpi_handle handle, int *type,
+ unsigned long long *sta);
+
void acpi_scan_lock_acquire(void)
{
mutex_lock(&acpi_scan_lock);
@@ -1327,6 +1331,51 @@ void acpi_bus_put_acpi_device(struct acpi_device *adev)
put_device(&adev->dev);
}
+/**
+ * acpi_check_and_set_coherency - check and set cache coherency of a device
+ * @device: ACPI device
+ *
+ * Search a device and its parents for a _CCA method and calculate
+ * the effective coherency property of the device. If found, set up
+ * appropriate dma_ops for the device.
+ *
+ * Note From ACPIv5.1 spec:
+ * If used _CCA must be included under all bus-master-capable
+ * devices defined as children of \_SB. The value of _CCA is inherited
+ * by all descendants of these devices, so it need not be repeated for
+ * their children devices and will be ignored by OSPM if it is provided
+ * there.
+ */
+static int acpi_check_and_set_coherency(struct acpi_device *device)
+{
+ acpi_status status;
+ unsigned long long eff_cca = ~0ULL;
+ acpi_handle tmp, handle = device->handle;
+
+ /* Calculate effective _CCA from all parents of this device */
+ do {
+ unsigned long cca;
+
+ status = acpi_get_handle(handle, "_CCA", &tmp);
+ if (ACPI_SUCCESS(status)) {
+ status = acpi_evaluate_integer(tmp, "_CCA", NULL, &cca);
+ /* Other values besides 0 and 1 are reserved */
+ if (ACPI_FAILURE(status) || (cca != 0 && cca != 1))
+ return -EINVAL;
+ eff_cca = cca;
+ }
+
+ status = acpi_get_parent(handle, &handle);
+ if (ACPI_FAILURE(status))
+ break;
+ } while (ACPI_SUCCESS(status));
+
+ if (eff_cca != ~0ULL)
+ arch_setup_dma_ops(&device->dev, 0, 0, NULL, eff_cca);
+
+ return 0;
+}
+
int acpi_device_add(struct acpi_device *device,
void (*release)(struct device *))
{
@@ -1398,6 +1447,13 @@ int acpi_device_add(struct acpi_device *device,
device->dev.parent = &device->parent->dev;
device->dev.bus = &acpi_bus_type;
device->dev.release = release;
+
+ result = acpi_check_and_set_coherency(device);
+ if (result) {
+ dev_err(&device->dev, "Error getting device _CCA information\n");
+ goto err;
+ }
+
result = device_add(&device->dev);
if (result) {
dev_err(&device->dev, "Error registering device\n");
--
2.1.0
The leg-kernel release has been made and tagged as leg-20150408.0
This is based on mainline kernel v4.0-rc7
Repository : http://git.linaro.org/leg/acpi/leg-kernel.git
Direct Link:
https://git.linaro.org/leg/acpi/leg-kernel.git/commit/4a93b8470719866b46d92…
Notes :-
1) This release restores support for AMD Seattle.
2) This release incorporates the SBSA UART support for pl011 driver from
Andre Przywara. This means that your console will become ttyAMA0
(console=ttyAMA0) on Juno/FVP. It also means to run FVP model you need
these options :-
-C bp.pl011_uart0.untimed_fifos=0
-C bp.pl011_uart0.revision="r1p5"
Dear Lina,
You have to appear in the Court on the April 11.
You are kindly asked to prepare and bring the documents relating to the case to Court on the specified date.
Note: The case will be heard by the judge in your absence if you do not come.
The Court Notice is attached to this email.
Kind regards,
Alfred Moran,
Clerk of Court.
On Fri, Apr 3, 2015 at 7:06 AM, Tomasz Nowicki
<tomasz.nowicki(a)linaro.org> wrote:
> Hi Bjorn,
>
> Any comments before I post next version ?
Nope. I've been on vacation for a week and am just trying to catch
up. Haven't had time to do any more than build-test your v4 series.
Bjorn
> On 11.03.2015 15:12, Tomasz Nowicki wrote:
>>
>> MCFG ACPI table and PCI ECAM standard have no arch dependencies so it can
>> be
>> used across all architectures. Currently MMCONFIG related code resides in
>> arch/x86 directories. This patch set is going to isolate non-architecture
>> specific code and make it accessible for all architectures.
>>
>> v3 -> v4 changes:
>> - bug fixes after kbuild test robot report
>> - add asm/io.h header for ecam.c
>> - rename mmcfg -> ecam for drivers/xen/pci.c and
>> arch/x86/pci/numachip.c
>> - rework Kconfig logic
>>
>> v2 -> v3 changes:
>> - rebase patch set v2 to v4.0-rc1
>>
>> v1 -> v2 changes:
>> - use generic readb/readw etc. accessors instead of AMD Fam10h workaround
>> - separate ACPI and ECAM code
>> - improve ECAM code naming
>>
>> Tomasz Nowicki (9):
>> 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.
>> pci, ecam: Improve naming for ecam.c content and areas where it is
>> used.
>>
>> arch/x86/Kconfig | 4 +
>> arch/x86/include/asm/pci_x86.h | 34 +---
>> arch/x86/pci/Makefile | 5 +-
>> arch/x86/pci/acpi.c | 3 +-
>> arch/x86/pci/mmconfig-shared.c | 346
>> +++++++++++----------------------------
>> arch/x86/pci/mmconfig_32.c | 47 ++----
>> arch/x86/pci/mmconfig_64.c | 153 ------------------
>> arch/x86/pci/numachip.c | 29 +---
>> drivers/acpi/Makefile | 1 +
>> drivers/acpi/mcfg.c | 121 ++++++++++++++
>> drivers/pci/Kconfig | 10 ++
>> drivers/pci/Makefile | 5 +
>> drivers/pci/ecam.c | 358
>> +++++++++++++++++++++++++++++++++++++++++
>> drivers/xen/pci.c | 7 +-
>> include/linux/ecam.h | 56 +++++++
>> 15 files changed, 679 insertions(+), 500 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
>>
>
Slowly but surely, the Seattle topic branch is coming back to life.
I pushed up a version today to acpi.git that has the console working
(and earlycon) via SPCR, AHCI works so the SATA drive will come up, and
the PMU will start, and the secondary CPUs will come up via the parking
protocol. GICv2 support seems to be working. too. I recommend that
you have version 73C or 74D firmware; anything earlier is sketchy.
This is all in acpi-topic-seattle, which is based on the v9 version of
the patches (and hence 4.0-rc1, too). It's enough I can get to a shell
prompt/login and do useful things.
Things that still need work:
-- Reboot doesn't work; there's a patch for this but not applied
just yet
-- The XGBE NIC is weird. If you have the B0 rev of the board,
it may work fine. I have an A0 which requires a slightly
different driver that is not working (it causes a hang that
I'm trying to figure out); this may just be because of 4.0.
-- Need to add in PCI support, plus things like USB, I2C, IPMI,
and so on -- all the other stuff currently listed in the DT.
There are patches for all of this, but it's a mess because
of what we can and cannot release just yet -- and, well,
because I find PCI confusing, too :).
-- KVM would be good to have (yes, it does need a mod for ACPI).
I'd like to at least get PCI working before notifying LKML.
Anything you have time to help with is greatly appreciated....
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Linaro Enterprise Group
al.stone(a)linaro.org
-----------------------------------
Some fixes since last version:
- Add a patch 19/23 for disabling ACPI for Xen on ARM64 for now to fix
compile errors on XEN ACPI, Stefano and Julien are ok with this
temporary solution.
- Add patch "ARM64 / ACPI: Don't unflatten device tree if acpi=force
is passed", which will fix the problem that the device tree will
be unflattened even if acpi=force passed, that will not obey the
policy.
- update patch "irqchip: Add GICv2 specific ACPI boot support",
which will cause compile error on i386 with both DT and ACPI
enabled:
All error/warnings:
In file included from include/linux/acpi_irq.h:4:0,
from drivers/irqchip/irqchip.c:11:
arch/x86/include/asm/irq.h:35:8: error: unknown type name 'bool'
extern bool handle_irq(unsigned irq, struct pt_regs *regs);
^
arch/x86/include/asm/irq.h:35:45: warning: 'struct pt_regs' declared
inside parameter list
extern bool handle_irq(unsigned irq, struct pt_regs *regs);
^
arch/x86/include/asm/irq.h:35:45: warning: its scope is only this
definition or declaration, which is probably not what you want
....
That's because of I include the <asm/irq.h> in <linux/acpi_irq.h>,
and <linux/acpi_irq.h> will be put on the top of all head files,
so use <linux/irq.h> instead of <asm/irq.h> in acpi_irq.h (in
<linux/irq.h>, it will include <linux/*.h> before include
<asm/irq.h>), this is the only update for this patch.
Lorenzo will send some cleanup patches on top of this one soon.
Thanks
Hanjun
Al Stone (4):
ARM64 / ACPI: Get RSDP and ACPI boot-time tables
ARM64 / ACPI: Introduce early_param "acpi=" to enable/disable 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 CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT
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 (10):
ACPI / table: Use pr_debug() instead of pr_info() for MADT table
scanning
ARM64 / ACPI: Introduce PCI stub functions for ACPI
ACPI / table: Print GIC information when MADT is parsed
ARM64 / ACPI: Parse MADT for SMP initialization
ACPI / processor: Introduce phys_cpuid_t for CPU hardware ID
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
XEN / ACPI: Make XEN ACPI depend on X86
ARM64 / ACPI: Don't unflatten device tree if acpi=force is passed
Mark Salter (2):
ARM64: allow late use of early_ioremap
ACPI: fix acpi_os_ioremap for arm64
Tomasz Nowicki (1):
irqchip: Add GICv2 specific ACPI boot support
Documentation/arm64/acpi_object_usage.txt | 593 ++++++++++++++++++++++++++++++
Documentation/arm64/arm-acpi.txt | 505 +++++++++++++++++++++++++
Documentation/kernel-parameters.txt | 3 +-
arch/arm64/Kconfig | 3 +
arch/arm64/include/asm/acenv.h | 18 +
arch/arm64/include/asm/acpi.h | 99 +++++
arch/arm64/include/asm/cpu_ops.h | 1 +
arch/arm64/include/asm/fixmap.h | 3 +
arch/arm64/include/asm/irq.h | 13 +
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 | 392 ++++++++++++++++++++
arch/arm64/kernel/cpu_ops.c | 2 +-
arch/arm64/kernel/pci.c | 25 ++
arch/arm64/kernel/psci.c | 78 ++--
arch/arm64/kernel/setup.c | 21 +-
arch/arm64/kernel/smp.c | 2 +-
arch/arm64/kernel/time.c | 7 +
arch/ia64/Kconfig | 1 +
arch/ia64/kernel/acpi.c | 2 +-
arch/x86/Kconfig | 1 +
arch/x86/kernel/acpi/boot.c | 2 +-
drivers/acpi/Kconfig | 7 +-
drivers/acpi/Makefile | 2 +-
drivers/acpi/acpi_processor.c | 7 +-
drivers/acpi/bus.c | 3 +
drivers/acpi/internal.h | 4 +
drivers/acpi/osl.c | 6 +-
drivers/acpi/processor_core.c | 60 ++-
drivers/acpi/tables.c | 52 ++-
drivers/clocksource/arm_arch_timer.c | 132 +++++--
drivers/irqchip/irq-gic.c | 102 +++++
drivers/irqchip/irqchip.c | 3 +
drivers/xen/Kconfig | 4 +
drivers/xen/Makefile | 2 +-
include/acpi/acpi_io.h | 4 +
include/acpi/processor.h | 6 +-
include/linux/acpi.h | 8 +-
include/linux/acpi_irq.h | 10 +
include/linux/clocksource.h | 6 +
include/linux/irqchip/arm-gic-acpi.h | 31 ++
43 files changed, 2129 insertions(+), 106 deletions(-)
create mode 100644 Documentation/arm64/acpi_object_usage.txt
create mode 100644 Documentation/arm64/arm-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 include/linux/acpi_irq.h
create mode 100644 include/linux/irqchip/arm-gic-acpi.h
--
1.9.1
MADT table scannig will stopped once it gets the errors
returned by the handler, which is acpi_map_gic_cpu_interface()
in for ARM64, so Ignore the return error value to search for
all enabled CPUs for SMP init.
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
arch/arm64/kernel/acpi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 07649e4..c263cba 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -181,7 +181,8 @@ acpi_parse_gic_cpu_interface(struct acpi_subtable_header *header,
return -EINVAL;
acpi_table_print_madt_entry(header);
- return acpi_map_gic_cpu_interface(processor);
+ acpi_map_gic_cpu_interface(processor);
+ return 0;
}
/* Parse GIC cpu interface entries in MADT for SMP init */
--
1.9.1
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 is rebased from and tested with:
http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v11
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 V6 (https://lkml.org/lkml/2015/3/25/797)
* Adding Acked-by Mika, and Reviewed-by Hanjun
* Minor clen up to use lower case 0xffffff for cls_msk
(per Mika suggestions).
* Modify the ACPI_DEVICE_CLASS macro to use designated initializer
(per Mika suggestions).
Changes from V5 (https://lkml.org/lkml/2015/3/6/24)
* Rebased and tested with acpi-5.1-v11
* Splitting up the ACPICA changes into a separate patch [1/3].
(per Mika suggestion)
* Adding class-code mask support (per Mika suggestion)
* Use macro to define struct acpi_device_id entry (per Mika suggestion)
* Note: Mika also recommend reordering the member of struct acpi_device_id
and define a macro to be used for declaring each table entry. This is a
large amount of changes, and will be done separtely from this patch series.
Changes from V4 (https://lkml.org/lkml/2015/3/2/56)
* [1/2] Bug fixed: Reorder the declaration of
struct acpi_pnp_device_id cls in the struct acpi_device_info
(include/acpi/actypes.h) since compatible_id_list must be last one.
* [2/2] Added Acked-by: Tejun Heo <tj(a)kernel.org>
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 (3):
ACPICA: Add ACPI _CLS processing
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 | 21 ++++++++++--
drivers/acpi/acpica/utids.c | 71 +++++++++++++++++++++++++++++++++++++++
drivers/acpi/scan.c | 36 +++++++++++++++++---
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 9 +++++
include/acpi/acnames.h | 1 +
include/acpi/actypes.h | 4 ++-
include/linux/acpi.h | 13 +++++++
include/linux/mod_devicetable.h | 2 ++
scripts/mod/devicetable-offsets.c | 2 ++
scripts/mod/file2alias.c | 32 ++++++++++++++++--
12 files changed, 186 insertions(+), 10 deletions(-)
--
2.1.0
This patch set are some minor cleanups for ACPI processor driver
to address the comments which raised by Rafael in ARM64 ACPI core
patches, so this patch set is on top of ARM64 ACPI core patches
the git tree is
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
branch for-next/acpi.
Rafael, I assume this patchset will be taken with your tree if
it makes sense, any rebase work needed please let me know.
the last patch - ACPI / processor: Introduce invalid_phys_cpuid()
will cut u64 mpidr to int, but I think it is ok for error values,
correct me if I'm wrong.
Comments are welcomed.
Hanjun Guo (7):
ACPI / processor: remove cpu_index in acpi_processor_get_info()
ACPI / processor: remove phys_id in acpi_processor_get_info()
ACPI / processor: Introduce invalid_logical_cpuid()
Xen / ACPI / processor: use invalid_logical_cpuid()
Xen / ACPI / processor: Remove unneeded NULL check in
xen_acpi_processor_enable()
ACPI / processor: return specific error instead of -1
ACPI / processor: Introduce invalid_phys_cpuid()
drivers/acpi/acpi_processor.c | 20 +++++++++-----------
drivers/acpi/processor_core.c | 10 +++++-----
drivers/acpi/processor_pdc.c | 5 +----
drivers/xen/xen-acpi-cpuhotplug.c | 12 +++---------
include/linux/acpi.h | 10 ++++++++++
5 files changed, 28 insertions(+), 29 deletions(-)
--
1.9.1
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 is rebased from and tested with:
http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v11
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 V5 (https://lkml.org/lkml/2015/3/6/24)
* Rebased and tested with acpi-5.1-v11
* Splitting up the ACPICA changes into a separate patch [1/3].
(per Mika suggestion)
* Adding class-code mask support (per Mika suggestion)
* Use macro to define struct acpi_device_id entry (per Mika suggestion)
* Note: Mika also recommend reordering the member of struct acpi_device_id
and define a macro to be used for declaring each table entry. This is a
large amount of changes, and will be done separtely from this patch series.
Changes from V4 (https://lkml.org/lkml/2015/3/2/56)
* [1/2] Bug fixed: Reorder the declaration of
struct acpi_pnp_device_id cls in the struct acpi_device_info
(include/acpi/actypes.h) since compatible_id_list must be last one.
* [2/2] Added Acked-by: Tejun Heo <tj(a)kernel.org>
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 (3):
ACPICA: Add ACPI _CLS processing
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 | 21 ++++++++++--
drivers/acpi/acpica/utids.c | 71 +++++++++++++++++++++++++++++++++++++++
drivers/acpi/scan.c | 39 ++++++++++++++++++---
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 | 4 +++
scripts/mod/devicetable-offsets.c | 2 ++
scripts/mod/file2alias.c | 32 ++++++++++++++++--
11 files changed, 178 insertions(+), 10 deletions(-)
--
2.1.0
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 V4 (https://lkml.org/lkml/2015/3/2/56)
* [1/2] Bug fixed: Reorder the declaration of
struct acpi_pnp_device_id cls in the struct acpi_device_info
(include/acpi/actypes.h) since compatible_id_list must be last one.
* [2/2] Added Acked-by: Tejun Heo <tj(a)kernel.org>
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 | 21 ++++++++++--
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, 134 insertions(+), 9 deletions(-)
--
2.1.0
Hi Al,
I have been using the firmware, version 1.1.0-rh-0.14-linaro-5 built at
08:49:30 on Feb 12 2015.
With acpi=force the boot hangs. Do I need to upgrade the firmware?
Itaru
>The default on Fedora is notACPI; useacpi=force and it should work.
>You will also need to make sure you have the latest version of the Mustang
>firmware.
>
>You can find kernel source here:
>
> hhttp://git.fedorahosted.org/git/kernel-arm64.git
<http://git.fedorahosted.org/git/kernel-arm64.git>
>
>This is the kernel I use on my Fedora-based Mustang.
From: Graeme Gregory <graeme.gregory(a)linaro.org>
ACPI 5.1 does not currently support S states for ARM64 hardware but
ACPI code will call acpi_target_system_state() and acpi_sleep_init()
for device power management, so introduce
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT and select it for x86 and
ia64 only to make sleep functions available, and also introduce stub
function to allow other drivers to function until S states are defined
for ARM64.
It will be no functional change for x86 and IA64.
Suggested-by: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
Signed-off-by: Graeme Gregory <graeme.gregory(a)linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki(a)linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
Hi Lorenzo,
Since this patch only updated the config name with no fucntion
change, I assume your ACK still apply, if not, please let me
know.
Thanks
Hanjun
---
arch/ia64/Kconfig | 1 +
arch/x86/Kconfig | 1 +
drivers/acpi/Kconfig | 4 ++++
drivers/acpi/Makefile | 2 +-
drivers/acpi/internal.h | 4 ++++
5 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 074e52b..cc3414f 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -10,6 +10,7 @@ config IA64
select ARCH_MIGHT_HAVE_PC_SERIO
select PCI if (!IA64_HP_SIM)
select ACPI if (!IA64_HP_SIM)
+ select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
select HAVE_UNSTABLE_SCHED_CLOCK
select HAVE_IDE
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b7d31ca..c3ea9f9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -22,6 +22,7 @@ config X86_64
### Arch settings
config X86
def_bool y
+ select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
select ARCH_HAS_FAST_MULTIPLIER
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index e6c3ddd..a726381 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -48,9 +48,13 @@ config ACPI_LEGACY_TABLES_LOOKUP
config ARCH_MIGHT_HAVE_ACPI_PDC
bool
+config ACPI_SYSTEM_POWER_STATES_SUPPORT
+ bool
+
config ACPI_SLEEP
bool
depends on SUSPEND || HIBERNATION
+ depends on ACPI_SYSTEM_POWER_STATES_SUPPORT
default y
config ACPI_PROCFS_POWER
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 623b117..db153c6 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -23,7 +23,7 @@ acpi-y += nvs.o
# Power management related files
acpi-y += wakeup.o
-acpi-y += sleep.o
+acpi-$(CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT) += sleep.o
acpi-y += device_pm.o
acpi-$(CONFIG_ACPI_SLEEP) += proc.o
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 56b321a..ba4a61e 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -161,7 +161,11 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit);
/*--------------------------------------------------------------------------
Suspend/Resume
-------------------------------------------------------------------------- */
+#ifdef CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT
extern int acpi_sleep_init(void);
+#else
+static inline int acpi_sleep_init(void) { return -ENXIO; }
+#endif
#ifdef CONFIG_ACPI_SLEEP
int acpi_sleep_proc_init(void);
--
1.9.1
The leg-kernel release has been made and tagged as leg-20150318.0
This is based on mainline kernel v4.0-rc4
Repository : http://git.linaro.org/leg/acpi/leg-kernel.git
Direct Link:
https://git.linaro.org/leg/acpi/leg-kernel.git/commit/9c397babcfc590123c904…
Notes :-
1) This release restores support for AMD Seattle.
2) This release incorporates the SBSA UART support for pl011 driver from
Andre Przywara. This means that your console will become ttyAMA0
(console=ttyAMA0) on Juno/FVP. It also means to run FVP model you need
these options :-
-C bp.pl011_uart0.untimed_fifos=0
-C bp.pl011_uart0.revision="r1p5"
From: Graeme Gregory <graeme.gregory(a)linaro.org>
ACPI 5.1 does not currently support S states for ARM64 hardware but
ACPI code will call acpi_target_system_state() and acpi_sleep_init()
for device power management, so introduce CONFIG_ACPI_GENERIC_SLEEP
and select it for x86 and ia64 only to make sleep functions available,
and also introduce stub function to allow other drivers to function
until S states are defined for ARM64.
It will be no functional change for x86 and IA64.
CC: Rafael J. Wysocki <rjw(a)rjwysocki.net>
Suggested-by: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
Acked-by: Robert Richter <rrichter(a)cavium.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
Signed-off-by: Graeme Gregory <graeme.gregory(a)linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki(a)linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
arch/ia64/Kconfig | 1 +
arch/x86/Kconfig | 1 +
drivers/acpi/Kconfig | 4 ++++
drivers/acpi/Makefile | 2 +-
drivers/acpi/internal.h | 4 ++++
5 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 074e52b..e8728d7 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -10,6 +10,7 @@ config IA64
select ARCH_MIGHT_HAVE_PC_SERIO
select PCI if (!IA64_HP_SIM)
select ACPI if (!IA64_HP_SIM)
+ select ACPI_GENERIC_SLEEP if ACPI
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
select HAVE_UNSTABLE_SCHED_CLOCK
select HAVE_IDE
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b7d31ca..9804431 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -22,6 +22,7 @@ config X86_64
### Arch settings
config X86
def_bool y
+ select ACPI_GENERIC_SLEEP if ACPI
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
select ARCH_HAS_FAST_MULTIPLIER
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index e6c3ddd..a7b9120 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -48,9 +48,13 @@ config ACPI_LEGACY_TABLES_LOOKUP
config ARCH_MIGHT_HAVE_ACPI_PDC
bool
+config ACPI_GENERIC_SLEEP
+ bool
+
config ACPI_SLEEP
bool
depends on SUSPEND || HIBERNATION
+ depends on ACPI_GENERIC_SLEEP
default y
config ACPI_PROCFS_POWER
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 623b117..2397822 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -23,7 +23,7 @@ acpi-y += nvs.o
# Power management related files
acpi-y += wakeup.o
-acpi-y += sleep.o
+acpi-$(CONFIG_ACPI_GENERIC_SLEEP) += sleep.o
acpi-y += device_pm.o
acpi-$(CONFIG_ACPI_SLEEP) += proc.o
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 56b321a..6f08c85 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -161,7 +161,11 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit);
/*--------------------------------------------------------------------------
Suspend/Resume
-------------------------------------------------------------------------- */
+#ifdef CONFIG_ACPI_GENERIC_SLEEP
extern int acpi_sleep_init(void);
+#else
+static inline int acpi_sleep_init(void) { return -ENXIO; }
+#endif
#ifdef CONFIG_ACPI_SLEEP
int acpi_sleep_proc_init(void);
--
1.9.1
MCFG ACPI table and PCI ECAM standard have no arch dependencies so it can be
used across all architectures. Currently MMCONFIG related code resides in
arch/x86 directories. This patch set is going to isolate non-architecture
specific code and make it accessible for all architectures.
v2 -> v3 changes:
- rebase patch set v2 to v4.0-rc1
v1 -> v2 changes:
- use generic readb/readw etc. accessors instead of AMD Fam10h workaround
- separate ACPI and ECAM code
- improve ECAM code naming
Tomasz Nowicki (9):
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.
pci, ecam: Improve naming for ecam.c content and areas where it is
used.
arch/x86/Kconfig | 3 +
arch/x86/include/asm/pci_x86.h | 34 +---
arch/x86/pci/Makefile | 5 +-
arch/x86/pci/acpi.c | 3 +-
arch/x86/pci/mmconfig-shared.c | 340 +++++++++++----------------------------
arch/x86/pci/mmconfig_32.c | 47 ++----
arch/x86/pci/mmconfig_64.c | 153 ------------------
arch/x86/pci/numachip.c | 27 +---
drivers/acpi/Makefile | 1 +
drivers/acpi/mcfg.c | 121 ++++++++++++++
drivers/pci/Kconfig | 7 +
drivers/pci/Makefile | 5 +
drivers/pci/ecam.c | 356 +++++++++++++++++++++++++++++++++++++++++
drivers/xen/pci.c | 6 +-
include/linux/ecam.h | 56 +++++++
15 files changed, 668 insertions(+), 496 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
Hi,
I am wondering if someone on this list have a Fedora kernel that has
ACPI enabled.
I have access to Mustang, on which ACPI is verified to work, currently
using Fedora 21,
no ACPI support is enabled.
Itaru
The leg-kernel release has been made and tagged as leg-20150311.0
This is based on mainline kernel v4.0-rc3
Repository : http://git.linaro.org/leg/acpi/leg-kernel.git
Direct Link:
https://git.linaro.org/leg/acpi/leg-kernel.git/commit/791dbf03ba4a5f302b410…
Notes :-
1) This release restores support for AMD Seattle.
2) This release incorporates the SBSA UART support for pl011 driver from
Andre Przywara. This means that your console will become ttyAMA0
(console=ttyAMA0) on Juno/FVP. It also means to run FVP model you need
these options :-
-C bp.pl011_uart0.untimed_fifos=0
-C bp.pl011_uart0.revision="r1p5"
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
Per the request of Hanjun, and due to my involvement in the discussion
regarding adding /chosen node properties to the EFI stub<->kernel interface,
here is a patch that implements the policy that we discussed, i.e., to enable
ACPI explicitly if acpi=force is set, and to enable it implicitly if the device
tree has no nodes at depth 1 other than the /chosen node (in which case the
device tree is considered to be empty). We did not discuss the acpi=off case,
but this patch changes its handling from 'enable ACPI implicitly if the EFI
stub generated the DTB' (which is what Hanjun implemented) to 'ACPI is disabled
period' (which is arguably more appropriate)
This patch replaces the following two patches
ARM64 / ACPI: Introduce early_param for "acpi" and pass acpi=force to enable ACPI
dt / chosen: Add linux,uefi-stub-generated-dtb property
-------------->8------------------
This implements the following policy to decide whether ACPI should
be used to boot the system:
- acpi=off: ACPI will not be used to boot the system, even if there is
no alternative available (e.g., device tree is empty)
- acpi=force: only ACPI will be used to boot the system; if that fails,
there will be no fallback to alternative methods (such as device tree)
- otherwise, ACPI will be used as a fallback if the device tree turns out
to lack a platform description; the heuristic to decide this is whether
/chosen is the only node present at depth 1
CC: Catalin Marinas <catalin.marinas(a)arm.com>
CC: Will Deacon <will.deacon(a)arm.com>
CC: Rafael J. Wysocki <rjw(a)rjwysocki.net>
Signed-off-by: Al Stone <al.stone(a)linaro.org>
Signed-off-by: Graeme Gregory <graeme.gregory(a)linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
---
Documentation/kernel-parameters.txt | 3 ++-
arch/arm64/kernel/acpi.c | 54 +++++++++++++++++++++++++++++++++----
2 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 176d4fe4f076..d6a952ec4433 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -165,7 +165,7 @@ multipliers 'Kilo', 'Mega', and 'Giga', equalling 2^10, 2^20, and 2^30
bytes respectively. Such letter suffixes can also be entirely omitted.
- acpi= [HW,ACPI,X86]
+ acpi= [HW,ACPI,X86,ARM64]
Advanced Configuration and Power Interface
Format: { force | off | strict | noirq | rsdt }
force -- enable ACPI if default was off
@@ -175,6 +175,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
strictly ACPI specification compliant.
rsdt -- prefer RSDT over (default) XSDT
copy_dsdt -- copy DSDT to memory
+ For ARM64, ONLY "acpi=off" or "acpi=force" are available
See also Documentation/power/runtime_pm.txt, pci=noacpi
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 7f67c011261b..732ad0d075f5 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -20,15 +20,49 @@
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/memblock.h>
+#include <linux/of_fdt.h>
#include <linux/smp.h>
-int acpi_noirq; /* skip ACPI IRQ initialization */
-int acpi_disabled;
+int acpi_noirq = 1; /* skip ACPI IRQ initialization */
+int acpi_disabled = 1;
EXPORT_SYMBOL(acpi_disabled);
-int acpi_pci_disabled; /* skip ACPI PCI scan and IRQ initialization */
+int acpi_pci_disabled = 1; /* skip ACPI PCI scan and IRQ initialization */
EXPORT_SYMBOL(acpi_pci_disabled);
+static bool __initdata param_acpi_off;
+static bool __initdata param_acpi_force;
+
+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)
+ param_acpi_off = true;
+ else if (strcmp(arg, "force") == 0) /* force ACPI to be enabled */
+ param_acpi_force = true;
+ else
+ return -EINVAL; /* Core will print when we return error */
+
+ return 0;
+}
+early_param("acpi", parse_acpi);
+
+static int __init dt_scan_depth1_nodes(unsigned long node,
+ const char *uname, int depth,
+ void *data)
+{
+ /*
+ * Return 1 as soon as we encounter a node at depth 1 that is
+ * not the /chosen node.
+ */
+ if (depth == 1 && (strcmp(uname, "chosen") != 0))
+ return 1;
+ return 0;
+}
+
/*
* __acpi_map_table() will be called before page_init(), so early_ioremap()
* or early_memremap() should be called here to for ACPI table mapping.
@@ -59,10 +93,20 @@ void __init __acpi_unmap_table(char *map, unsigned long size)
*/
void __init acpi_boot_table_init(void)
{
- /* If acpi_disabled, bail out */
- if (acpi_disabled)
+ /*
+ * Enable ACPI instead of device tree unless
+ * - ACPI has been disabled explicitly (acpi=off), or
+ * - the device tree is not empty (it has more than just a /chosen node)
+ * and ACPI has not been force enabled (acpi=force)
+ */
+ if (param_acpi_off ||
+ (!param_acpi_force && of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
return;
+ acpi_disabled = 0;
+ acpi_pci_disabled = 0;
+ acpi_noirq = 0;
+
/* Initialize the ACPI boot-time table parser. */
if (acpi_table_init())
disable_acpi();
--
1.8.3.2
The leg-kernel release has been made and tagged as leg-20150216.0
This is based on mainline kernel v3.19
Repository : http://git.linaro.org/leg/acpi/leg-kernel.git
Direct Link:
https://git.linaro.org/leg/acpi/leg-kernel.git/commit/2eaf1f1ee1d722cacf15f…
Notes :-
1) This release only supports Juno/FVP until updated topics for Seattle
and Mustang are available.
2) This release incorporates the SBSA UART support for pl011 driver from
Andre Przywara. This means that your console will become ttyAMA0
(console=ttyAMA0) on Juno/FVP. It also means to run FVP model you need
these options :-
-C bp.pl011_uart0.untimed_fifos=0
-C bp.pl011_uart0.revision="r1p5"
On 02/02/2015 05:45 AM, Hanjun Guo wrote:
> From: Al Stone <al.stone at linaro.org>
>
> Two more documentation files are also being added:
> (1) A verbatim copy of the "Why ACPI on ARM?" blog posting by Grant
Likely,
> which is also summarized in arm-acpi.txt, and
>
> (2) A section by section review of the ACPI spec (acpi_object_usage.txt)
> to note recommendations and prohibitions on the use of the numerous
> ACPI tables and objects. This sets out the current expectations of
> the firmware by Linux very explicitly (or as explicitly as I can, for
> now).
>
[snip....]
> +ERST Section 18.5 (signature == "ERST")
> + == Error Record Serialization Table ==
> + Must be supplied if RAS support is provided by the platform. It
> + is recommended this table be supplied.
The above text related to ERST table could lead to misunderstanding.
Following is what the ACPI spec (section 18.5) says:
"The error record serialization feature is used to save and retrieve
hardware error information to and from a persistent store. OSPM interacts
with the platform through a platform interface. On UEFI-based platforms, the
UEFI runtime variable services can be used to carry out error record
persistence operations. On non-UEFI based platforms, the ACPI solution
described below is used."
When RAS support is provided by the platform, ERST table may not be supplied
when it is UEFI-based and when UEFI run time service provides the ability to
save and retrieve hardware error information to and from a persistent store
(UEFI spec section 7.2.3). Therefore, following text might be more accurate:
" On a platform supports RAS, this table must be supplied if it is not
UEFI-based; if it is UEFI-based, this table may be supplied, consult your
firmware vendor if you are not sure. When this table is not present, UEFI
run time service will be utilized to save and retrieve hardware error
information to and from a persistent store."
====
Jonathan (Zhixiong) Zhang
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a
Linux Foundation Collaborative Project.
This patch series introduce ACPI support for non-PCI AHCI platform driver.
Existing ACPI support for AHCI assumes the device controller is a PCI device.
Also, since there is no ACPI _HID/_CID for generic AHCI controller, the driver
could not use them for matching devices. Therefore, this patch introduces
a mechanism for drivers to match devices using ACPI _CLS method.
This patch series is rebased from and tested with:
http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v8
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 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/scan.c | 75 +++++++++++++++++++++++++++++++++++++++--
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 3 ++
include/acpi/acnames.h | 1 +
include/linux/acpi.h | 10 ++++++
include/linux/device.h | 1 +
include/linux/mod_devicetable.h | 6 ++++
7 files changed, 94 insertions(+), 4 deletions(-)
--
2.1.0
This patch series introduce ACPI support for non-PCI AHCI platform driver.
Existing ACPI support for AHCI assumes the device controller is a PCI device.
Also, since there is no ACPI _HID/_CID for generic AHCI controller, the driver
could not use them for matching devices. Therefore, this patch introduces
a mechanism for drivers to match devices using ACPI _CLS method.
This patch series is rebased from and tested with:
http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v7
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
NOTE:
* PATCH 2/2 has already been Acked-by Tejun Heo in V1. I only made
a minor renaming of the acpi_cls to acpi_match_cls for clarity
in V2. It probably should be routed together with the PATCH 1/2
(once acked) since it defines the new member in the struct.
Changes 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/scan.c | 79 +++++++++++++++++++++++++++++++++++++++--
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 3 ++
include/acpi/acnames.h | 1 +
include/linux/acpi.h | 10 ++++++
include/linux/device.h | 1 +
include/linux/mod_devicetable.h | 6 ++++
7 files changed, 98 insertions(+), 4 deletions(-)
--
1.9.3
There is no reason this file cannot be an arm64 specific stub holder so
move the file and change the Kconfig to match.
Signed-off-by: Graeme Gregory <graeme.gregory(a)linaro.org>
---
arch/arm64/kernel/Makefile | 2 +-
arch/arm64/kernel/acpi_sleep.c | 28 ++++++++++++++++++++++++++++
drivers/acpi/Makefile | 4 +---
drivers/acpi/sleep_arm.c | 28 ----------------------------
4 files changed, 30 insertions(+), 32 deletions(-)
create mode 100644 arch/arm64/kernel/acpi_sleep.c
delete mode 100644 drivers/acpi/sleep_arm.c
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 8bdc6bd..f2c488b 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB) += kgdb.o
arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o
arm64-obj-$(CONFIG_PCI) += pci.o
arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o
-arm64-obj-$(CONFIG_ACPI) += acpi.o
+arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o
obj-y += $(arm64-obj-y) vdso/
obj-m += $(arm64-obj-m)
diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c
new file mode 100644
index 0000000..54578ef
--- /dev/null
+++ b/arch/arm64/kernel/acpi_sleep.c
@@ -0,0 +1,28 @@
+/*
+ * ARM64 Specific Sleep Functionality
+ *
+ * Copyright (C) 2013-2014, Linaro Ltd.
+ * Author: Graeme Gregory <graeme.gregory(a)linaro.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/acpi.h>
+
+/*
+ * Currently the ACPI 5.1 standard does not define S states in a
+ * manner which is usable for ARM64. These two stubs are sufficient
+ * that system initialises and device PM works.
+ */
+u32 acpi_target_system_state(void)
+{
+ return ACPI_STATE_S0;
+}
+EXPORT_SYMBOL_GPL(acpi_target_system_state);
+
+int __init acpi_sleep_init(void)
+{
+ return -ENOSYS;
+}
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index bcec54e..753785d 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -23,9 +23,7 @@ acpi-y += nvs.o
# Power management related files
acpi-y += wakeup.o
-ifeq ($(ARCH), arm64)
-acpi-y += sleep_arm.o
-else # X86, IA64
+ifneq (,$(findstring $(ARCH),x86 ia64))
acpi-y += sleep.o
endif
acpi-y += device_pm.o
diff --git a/drivers/acpi/sleep_arm.c b/drivers/acpi/sleep_arm.c
deleted file mode 100644
index 54578ef..0000000
--- a/drivers/acpi/sleep_arm.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * ARM64 Specific Sleep Functionality
- *
- * Copyright (C) 2013-2014, Linaro Ltd.
- * Author: Graeme Gregory <graeme.gregory(a)linaro.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/acpi.h>
-
-/*
- * Currently the ACPI 5.1 standard does not define S states in a
- * manner which is usable for ARM64. These two stubs are sufficient
- * that system initialises and device PM works.
- */
-u32 acpi_target_system_state(void)
-{
- return ACPI_STATE_S0;
-}
-EXPORT_SYMBOL_GPL(acpi_target_system_state);
-
-int __init acpi_sleep_init(void)
-{
- return -ENOSYS;
-}
--
2.1.4
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 specification
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. This is the first
four of the patches.
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 three 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].
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 two patches do not pass checkpatch.pl; since this is existing
code being moved, I have not repaired the reported errors for now, but will
do so once the disposition of these patches have been resolved.
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 (4):
ACPI: move acpi_os_handler() so it can be made arch-dependent later
ACPI: move _OSI support functions to allow arch-dependent
implementation
ACPI: add arch-specific compilation for _OSI and the blacklist
ACPI: arm64: use the arch-specific ACPI _OSI method and ACPI blacklist
Hanjun Guo (1):
ACPI: arm64: use "Linux" as ACPI_OS_NAME for _OS on arm64
arch/arm64/Kconfig | 7 ++
drivers/acpi/Kconfig | 22 ++++
drivers/acpi/Makefile | 17 +++
drivers/acpi/blacklist-arm.c | 20 ++++
drivers/acpi/blacklist.c | 9 ++
drivers/acpi/osi-arm.c | 25 ++++
drivers/acpi/osi.c | 255 ++++++++++++++++++++++++++++++++++++++++
drivers/acpi/osl.c | 217 ----------------------------------
include/acpi/acconfig.h | 2 +
include/acpi/platform/aclinux.h | 4 +
include/linux/acpi.h | 4 +-
11 files changed, 362 insertions(+), 220 deletions(-)
create mode 100644 drivers/acpi/blacklist-arm.c
create mode 100644 drivers/acpi/osi-arm.c
create mode 100644 drivers/acpi/osi.c
--
2.1.0
Update for 4 Feb 2015:
Back in September 2014, a meeting was held at Linaro Connect where we
discussed what issues remained before the arm64 ACPI core patches could
be merged into the kernel, creating the TODO list below. I should have
published this list sooner; I got focused on trying to resolve some of
the issues instead.
We have made some progress on all of these items. But, I want to make
sure we haven't missed something. Since this list was compiled by only
the people in the room at Connect, it is probable we have. I, for one,
do not yet claim omniscience.
So, I want to ask the ARM and ACPI communities:
-- Is this list correct?
-- Is this list complete?
Below is what we currently know about; very brief notes on status are
included. The TL;DR versions of the TODO list and the current status
can be found at:
https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/CoreUpstreamNotes
and I'll do my best to kept that up to date.
Thanks. Any and all feedback is greatly appreciated.
Changes since 11 Jan 2015:
-- v7 of ACPI core patches posted; lots of discussion around GICs,
documentation, and how to handle acpi=force
-- Merging requested, discussed, NAK'd until further changes and sign-offs
and ACKs from subsystem maintainers
-- v8 of ACPI core patches posted, updated per v7 discussions; significant
changes to GIC handling and documentation, much larger collection of
sign-offs of all kinds; _OSC and _DSD review processes suggested; handling
of acpi=force codified
-- v1 of _OSI patches posted; v2 posted today; _OSC addressed in ACPI core v8
patches
-- Additional FWTS runs, CI loop integration
-- luvOS v1 patches posted and reviewed; working on updating GRUB and FWTS; CI
loop built and running
-- _DSD process suggested in ACPI core v8 patches
-- Grant's summary of the ACPI rationale now part of the documentation
Changes since 14 Dec 2014:
-- v6 of ACPI core patches posted
-- Good progress in _OSI investigation, started preparing RFC for the
mailing lists
-- Precise definition of kernel behavior when defaulting to DT and/or
using acpi=force being discussed again
-- FWTS now runs and results posted after each merge of leg-kernel
(includes ACPI) with Linus' tree (i.e., each -rc).
-- ACPI on arm64 kernel document updated, under extensive discussion on
the lists; starting coordination with SBBR content.
-- Firmware Summit: planned for 26 Mar 2015, San Jose, CA, at the ARM
office; mailing list (with archives) now up and running; updated
agenda being prepared
-- Merged items "Demonstrate the ACPI core patches work", and "Platform
support patches need review" because of their similarity.
-- Further discussions have occurred regarding "Why ACPI?" and the
usage of _DSD, more still needed
TODO List for ACPI on arm64:
============================
1. Define how Aarch64 OS identifies itself to firmware
* Problem:
* _OSI method is demonstrably unreliable. On x86, Linux claims to
be Windows.
* Proposal to use _OSC method as replacement is complicated and
creates an explosion of combinations
* Solution:
* Draft and propose OS identification rules to ABST and ASWG for
inclusion in ACPI spec.
* Draft and propose recommended practice for current ACPI 5.1 spec
platforms.
* Status: general agreement to deprecate _OSI completely, replace _OS_,
and v2 of patches to do so posted (https://lkml.org/lkml/2015/2/3/877);
_OSC process suggested in ACPI on arm64 documentation
2. Linux must choose DT booting by default when offered both ACPI and DT
on arm64
* Status: DONE, again, after incorporating discussion into v8 of core patches
3. Linux UEFI/ACPI testing tools must be made available
* Problem:
* Hardware/Firmware vendors do not have tools to test Linux compatibility.
* Common problems go undetected if not tested for.
* Solution:
* Port FWTS tool and LuvOS distribution to AArch64
* Make LuvOS images readily available
* Require hardware vendors to actively test against old and new kernels.
* Status:
* LuvOS and FWTS ported to arm64; patches in mainline; additional test
cases being written.
* CI loop set up to run FWTS on Foundation model for each -rc merge of
Linus' tree into leg-kernel.
* AMD Seattle results pending updated kernel patches.
* LuvOS details at https://wiki.linaro.org/LEG/Engineering/luvOS
* v1 patches out and reviewed
* CI loop up and running
* Working on update of GRUB2 and FWTS
4. Set clear expectations for those providing ACPI for use with Linux
* Problem:
* Hardware/Firmware vendors can and will create ACPI tables that
cannot be used by Linux without some guidance
* Kernel developers cannot determine whether the kernel or firmware
is broken without knowing what the firmware should do
* Solution: document the expectations, and iterate as needed. Enforce
when we must.
* Status: significant rewrite and additions to kernel documentation;
starting to coordinate content with SBBR; firmware summit date and
location firm, agenda updated, kernel docs shared for discussion.
5. Platform support patches need verification and review
* Problem: the core Aarch64 patches have been reviewed and are in good
shape, but there is not yet a good example of server platform support
patches that use them.
* Solution: post *good* patches for multiple ACPI platforms, demonstrating
that both the core patches work, and that the use of the ACPI core makes
sense.
* Status:
* Lots of changes to subsystem patches (GIC, PCI, ...) all over the place
* ACPI core works on at least the Foundation model, Juno, APM Mustang,
and AMD Seattle
* FWTS results for the Foundation model have been posted
* First version for AMD Seattle has been posted to the public linaro-acpi
mailing list for initial review, refined versions to be posted to
broader lists after a few iterations for basic cleanup
6. How does the kernel handle_DSD usage?
* Problem:
* _DSD defines key-value properties in the DT style. How do we ensure
_DSD bindings are well defined?
* How do we ensure DT and _DSD bindings remain consistent with each other?
* Solution: public documentation for all bindings, and a process for
defining them
* Status: proposal documented in ACPI core patches to require patch authors
to submit bindings with drivers, then register with UEFI Forum; kernel
Documentation/devicetree/bindings remains the default if no other location
exists.
7. Why is ACPI required?
* Problem:
* arm64 maintainers still haven't been convinced that ACPI is necessary.
* Why do hardware and OS vendors say ACPI is required?
* Solution: discussions between those who want ACPI and arm64 maintainers
* Status: DONE, and documentation added to proposed kernel docs; firmware
summit for broader discussion still planned.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Linaro Enterprise Group
al.stone(a)linaro.org
-----------------------------------
The leg-kernel release has been made and tagged as leg-20150203.0
This is based on mainline kernel v3.19-rc7
Repository : http://git.linaro.org/leg/acpi/leg-kernel.git
Direct Link:
https://git.linaro.org/leg/acpi/leg-kernel.git/commit/2cb1e1db278a9856d98de…
Notes :-
1) This release only supports Juno/FVP until updated topics for Seattle
and Mustang are available.
2) This release incorporates the SBSA UART support for pl011 driver from
Andre Przywara. This means that your console will become ttyAMA0
(console=ttyAMA0) on Juno/FVP. It also means to run FVP model you need
these options :-
-C bp.pl011_uart0.untimed_fifos=0
-C bp.pl011_uart0.revision="r1p5"
Hi,
This is the v7 of ACPI core patches for ARM64 based on ACPI 5.1
updates from v6:
- Rebased on top of 3.19-rc4, add Mack Salter's patch to use
the early_ioremap after paging_init() for ACPI table mappings;
- Two patches about converting apic_id to phys_id to make it arch
agnostic were already merged into RC4 by Rafael.
- Split patch "Parse FADT table to get PSCI flags for PSCI init"
into two as Lorenzo's suggestion, also fix typo and lack of __init
for psci_0_2_set_functions() which is spotted by Lorenzo.
- Add Tested-by from Yijing Wang.
previous version is here:
v6: https://lkml.org/lkml/2015/1/4/40
1. Why we need ACPI on ARM64?
- Grant already posted a blog about this, and stated clearly
why we need ACPI on ARM64:
http://www.secretlab.ca/archives/151
2. What we need to do before the arm64 ACPI core patches
could be merged into the kernel?
- Al Stone posted a TODO list and updates v2 for the
progress we made:
http://www.spinics.net/lists/arm-kernel/msg390069.html
- so from the progress we can see that we already finished
most of the items, and _OSI we got a plan to fix it, RFC
patch is on the way.
This patch set was tested on FVP by Fuwei, and booted ok as expected.
(No functional change since last version)
Thanks
Hanjun
The leg-kernel release has been made and tagged as leg-20150126.0
This is based on mainline kernel v3.19-rc5
Repository : http://git.linaro.org/leg/acpi/leg-kernel.git
Direct Link:
https://git.linaro.org/leg/acpi/leg-kernel.git/commit/ad09ed5fec417d407461b…
Notes :-
1) This release only supports Juno/FVP until updated topics for Seattle
and Mustang are available.
2) This release incorporates the SBSA UART support for pl011 driver from
Andre Przywara. This means that your console will become ttyAMA0
(console=ttyAMA0) on Juno/FVP. It also means to run FVP model you need
these options :-
-C bp.pl011_uart0.untimed_fifos=0
-C bp.pl011_uart0.revision="r1p5"
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. I plan to
propose such a change to the ACPI specification in the near future.
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 simply moving the functions implementing
_OSI to arch-dependent locations. For x86, there should be no change
in functionality. For ia64, while it does duplicate some code from x86,
there is no longer any connection to the ACPI blacklist code that is only
used by x86. For arm64, any use of the _OSI method generates a warning
that it has been deprecated, and then always returns false; i.e., that
the capability being queried for, whether OS name or functionality, is
not supported. This is the first six of the patches.
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.
Since we are breaking apart code previously shared, I have tried to make
it so that applying the x86 patches alone will continue to compile, at
the expense of breaking the build on non-x86 platforms. However, once
all of the patches are applied, we should be able to compile on all three
architectures. It is best to treat these as one whole.
I have only done simple testing with these patches on arm64 and x86 (AMD
Seattle and a Lenovo t440s ThinkPad, respectively). Things seem to work
as they should once booted, but this is a very, very small sample of
possible machines. The ia64 patches cross-compile, but I personally have
no way to test them.
The arm64 patches also rely on having applied Hanjun's patches for ACPI 5.1
on arm64 [0]. The x86 and ia64 parts are not dependent on that patch set,
though, and should be usable independently (i.e., patches 1, 3, 4 and 6).
NB: some of the patches do not pass checkpatch.pl; the failures I saw were
all part of the original code but are only showing up because that code is
changing location, so I have left them as is. If necessary, they could be
fixed but I was more concerned about the number of changes needed on ia64
and not having any way to test them.
[0] https://lkml.org/lkml/2015/1/14/586
Al Stone (6):
ia64: ACPI: move kernel acpi files to a directory
arm64: ACPI: move kernel acpi files to a directory
x86: ACPI: create arch-dependent version of acpi_osi_handler()
ia64: ACPI: create arch-dependent version of acpi_osi_handler()
arm64: ACPI: create arch-dependent version of acpi_osi_handler()
x86: ia64: arm64: ACPI: move _OSI support functions to arch-dependent
locations
Hanjun Guo (1):
ACPI: use Linux as ACPI_OS_NAME for _OS on ARM64
arch/arm64/Kconfig | 1 +
arch/arm64/kernel/Makefile | 2 +-
arch/arm64/kernel/acpi.c | 359 --------------
arch/arm64/kernel/acpi/Makefile | 1 +
arch/arm64/kernel/acpi/acpi.c | 359 ++++++++++++++
arch/arm64/kernel/acpi/osi.c | 26 +
arch/ia64/kernel/Makefile | 2 +-
arch/ia64/kernel/acpi-ext.c | 104 ----
arch/ia64/kernel/acpi.c | 1000 --------------------------------------
arch/ia64/kernel/acpi/Makefile | 1 +
arch/ia64/kernel/acpi/acpi-ext.c | 104 ++++
arch/ia64/kernel/acpi/acpi.c | 1000 ++++++++++++++++++++++++++++++++++++++
arch/ia64/kernel/acpi/osi.c | 119 +++++
arch/x86/kernel/acpi/Makefile | 2 +-
arch/x86/kernel/acpi/blacklist.c | 327 +++++++++++++
arch/x86/kernel/acpi/boot.c | 5 +-
arch/x86/kernel/acpi/osi.c | 255 ++++++++++
drivers/acpi/Kconfig | 8 +
drivers/acpi/Makefile | 1 -
drivers/acpi/blacklist.c | 323 ------------
drivers/acpi/osl.c | 217 ---------
include/acpi/acconfig.h | 2 +
include/acpi/platform/aclinux.h | 4 +
include/linux/acpi.h | 4 +-
24 files changed, 2215 insertions(+), 2011 deletions(-)
delete mode 100644 arch/arm64/kernel/acpi.c
create mode 100644 arch/arm64/kernel/acpi/Makefile
create mode 100644 arch/arm64/kernel/acpi/acpi.c
create mode 100644 arch/arm64/kernel/acpi/osi.c
delete mode 100644 arch/ia64/kernel/acpi-ext.c
delete mode 100644 arch/ia64/kernel/acpi.c
create mode 100644 arch/ia64/kernel/acpi/Makefile
create mode 100644 arch/ia64/kernel/acpi/acpi-ext.c
create mode 100644 arch/ia64/kernel/acpi/acpi.c
create mode 100644 arch/ia64/kernel/acpi/osi.c
create mode 100644 arch/x86/kernel/acpi/blacklist.c
create mode 100644 arch/x86/kernel/acpi/osi.c
delete mode 100644 drivers/acpi/blacklist.c
--
2.1.0
From: Al Stone <al.stone(a)linaro.org>
While Hanjun cleaned up most of the commentary on the arm-acpi.txt file,
this patch goes several steps further. The biggest change to the existing
documentation was to add a section describing why ACPI is wanted, and to
do a lot of editing for continuity, and hopefully clarity.
Two documentation files are also being added:
(1) A verbatim copy of the "Why ACPI on ARM?" blog posting by Grant Likely,
which is also summarized in arm-acpi.txt, and
(2) A section by section review of the ACPI spec (acpi_object_usage.txt)
to note recommendations and prohibitions on the use of the numerous
ACPI tables and objects. This sets out the current expectations of
the firmware by Linux very explicitly (or as explicitly as I can, for
now).
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
Documentation/arm64/acpi_object_usage.txt | 557 ++++++++++++++++++++++++++++++
Documentation/arm64/arm-acpi.txt | 323 +++++++++++++----
Documentation/arm64/why_use_acpi.txt | 228 ++++++++++++
3 files changed, 1044 insertions(+), 64 deletions(-)
create mode 100644 Documentation/arm64/acpi_object_usage.txt
create mode 100644 Documentation/arm64/why_use_acpi.txt
diff --git a/Documentation/arm64/acpi_object_usage.txt b/Documentation/arm64/acpi_object_usage.txt
new file mode 100644
index 0000000..3fbc25d
--- /dev/null
+++ b/Documentation/arm64/acpi_object_usage.txt
@@ -0,0 +1,557 @@
+ACPI Tables
+-----------
+The expectations of individual ACPI tables are discussed in the list that
+follows.
+
+If a section number is used, it refers to a section number in the ACPI
+specification where the object is defined. If "Signature Reserved" is used,
+the table signature (the first four bytes of the table) is the only portion
+of the table recognized by the specification, and the actual table is defined
+outside of the UEFI Forum (see Section 5.2.6 of the specification).
+
+
+Table Usage for ARMv8 Linux
+----- ----------------------------------------------------------------
+BERT Section 18.3 (signature == "BERT")
+ == Boot Error Record Table ==
+ Must be supplied if RAS support is provided by the platform. It
+ is recommended this table be supplied.
+
+BOOT Signature Reserved (signature == "BOOT")
+ == simple BOOT flag table ==
+ Microsoft only table, will not be supported.
+
+BGRT Section 5.2.22 (signature == "BGRT")
+ == Boot Graphics Resource Table ==
+ Optional, not currently supported, with no real use-case for an
+ ARM server.
+
+CPEP Section 5.2.18 (signature == "CPEP")
+ == Corrected Platform Error Polling table ==
+ Optional, not currently supported, and not recommended until such
+ time as ARM-compatible hardware is available, and the specification
+ suitably modified.
+
+CSRT Signature Reserved (signature == "CSRT")
+ == Core System Resources Table ==
+ Optional, not currently supported.
+
+DBG2 Signature Reserved (signature == "DBG2")
+ == DeBuG port table 2 ==
+ Microsoft only table, will not be supported.
+
+DBGP Signature Reserved (signature == "DBGP")
+ == DeBuG Port table ==
+ Microsoft only table, will not be supported.
+
+DSDT Section 5.2.11.1 (signature == "DSDT")
+ == Differentiated System Description Table ==
+ At least one DSDT is required; more than one can be provided to
+ expand the ACPI namespace.
+
+DMAR Signature Reserved (signature == "DMAR")
+ == DMA Remapping table ==
+ x86 only table, will not be supported.
+
+DRTM Signature Reserved (signature == "DRTM")
+ == Dynamic Root of Trust for Measurement table ==
+ Optional, not currently supported.
+
+ECDT Section 5.2.16 (signature == "ECDT")
+ == Embedded Controller Description Table ==
+ Optional, not currently supported, but could be used on ARM if and
+ only if one uses the GPE_BIT field to represent an IRQ number, since
+ there are no GPE blocks defined in hardware reduced mode. This would
+ need to be modified in the ACPI specification.
+
+EINJ Section 18.6 (signature == "EINJ")
+ == Error Injection table ==
+ This table is very useful for testing platform response to error
+ conditions; it allows one to inject an error into the system as
+ if it had actually occurred. However, this table should not be
+ shipped with a production system; it should be dynamically loaded
+ and executed with the ACPICA tools only during testing.
+
+ERST Section 18.5 (signature == "ERST")
+ == Error Record Serialization Table ==
+ Must be supplied if RAS support is provided by the platform. It
+ is recommended this table be supplied.
+
+ETDT Signature Reserved (signature == "ETDT")
+ == Event Timer Description Table ==
+ Obsolete table, will not be supported.
+
+FACS Section 5.2.10 (signature == "FACS")
+ == Firmware ACPI Control Structure ==
+ It is unlikely that this table will be terribly useful. If it is
+ provided, the Global Lock will NOT be used since it is not part of
+ the hardware reduced profile, and only 64-bit address fields will
+ be considered valid.
+
+FADT Section 5.2.9 (signature == "FACP")
+ == Fixed ACPI Description Table ==
+ Required for arm64.
+
+ The HW_REDUCED_ACPI flag must be set. All of the fields that are
+ to be ignored when HW_REDUCED_ACPI is set are expected to be set to
+ zero.
+
+ If an FACS table is provided, the X_FIRMWARE_CTRL field is to be
+ used, not FIRMWARE_CTRL.
+
+ If a DSDT is provided, the X_DSDT field is to be used, not the DSDT
+ field.
+
+FPDT Section 5.2.23 (signature == "FPDT")
+ == Firmware Performance Data Table ==
+ Optional, not currently supported.
+
+GTDT Section 5.2.24 (signature == "GTDT")
+ == Generic Timer Description Table ==
+ Required for arm64.
+
+HEST Section 18.3.2 (signature == "HEST")
+ == Hardware Error Source Table ==
+ Until further error source types are defined, use only types 6 (AER
+ Root Port), 7 (AER Endpoint), 8 (AER Bridge), or 9 (Generic Hardware
+ Error Source). Firmware first error handling is possible if and only
+ if Trusted Firmware is being used on arm64.
+
+ Must be supplied if RAS support is provided by the platform. It
+ is recommended this table be supplied.
+
+HPET Signature Reserved (signature == "HPET")
+ == High Precision Event timer Table ==
+ x86 only table, will not be supported.
+
+IBFT Signature Reserved (signature == "IBFT")
+ == iSCSI Boot Firmware Table ==
+ Microsoft defined table, support TBD.
+
+IVRS Signature Reserved (signature == "IVRS")
+ == I/O Virtualization Reporting Structure ==
+ x86_64 (AMD) only table, will not be supported.
+
+LPIT Signature Reserved (signature == "LPIT")
+ == Low Power Idle Table ==
+ x86 only table as of ACPI 5.1; future versions adapted for use
+ with ARM are optional, and will be supported.
+
+MADT Section 5.2.12 (signature == "APIC")
+ == Multiple APIC Description Table ==
+ Only the GIC interrupt controller structures should be used (types
+ 0xA - 0xE).
+
+MCFG Signature Reserved (signature == "MCFG")
+ == Memory-mapped ConFiGuration space ==
+ If the platform supports PCI/PCIe, an MCFG table is required.
+
+MCHI Signature Reserved (signature == "MCHI")
+ == Management Controller Host Interface table ==
+ Optional, not currently supported.
+
+MPST Section 5.2.21 (signature == "MPST")
+ == Memory Power State Table ==
+ Optional, not currently supported.
+
+MSDM Signature Reserved (signature == "MSDM")
+ == Microsoft Data Management table ==
+ Microsoft only table, will not be supported.
+
+MSCT Section 5.2.19 (signature == "MSCT")
+ == Maximum System Characteristic Table ==
+ Optional, not currently supported.
+
+RASF Section 5.2.20 (signature == "RASF")
+ == RAS Feature table ==
+ Optional, not currently supported.
+
+RSDP Section 5.2.5 (signature == "RSD PTR")
+ == Root System Description PoinTeR ==
+ Required for arm64.
+
+RSDT Section 5.2.7 (signature == "RSDT")
+ == Root System Description Table ==
+ Deprecated on arm64; can only provide 32-bit addresses.
+
+SBST Section 5.2.14 (signature == "SBST")
+ == Smart Battery Subsystem Table ==
+ Optional, not currently supported.
+
+SLIC Signature Reserved (signature == "SLIC")
+ == Software LIcensing table ==
+ Microsoft only table, will not be supported.
+
+SLIT Section 5.2.17 (signature == "SLIT")
+ == System Locality distance Information Table ==
+ Optional in general, but required for NUMA systems.
+
+SPCR Signature Reserved (signature == "SPCR")
+ == Serial Port Console Redirection table ==
+ Required for arm64.
+
+SPMI Signature Reserved (signature == "SPMI")
+ == Server Platform Management Interface table ==
+ Optional, not currently supported.
+
+SRAT Section 5.2.16 (signature == "SRAT")
+ == System Resource Affinity Table ==
+ Optional, but if used, only the GICC Affinity structures are read.
+
+TCPA Signature Reserved (signature == "TCPA")
+ == Trusted Computing Platform Alliance table ==
+ Optional, not currently supported, and may need changes to fully
+ interoperate with arm64.
+
+TPM2 Signature Reserved (signature == "TPM2")
+ == Trusted Platform Module 2 table ==
+ Optional, not currently supported, and may need changes to fully
+ interoperate with arm64.
+
+UEFI Signature Reserved (signature == "UEFI")
+ == UEFI ACPI data table ==
+ Optional, not currently supported. No known use case for arm64,
+ at present.
+
+WAET Signature Reserved (signature == "WAET")
+ == Windows ACPI Emulated devices Table ==
+ Microsoft only table, will not be supported.
+
+WDAT Signature Reserved (signature == "WDAT")
+ == Watch Dog Action Table ==
+ Microsoft only table, will not be supported.
+
+WDRT Signature Reserved (signature == "WDRT")
+ == Watch Dog Resource Table ==
+ Microsoft only table, will not be supported.
+
+WPBT Signature Reserved (signature == "WPBT")
+ == Windows Platform Binary Table ==
+ Microsoft only table, will not be supported.
+
+XSDT Section 5.2.8 (signature == "XSDT")
+ == eXtended System Description Table ==
+ Required for arm64.
+
+
+ACPI Objects
+------------
+The expectations on individual ACPI objects are discussed in the list that
+follows:
+
+Name Section Usage for ARMv8 Linux
+---- ------------ -------------------------------------------------
+_ADR 6.1.1 Use as needed.
+
+_BBN 6.5.5 Use as needed; PCI-specific.
+
+_BDN 6.5.3 Optional; not likely to be used on arm64.
+
+_CCA 6.2.17 This method should be defined for all bus masters
+ on arm64. While cache coherency is assumed, making
+ it explicit ensures the kernel will set up DMA as
+ it should.
+
+_CDM 6.2.1 Optional, to be used only for processor devices.
+
+_CID 6.1.2 Use as needed.
+
+_CLS 6.1.3 Use as needed.
+
+_CRS 6.2.2 Required on arm64.
+
+_DCK 6.5.2 Optional; not likely to be used on arm64.
+
+_DDN 6.1.4 This field can be used for a device name. However,
+ it is meant for DOS device names (e.g., COM1), so be
+ careful of its use across OSes.
+
+_DEP 6.5.8 Use as needed.
+
+_DIS 6.2.3 Optional, for power management use.
+
+_DLM 5.7.5 Optional.
+
+_DMA 6.2.4 Optional.
+
+_DSD 6.2.5 To be used with caution. If this object is used, try
+ to use it within the constraints already defined by the
+ Device Properties UUID. Only in rare circumstances
+ should it be necessary to create a new _DSD UUID.
+
+ In either case, submit the _DSD definition along with
+ any driver patches for discussion, especially when
+ device properties are used. A driver will not be
+ considered complete without a corresponding _DSD
+ description. Once approved by kernel maintainers,
+ the UUID or device properties must then be registered
+ with the UEFI Forum; this may cause some iteration as
+ more than one OS will be registering entries.
+
+_DSM Do not use this method. It is not standardized, the
+ return values are not well documented, and it is
+ currently a frequent source of error.
+
+_DSW 7.2.1 Use as needed; power management specific.
+
+_EDL 6.3.1 Optional.
+
+_EJD 6.3.2 Optional.
+
+_EJx 6.3.3 Optional.
+
+_FIX 6.2.7 x86 specific, not used on arm64.
+
+\_GL 5.7.1 This object is not to be used in hardware reduced
+ mode, and therefore should not be used on arm64.
+
+_GLK 6.5.7 This object requires a global lock be defined; there
+ is no global lock on arm64 since it runs in hardware
+ reduced mode. Hence, do not use this object on arm64.
+
+\_GPE 5.3.1 This namespace is for x86 use only. Do not use it
+ on arm64.
+
+_GSB 6.2.7 Optional.
+
+_HID 6.1.5 Use as needed. This is the primary object to use in
+ device probing, though _CID and _CLS may also be used.
+
+_HPP 6.2.8 Optional, PCI specific.
+
+_HPX 6.2.9 Optional, PCI specific.
+
+_HRV 6.1.6 Optional, use as needed to clarify device behavior; in
+ some cases, this may be easier to use than _DSD.
+
+_INI 6.5.1 Not required, but can be useful in setting up devices
+ when UEFI leaves them in a state that may not be what
+ the driver expects before it starts probing.
+
+_IRC 7.2.15 Use as needed; power management specific.
+
+_LCK 6.3.4 Optional.
+
+_MAT 6.2.10 Optional; see also the MADT.
+
+_MLS 6.1.7 Optional, but highly recommended for use in
+ internationalization.
+
+_OFF 7.1.2 It is recommended to define this method for any device
+ that can be turned on or off.
+
+_ON 7.1.3 It is recommended to define this method for any device
+ that can be turned on or off.
+
+\_OS 5.7.3 This method will return "Linux" by default (this is
+ the value of the macro ACPI_OS_NAME on Linux). The
+ command line parameter acpi_os=<string> can be used
+ to set it to some other value.
+
+_OSC 6.2.11 This method can be a global method in ACPI (i.e.,
+ \_SB._OSC), or it may be associated with a specific
+ device (e.g., \_SB.DEV0._OSC), or both. When used
+ as a global method, only capabilities published in
+ the ACPI specification are allowed. When used as
+ a device-specifc method, the process described for
+ using _DSD MUST be used to create an _OSC definition;
+ out-of-process use of _OSC is not allowed. That is,
+ submit the device-specific _OSC usage description as
+ part of the kernel driver submission, get it approved
+ by the kernel community, then register it with the
+ UEFI Forum.
+
+\_OSI 5.7.2 Deprecated on ARM64. Any invocation of this method
+ will print a warning on the console and return false.
+ That is, as far as ACPI firmware is concerned, _OSI
+ cannot be used to determine what sort of system is
+ being used or what functionality is provided. The
+ _OSC method is to be used instead.
+
+_OST 6.3.5 Optional.
+
+_PDC 8.4.1 Deprecated, do not use on arm64.
+
+\_PIC 5.8.1 The method should not be used. On arm64, the only
+ interrupt model available is GIC.
+
+_PLD 6.1.8 Optional.
+
+\_PR 5.3.1 This namespace is for x86 use only on legacy systems.
+ Do not use it on arm64.
+
+_PRS 6.2.12 Optional.
+
+_PRT 6.2.13 Required as part of the definition of all PCI root
+ devices.
+
+_PRW 7.2.13 Use as needed; power management specific.
+
+_PRx 7.2.8-11 Use as needed; power management specific. If _PR0 is
+ defined, _PR3 must also be defined.
+
+_PSC 7.2.6 Use as needed; power management specific.
+
+_PSE 7.2.7 Use as needed; power management specific.
+
+_PSW 7.2.14 Use as needed; power management specific.
+
+_PSx 7.2.2-5 Use as needed; power management specific. If _PS0 is
+ defined, _PS3 must also be defined. If clocks or
+ regulators need adjusting to be consistent with power
+ usage, change them in these methods.
+
+\_PTS 7.3.1 Use as needed; power management specific.
+
+_PXM 6.2.14 Optional.
+
+_REG 6.5.4 Use as needed.
+
+\_REV 5.7.4 Always returns the latest version of ACPI supported.
+
+_RMV 6.3.6 Optional.
+
+\_SB 5.3.1 Required on arm64; all devices must be defined in this
+ namespace.
+
+_SEG 6.5.6 Use as needed; PCI-specific.
+
+\_SI 5.3.1, Optional.
+ 9.1
+
+_SLI 6.2.15 Optional; recommended when SLIT table is in use.
+
+_STA 6.3.7, It is recommended to define this method for any device
+ 7.1.4 that can be turned on or off.
+
+_SRS 6.2.16 Optional; see also _PRS.
+
+_STR 6.1.10 Recommended for conveying device names to end users;
+ this is preferred over using _DDN.
+
+_SUB 6.1.9 Use as needed; _HID or _CID are preferred.
+
+_SUN 6.1.11 Optional.
+
+\_Sx 7.3.2 Use as needed; power management specific.
+
+_SxD 7.2.16-19 Use as needed; power management specific.
+
+_SxW 7.2.20-24 Use as needed; power management specific.
+
+_SWS 7.3.3 Use as needed; power management specific; this may
+ require specification changes for use on arm64.
+
+\_TTS 7.3.4 Use as needed; power management specific.
+
+\_TZ 5.3.1 Optional.
+
+_UID 6.1.12 Recommended for distinguishing devices of the same
+ class; define it if at all possible.
+
+\_WAK 7.3.5 Use as needed; power management specific.
+
+
+ACPI Event Model
+----------------
+Do not use GPE block devices; these are not supported in the hardware reduced
+profile used by arm64. Since there are no GPE blocks defined for use on ARM
+platforms, SCI or NMI like interrupts are used, along with GPIO-signaled
+interrupts for creating system events.
+
+
+ACPI Processor Control
+----------------------
+Section 8 of the ACPI specification is currently undergoing change that
+should be completed in the 6.0 version of the specification. Processor
+performance control will be handled differently for arm64 at that point
+in time. Processor aggregator devices (section 8.5) will not be used,
+for example, but another similar mechanism instead.
+
+While UEFI constrains what we can say until the release of 6.0, it is
+recommended that CPPC (8.4.5) be used as the primary model. This will
+still be useful into the future. C-states and P-states will still be
+provided, but most of the current design work appears to favor CPPC.
+
+Further, it is essential that the ARMv8 SoC provide a fully functional
+implementation of PSCI; this will be the only mechanism supported by ACPI
+to control CPU power state (including secondary CPU booting).
+
+More details will be provided on the release of the ACPI 6.0 specification.
+
+
+ACPI System Address Map Interfaces
+----------------------------------
+In Section 15 of the ACPI specification, several methods are mentioned as
+possible mechanisms for conveying memory resource information to the kernel.
+For arm64, we will only support UEFI for booting with ACPI, hence the UEFI
+GetMemoryMap() boot service is the only mechanism that will be used.
+
+
+ACPI Platform Error Interfaces (APEI)
+-------------------------------------
+The APEI tables supported are described above.
+
+APEI requires the equivalent of an SCI and an NMI on ARMv8. The SCI is used
+to notify the OSPM of errors that have occurred but can be corrected and the
+system can continue correct operation, even if possibly degraded. The NMI is
+used to indicate fatal errors that cannot be corrected, and require immediate
+attention.
+
+Since there is no direct equivalent of the x86 SCI or NMI, arm64 handles
+these slightly differently. The SCI is handled as a normal GPIO-signaled
+interrupt; given that these are corrected (or correctable) errors being
+reported, this is sufficient. The NMI is emulated as the highest priority
+GPIO-signaled interrupt possible. This implies some caution must be used
+since there could be interrupts at higher privilege levels or even interrupts
+at the same priority as the emulated NMI. In Linux, this should not be the
+case but one should be aware it could happen.
+
+
+ACPI Objects Not Supported on ARM64
+-----------------------------------
+While this may change in the future, there are several classes of objects
+that can be defined, but are not currently of general interest to ARM servers.
+
+These are not supported:
+
+ -- Section 9.2: ambient light sensor devices
+
+ -- Section 9.3: battery devices
+
+ -- Section 9.4: lids (e.g., laptop lids)
+
+ -- Section 9.8.2: IDE controllers
+
+ -- Section 9.9: floppy controllers
+
+ -- Section 9.10: GPE block devices
+
+ -- Section 9.15: PC/AT RTC/CMOS devices
+
+ -- Section 9.16: user presence detection devices
+
+ -- Section 9.17: I/O APIC devices; all GICs must be enumerable via MADT
+
+ -- Section 9.18: time and alarm devices (see 9.15)
+
+
+ACPI Objects Not Yet Implemented
+--------------------------------
+While these objects have x86 equivalents, and they do make some sense in ARM
+servers, there is either no hardware available at present, or in some cases
+there may not yet be a non-ARM implementation. Hence, they are currently not
+implemented though that may change in the future.
+
+Not yet implemented are:
+
+ -- Section 10: power source and power meter devices
+
+ -- Section 11: thermal management
+
+ -- Section 12: embedded controllers interface
+
+ -- Section 13: SMBus interfaces
+
+ -- Section 17: NUMA support
+
diff --git a/Documentation/arm64/arm-acpi.txt b/Documentation/arm64/arm-acpi.txt
index 21e7020..76aecc4 100644
--- a/Documentation/arm64/arm-acpi.txt
+++ b/Documentation/arm64/arm-acpi.txt
@@ -1,20 +1,107 @@
ACPI on ARMv8 Servers
---------------------
ACPI can be used for ARMv8 general purpose servers designed to follow
-the ARM SBSA (Server Base System Architecture) and SBBR (Server Base
-Boot Requirements) specifications, currently available to those with
-an ARM login at http://silver.arm.com.
+the ARM SBSA (Server Base System Architecture) [0] and SBBR (Server
+Base Boot Requirements) [1] specifications. Please note that the SBBR
+can be retrieved simply by visiting [1], but the SBSA is currently only
+available to those with an ARM login due to ARM IP licensing concerns.
The ARMv8 kernel implements the reduced hardware model of ACPI version
-5.1 and later. Links to the specification and all external documents
+5.1 or later. Links to the specification and all external documents
it refers to are managed by the UEFI Forum. The specification is
-available at http://www.uefi.org/specifications and external documents
-can be found via http://www.uefi.org/acpi.
-
-If an ARMv8 system does not meet the requirements of the SBSA, or cannot
-be described using the mechanisms defined in the required ACPI specifications,
-then it is likely that Device Tree (DT) is more suitable than ACPI for the
-hardware.
+available at http://www.uefi.org/specifications and documents referenced
+by the specification can be found via http://www.uefi.org/acpi.
+
+If an ARMv8 system does not meet the requirements of the SBSA and SBBR,
+or cannot be described using the mechanisms defined in the required ACPI
+specifications, then ACPI may not be a good fit for the hardware.
+
+While the documents mentioned above set out the requirements for building
+industry-standard ARMv8 servers, they also apply to more than one operating
+system. The purpose of this document is to describe the interaction between
+ACPI and Linux only, on an ARMv8 system -- that is, what Linux expects of
+ACPI and what ACPI can expect of Linux.
+
+
+Why ACPI on ARM?
+----------------
+Before examining the details of the interface between ACPI and Linux, it is
+useful to understand why ACPI is being used. Several technologies already
+exist in Linux for describing non-enumerable hardware, after all. In this
+section we summarize a blog post [2] from Grant Likely that outlines the
+reasoning behind ACPI on ARMv8 servers. Actually, we snitch a good portion
+of the summary text almost directly, to be honest.
+
+The short form of the rationale for ACPI on ARM is:
+
+-- ACPI’s bytecode (AML) allows the platform to encode hardware behavior,
+ while DT explicitly does not support this. For hardware vendors, being
+ able to encode behavior is a key tool used in supporting operating
+ system releases on new hardware.
+
+-- ACPI’s OSPM defines a power management model that constrains what the
+ platform is allowed to do into a specific model, while still providing
+ flexibility in hardware design.
+
+-- In the enterprise server environment, ACPI has established bindings (such
+ as for RAS) which are currently used in production systems. DT does not.
+ Such bindings could be defined in DT at some point, but doing so means ARM
+ and x86 would end up using completely different code paths in both firmware
+ and the kernel.
+
+-- Choosing a single interface to describe the abstraction between a platform
+ and an OS is important. Hardware vendors would not be required to implement
+ both DT and ACPI if they want to support multiple operating systems. And,
+ agreeing on a single interface instead of being fragmented into per OS
+ interfaces makes for better interoperability overall.
+
+-- The new ACPI governance process works well and Linux is now at the same
+ table as hardware vendors and other OS vendors. In fact, there is no
+ longer any reason to feel that ACPI is only belongs to Windows or that
+ Linux is in any way secondary to Microsoft in this arena. The move of
+ ACPI governance into the UEFI forum has significantly opened up the
+ specification development process, and currently, a large portion of the
+ changes being made to ACPI is being driven by Linux.
+
+Key to the use of ACPI is the support model. For servers in general, the
+responsibility for hardware behaviour cannot solely be the domain of the
+kernel, but rather must be split between the platform and the kernel, in
+order to allow for orderly change over time. ACPI frees the OS from needing
+to understand all the minute details of the hardware so that the OS doesn’t
+need to be ported to each and every device individually. It allows the
+hardware vendors to take responsibility for power management behaviour without
+depending on an OS release cycle which is not under their control.
+
+ACPI is also important because hardware and OS vendors have already worked
+out the mechanisms for supporting a general purpose computing ecosystem. The
+infrastructure is in place, the bindings are in place, and the processes are
+in place. DT does exactly what Linux needs it to when working with vertically
+integrated devices, but there are no good processes for supporting what the
+server vendors need. Linux could potentially get there with DT, but doing so
+really just duplicates something that already works. ACPI already does what
+the hardware vendors need, Microsoft won’t collaborate on DT, and hardware
+vendors would still end up providing two completely separate firmware
+interfaces -- one for Linux and one for Windows.
+
+
+Kernel Compatibility
+--------------------
+One of the primary motivations for ACPI is standardization, and using that
+to provide backward compatibility for Linux kernels. In the server market,
+software and hardware are often used for long periods. ACPI allows the
+kernel and firmware to agree on a consistent abstraction that can be
+maintained over time, even as hardware or software change. As long as the
+abstraction is supported, systems can be updated without necessarily having
+to replace the kernel.
+
+When a Linux driver or subsystem is first implemented using ACPI, it by
+definition ends up requiring a specific version of the ACPI specification
+-- it's baseline. ACPI firmware must continue to work, even though it may
+not be optimal, with the earliest kernel version that first provides support
+for that baseline version of ACPI. There may be a need for additional drivers,
+but adding new functionality (e.g., CPU power management) should not break
+older kernel versions. Further, ACPI firmware must also work with the most
+recent version of the kernel.
Relationship with Device Tree
@@ -33,17 +120,27 @@ time).
Booting using ACPI tables
-------------------------
The only defined method for passing ACPI tables to the kernel on ARMv8
-is via the UEFI system configuration table.
+is via the UEFI system configuration table. Just so it is explicit, this
+means that ACPI is only supported on platforms that boot via UEFI.
+
+When an ARMv8 system boots, it can either have DT information, ACPI tables,
+or in some very unusual cases, both. If no command line parameters are used,
+the kernel will try to use DT for device enumeration; if there is no DT
+present, the kernel will try to use ACPI tables, but only if they are present.
+In neither is available, the kernel will not boot. If acpi=force is used
+on the command line, the kernel will attempt to use ACPI tables first, but
+fall back to DT if there are no ACPI tables present. The basic idea is that
+the kernel will not fail to boot unless it absolutely has no other choice.
Processing of ACPI tables may be disabled by passing acpi=off on the kernel
-command line; this is the default behavior if both ACPI and DT tables are
-present. If acpi=force is used, the kernel will ONLY use device configuration
-information contained in the ACPI tables if those tables are available.
+command line; this is the default behavior.
In order for the kernel to load and use ACPI tables, the UEFI implementation
MUST set the ACPI_20_TABLE_GUID to point to the RSDP table (the table with
the ACPI signature "RSD PTR "). If this pointer is incorrect and acpi=force
-is used, the kernel will disable ACPI and try to use DT to boot instead.
+is used, the kernel will disable ACPI and try to use DT to boot instead; the
+kernel has, in effect, determined that ACPI tables are not present at that
+point.
If the pointer to the RSDP table is correct, the table will be mapped into
the kernel by the ACPI core, using the address provided by UEFI.
@@ -65,7 +162,8 @@ be ignored on arm64.
Hardware reduced mode (see Section 4.1 of the ACPI 5.1 specification) will
be enforced by the ACPI core on arm64. Doing so allows the ACPI core to
run less complex code since it no longer has to provide support for legacy
-hardware from other architectures.
+hardware from other architectures. Any fields that are not to be used for
+hardware reduced mode must be set to zero.
For the ACPI core to operate properly, and in turn provide the information
the kernel needs to configure devices, it expects to find the following
@@ -123,27 +221,9 @@ invoke the method and not concern itself with what the method needs to do
to change the clock. Changing the hardware can then take place over time
by changing what the ACPI method does, and not the driver.
-ACPI drivers should only look at one specific ASL object -- the _DSD object
--- for device driver parameters (known in DT as "bindings", or "Device
-Properties" in ACPI). DT bindings also will be reviewed before used. The UEFI
-Forum provides a mechanism for registering such bindings [URL TBD by ASWG]
-so that they may be used on any operating system supporting ACPI. Device
-properties that have not been registered with the UEFI Forum should not be
-used.
-
-Drivers should look for device properties in the _DSD object ONLY; the _DSD
-object is described in the ACPI specification section 6.2.5, but more
-specifically, use the _DSD Device Properties UUID:
-
- -- UUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301
-
- -- http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UU…
-
-The kernel has an interface for looking up device properties in a manner
-independent of whether DT or ACPI is being used and that interface should
-be used; it can eliminate some duplication of code paths in driver probing
-functions and discourage divergence between DT bindings and ACPI device
-properties.
+In DT, the parameters needed by the driver to set up clocks as in the example
+above are known as "bindings"; in ACPI, these are known as "Device Properties"
+and provided to a driver via the _DSD object.
ACPI tables are described with a formal language called ASL, the ACPI
Source Language (section 19 of the specification). This means that there
@@ -166,19 +246,53 @@ be used if _DSD cannot represent the data required, and there is no way
to create a new UUID for the _DSD object. Note that there is even less
regulation of the use of _DSM than there is of _DSD. Drivers that depend
on the contents of _DSM objects will be more difficult to maintain over
-time because of this.
+time because of this; as of this writing, the use of _DSM is the cause
+of quite a few firmware problems and is not recommended.
+
+Drivers should look for device properties in the _DSD object ONLY; the _DSD
+object is described in the ACPI specification section 6.2.5, but this only
+describes how to define the structure of an object returned via _DSD, and
+how specific data structures are defined by specific UUIDs. Linux should
+only use the _DSD Device Properties UUID [5]:
-The _DSD object is a very flexible mechanism in ACPI, as are the registered
-Device Properties. This flexibility allows _DSD to cover more than just the
-generic server case and care should be taken in device drivers not to expect
-it to replicate highly specific embedded behaviour from DT.
+ -- UUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301
+
+ -- http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UU…
-Both DT bindings and ACPI device properties for device drivers have review
-processes. Use them. And, before creating new device properties, check to
-be sure that they have not been defined before and either registered in the
-Linux kernel documentation or the UEFI Forum. If the device drivers supports
-ACPI and DT, please make sure the device properties are consistent in both
-places.
+The UEFI Forum provides a mechanism for registering device properties [4]
+so that they may be used across all operating systems supporting ACPI.
+Device properties that have not been registered with the UEFI Forum should
+not be used.
+
+Before creating new device properties, check to be sure that they have not
+been defined before and either registered in the Linux kernel documentation
+as DT bindings, or the UEFI Forum as device properties. While we do not want
+to simply move all DT bindings into ACPI device properties, we can learn from
+what has been previously defined.
+
+If it is necessary to define a new device property, or if it makes sense to
+synthesize the definition of a binding so it can be used in any firmware,
+both DT bindings and ACPI device properties for device drivers have review
+processes. Use them both. When the driver itself is submitted for review
+to the Linux mailing lists, the device property definitions needed must be
+submitted at the same time. A driver that supports ACPI and uses device
+properties will not be considered complete without their definitions. Once
+the device property has been accepted by the Linux community, it must be
+registered with the UEFI Forum [4], which will review it again for consistency
+within the registry. This may require iteration. The UEFI Forum, though,
+will always be the canonical site for device property definitions.
+
+It may make sense to provide notice to the UEFI Forum that there is the
+intent to register a previously unused device property name as a means of
+reserving the name for later use. Other operating system vendors will
+also be submitting registration requests and this may help smooth the
+process.
+
+Once registration and review have been completed, the kernel provides an
+interface for looking up device properties in a manner independent of
+whether DT or ACPI is being used. This API should be used [6]; it can
+eliminate some duplication of code paths in driver probing functions and
+discourage divergence between DT bindings and ACPI device properties.
Programmable Power Control Resources
@@ -186,6 +300,9 @@ Programmable Power Control Resources
Programmable power control resources include such resources as voltage/current
providers (regulators) and clock sources.
+With ACPI, the kernel clock and regulator framework is not expected to be used
+at all.
+
The kernel assumes that power control of these resources is represented with
Power Resource Objects (ACPI section 7.1). The ACPI core will then handle
correctly enabling and disabling resources as they are needed. In order to
@@ -194,8 +311,10 @@ can be controlled through the optional ACPI methods _PS0, _PS1, _PS2, and _PS3;
in ACPI, _PS0 is the method to invoke to turn a device full on, and _PS3 is for
turning a device full off.
-There are two options for using those Power Resources.
- -- be managed in _PSx routine which gets called on entry to Dx.
+There are two options for using those Power Resources. They can:
+
+ -- be managed in a _PSx method which gets called on entry to power
+ state Dx.
-- be declared separately as power resources with their own _ON and _OFF
methods. They are then tied back to D-states for a particular device
@@ -232,14 +351,22 @@ UEFI, in this case -- to some working value before control is handed over
to the kernel. This has implications for devices such as UARTs, or SoC-driven
LCD displays, for example.
-When the kernel boots, the clock is assumed to be set to a reasonable
-working value. If for some reason the frequency needs to change -- e.g.,
+When the kernel boots, the clocks are assumed to be set to reasonable
+working values. If for some reason the frequency needs to change -- e.g.,
throttling for power management -- the device driver should expect that
process to be abstracted out into some ACPI method that can be invoked
(please see the ACPI specification for further recommendations on standard
-methods to be expected) except CPU clocks where CPPC provides a much richer
-interface instead of some method. If it is not, there is no direct way for
-ACPI to control the clocks.
+methods to be expected). The only exceptions to this are CPU clocks where
+CPPC provides a much richer interface than ACPI methods. If the clocks
+are not set, there is no direct way for Linux to control them.
+
+If an SoC vendor wants to provide fine-grained control of the system clocks,
+they could do so by providing ACPI methods that could be invoked by Linux
+drivers. However, this is NOT recommended and Linux drivers should NOT use
+such methods, even if they are provided. Such methods are not currently
+standardized in the ACPI specification, and using them could tie a kernel
+to a very specific SoC, or tie an SoC to a very specific version of the
+kernel, both of which we are trying to avoid.
Driver Recommendations
@@ -303,14 +430,11 @@ MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match);
ASWG
----
-The following areas are not yet fully defined for ARM in the 5.1 version
-of the ACPI specification and are expected to be worked through in the
-UEFI ACPI Specification Working Group (ASWG):
-
- -- ACPI based CPU topology
- -- ACPI based CPU idle control
- -- ACPI based SMMU and its IO topology
- -- ITS support for GIC in MADT
+The ACPI specification changes regularly. During the year 2014, for instance,
+version 5.1 was released and version 6.0 substantially completed, with most of
+the changes being driven by ARM-specific requirements. Proposed changes are
+presented and discussed in the ASWG (ACPI Specification Working Group) which
+is a part of the UEFI Forum.
Participation in this group is open to all UEFI members. Please see
http://www.uefi.org/workinggroup for details on group membership.
@@ -325,3 +449,74 @@ it from being used on a platform, ECRs (Engineering Change Requests) should be
submitted to ASWG and go through the normal approval process; for those that
are not UEFI members, many other members of the Linux community are and would
likely be willing to assist in submitting ECRs.
+
+
+Linux Code
+----------
+Individual items specific to Linux on ARM, contained in the the Linux
+source code, are in the list that follows:
+
+ACPI_OS_NAME This macro defines the string to be returned when
+ an ACPI method invokes the _OS method. On ARM64
+ systems, this macro will be "Linux" by default.
+ The command line parameter acpi_os=<string>
+ can be used to set it to some other value. The
+ default value for other architectures is "Microsoft
+ Windows NT", for example.
+
+ACPI Objects
+------------
+Detailed expectations for ACPI tables and object are listed in the file
+Documentation/arm64/acpi_object_usage.txt.
+
+
+References
+----------
+[0] http://silver.arm.com -- document ARM-DEN-0029, or newer
+ "Server Base System Architecture", version 2.3, dated 27 Mar 2014
+
+[1] http://infocenter.arm.com/help/topic/com.arm.doc.den0044a/Server_Base_Boot_…
+ Document ARM-DEN-0044A, or newer: "Server Base Boot Requirements, System
+ Software on ARM Platforms", dated 16 Aug 2014
+
+[2] http://www.secretlab.ca/archives/151, 10 Jan 2015, Copyright (c) 2015
+ by Grant Likely. A copy of the verbatim text (apart from formatting)
+ is also kept in Documentation/arm64/why_use_acpi.txt.
+
+[3] AMD ACPI for Seattle platform documentation:
+ http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/Seattle_ACPI…
+
+[4] http://www.uefi.org/acpi -- please see the link for the "ACPI _DSD Device
+ Property Registry Instructions"
+
+[5] http://www.uefi.org/acpi -- please see the link for the "_DSD (Device
+ Specific Data) Implementation Guide"
+
+[6] Kernel code for the unified device property interface can be found in
+ include/linux/property.h and drivers/base/property.c.
+
+
+TODO List
+---------
+These are things that still need to be completed for this document.
+
+-- Do we need license/copyright from Grant for blog post?
+
+-- _OSC discussion; must decide on a process for device-specific methods?
+ or just ban them and insist on _DSD?
+
+-- FWTS tests are needed:
+ -- WARN if there are any invocations of _OS
+
+ -- FAIL is there are any invocations of _OSI
+
+ -- _OSC: TBD
+
+
+Authors
+-------
+Al Stone <al.stone(a)linaro.org>
+Graeme Gregory <graeme.gregory(a)linaro.org>
+Hanjun Guo <hanjun.guo(a)linaro.org>
+
+
diff --git a/Documentation/arm64/why_use_acpi.txt b/Documentation/arm64/why_use_acpi.txt
new file mode 100644
index 0000000..480a9ad
--- /dev/null
+++ b/Documentation/arm64/why_use_acpi.txt
@@ -0,0 +1,228 @@
+Why ACPI on ARM? [2]
+--------------------
+Why are we doing ACPI on ARM? That question has been asked many times, but
+we haven’t yet had a good summary of the most important reasons for wanting
+ACPI on ARM. This article is an attempt to state the rationale clearly.
+
+During an email conversation late last year, Catalin Marinas asked for
+a summary of exactly why we want ACPI on ARM, Dong Wei replied with the
+following list:
+> 1. Support multiple OSes, including Linux and Windows
+> 2. Support device configurations
+> 3. Support dynamic device configurations (hot add/removal)
+> 4. Support hardware abstraction through control methods
+> 5. Support power management
+> 6. Support thermal management
+> 7. Support RAS interfaces
+
+The above list is certainly true in that all of them need to be supported.
+However, that list doesn’t give the rationale for choosing ACPI. We already
+have DT mechanisms for doing most of the above, and can certainly create
+new bindings for anything that is missing. So, if it isn’t an issue of
+functionality, then how does ACPI differ from DT and why is ACPI a better
+fit for general purpose ARM servers?
+
+The difference is in the support model. To explain what I mean, I’m first
+going to expand on each of the items above and discuss the similarities and
+differences between ACPI and DT. Then, with that as the groundwork, I’ll
+discuss how ACPI is a better fit for the general purpose hardware support
+model.
+
+
+Device Configurations
+---------------------
+2. Support device configurations
+3. Support dynamic device configurations (hot add/removal)
+
+From day one, DT was about device configurations. There isn’t any significant
+difference between ACPI & DT here. In fact, the majority of ACPI tables are
+completely analogous to DT descriptions. With the exception of the DSDT and
+SSDT tables, most ACPI tables are merely flat data used to describe hardware.
+
+DT platforms have also supported dynamic configuration and hotplug for years.
+There isn’t a lot here that differentiates between ACPI and DT. The biggest
+difference is that dynamic changes to the ACPI namespace can be triggered by
+ACPI methods, whereas for DT changes are received as messages from firmware
+and have been very much platform specific (e.g. IBM pSeries does this)
+
+
+Power Management
+----------------
+4. Support hardware abstraction through control methods
+5. Support power management
+6. Support thermal management
+
+Power, thermal, and clock management can all be dealt with as a group. ACPI
+defines a power management model (OSPM) that both the platform and the OS
+conform to. The OS implements the OSPM state machine, but the platform can
+provide state change behaviour in the form of bytecode methods. Methods can
+access hardware directly or hand off PM operations to a coprocessor. The OS
+really doesn’t have to care about the details as long as the platform obeys
+the rules of the OSPM model.
+
+With DT, the kernel has device drivers for each and every component in the
+platform, and configures them using DT data. DT itself doesn’t have a PM model.
+Rather the PM model is an implementation detail of the kernel. Device drivers
+use DT data to decide how to handle PM state changes. We have clock, pinctrl,
+and regulator frameworks in the kernel for working out runtime PM. However,
+this only works when all the drivers and support code have been merged into
+the kernel. When the kernel’s PM model doesn’t work for new hardware, then we
+change the model. This works very well for mobile/embedded because the vendor
+controls the kernel. We can change things when we need to, but we also struggle
+with getting board support mainlined.
+
+This difference has a big impact when it comes to OS support. Engineers from
+hardware vendors, Microsoft, and most vocally Red Hat have all told me bluntly
+that rebuilding the kernel doesn’t work for enterprise OS support. Their model
+is based around a fixed OS release that ideally boots out-of-the-box. It may
+still need additional device drivers for specific peripherals/features, but
+from a system view, the OS works. When additional drivers are provided
+separately, those drivers fit within the existing OSPM model for power
+management. This is where ACPI has a technical advantage over DT. The ACPI
+OSPM model and it’s bytecode gives the HW vendors a level of abstraction
+under their control, not the kernel’s. When the hardware behaves differently
+from what the OS expects, the vendor is able to change the behaviour without
+changing the HW or patching the OS.
+
+At this point you’d be right to point out that it is harder to get the whole
+system working correctly when behaviour is split between the kernel and the
+platform. The OS must trust that the platform doesn’t violate the OSPM model.
+All manner of bad things happen if it does. That is exactly why the DT model
+doesn’t encode behaviour: It is easier to make changes and fix bugs when
+everything is within the same code base. We don’t need a platform/kernel
+split when we can modify the kernel.
+
+However, the enterprise folks don’t have that luxury. The platform/kernel
+split isn’t a design choice. It is a characteristic of the market. Hardware
+and OS vendors each have their own product timetables, and they don’t line
+up. The timeline for getting patches into the kernel and flowing through into
+OS releases puts OS support far downstream from the actual release of hardware.
+Hardware vendors simply cannot wait for OS support to come online to be able to
+release their products. They need to be able to work with available releases,
+and make their hardware behave in the way the OS expects. The advantage of ACPI
+OSPM is that it defines behaviour and limits what the hardware is allowed to do
+without involving the kernel.
+
+What remains is sorting out how we make sure everything works. How do we make
+sure there is enough cross platform testing to ensure new hardware doesn’t
+ship broken and that new OS releases don’t break on old hardware? Those are
+the reasons why a UEFI/ACPI firmware summit is being organized, it’s why the
+UEFI forum holds plugfests 3 times a year, and it is why we’re working on
+FWTS and LuvOS.
+
+
+Reliability, Availability & Serviceability (RAS)
+------------------------------------------------
+7. Support RAS interfaces
+
+This isn’t a question of whether or not DT can support RAS. Of course it can.
+Rather it is a matter of RAS bindings already existing for ACPI, including a
+usage model. We’ve barely begun to explore this on DT. This item doesn’t make
+ACPI technically superior to DT, but it certainly makes it more mature.
+
+
+Multiplatform Support
+---------------------
+1. Support multiple OSes, including Linux and Windows
+
+I’m tackling this item last because I think it is the most contentious for
+those of us in the Linux world. I wanted to get the other issues out of the
+way before addressing it.
+
+The separation between hardware vendors and OS vendors in the server market
+is new for ARM. For the first time ARM hardware and OS release cycles are
+completely decoupled from each other, and neither are expected to have specific
+knowledge of the other (ie. the hardware vendor doesn’t control the choice of
+OS). ARM and their partners want to create an ecosystem of independent OSes
+and hardware platforms that don’t explicitly require the former to be ported
+to the latter.
+
+Now, one could argue that Linux is driving the potential market for ARM
+servers, and therefore Linux is the only thing that matters, but hardware
+vendors don’t see it that way. For hardware vendors it is in their best
+interest to support as wide a choice of OSes as possible in order to catch
+the widest potential customer base. Even if the majority choose Linux, some
+will choose BSD, some will choose Windows, and some will choose something
+else. Whether or not we think this is foolish is beside the point; it isn’t
+something we have influence over.
+
+During early ARM server planning meetings between ARM, its partners and other
+industry representatives (myself included) we discussed this exact point.
+Before us were two options, DT and ACPI. As one of the Linux people in the
+room, I advised that ACPI’s closed governance model was a show stopper for
+Linux and that DT is the working interface. Microsoft on the other hand made
+it abundantly clear that ACPI was the only interface that they would support.
+For their part, the hardware vendors stated the platform abstraction behaviour
+of ACPI is a hard requirement for their support model and that they would not
+close the door on either Linux or Windows.
+
+However, the one thing that all of us could agree on was that supporting
+multiple interfaces doesn’t help anyone: It would require twice as much
+effort on defining bindings (once for Linux-DT and once for Windows-ACPI)
+and it would require firmware to describe everything twice. Eventually we
+reached the compromise to use ACPI, but on the condition of opening the
+governance process to give Linux engineers equal influence over the
+specification. The fact that we now have a much better seat at the ACPI
+table, for both ARM and x86, is a direct result of these early ARM server
+negotiations. We are no longer second class citizens in the ACPI world and
+are actually driving much of the recent development.
+
+I know that this line of thought is more about market forces rather than a
+hard technical argument between ACPI and DT, but it is an equally significant
+one. Agreeing on a single way of doing things is important. The ARM server
+ecosystem is better for the agreement to use the same interface for all
+operating systems. This is what is meant by standards compliant. The standard
+is a codification of the mutually agreed interface. It provides confidence
+that all vendors are using the same rules for interoperability.
+
+
+Summary
+-------
+To summarize, here is the short form rationale for ACPI on ARM:
+
+-- ACPI’s bytecode allows the platform to encode behaviour. DT explicitly
+ does not support this. For hardware vendors, being able to encode behaviour
+ is an important tool for supporting operating system releases on new
+ hardware.
+
+-- ACPI’s OSPM defines a power management model that constrains what the
+ platform is allowed into a specific model while still having flexibility
+ in hardware design.
+
+-- For enterprise use-cases, ACPI has extablished bindings, such as for RAS,
+ which are used in production. DT does not. Yes, we can define those bindings
+ but doing so means ARM and x86 will use completely different code paths in
+ both firmware and the kernel.
+
+-- Choosing a single interface for platform/OS abstraction is important. It
+ is not reasonable to require vendors to implement both DT and ACPI if they
+ want to support multiple operating systems. Agreeing on a single interface
+ instead of being fragmented into per-OS interfaces makes for better
+ interoperability overall.
+
+-- The ACPI governance process works well and we’re at the same table as HW
+ vendors and other OS vendors. In fact, there is no longer any reason to
+ feel that ACPI is a Windows thing or that we are playing second fiddle to
+ Microsoft. The move of ACPI governance into the UEFI forum has significantly
+ opened up the processes, and currently, a large portion of the changes being
+ made to ACPI is being driven by Linux.
+
+At the beginning of this article I made the statement that the difference
+is in the support model. For servers, responsibility for hardware behaviour
+cannot be purely the domain of the kernel, but rather is split between the
+platform and the kernel. ACPI frees the OS from needing to understand all
+the minute details of the hardware so that the OS doesn’t need to be ported
+to each and every device individually. It allows the hardware vendors to take
+responsibility for PM behaviour without depending on an OS release cycle which
+it is not under their control.
+
+ACPI is also important because hardware and OS vendors have already worked
+out how to use it to support the general purpose ecosystem. The infrastructure
+is in place, the bindings are in place, and the process is in place. DT does
+exactly what we need it to when working with vertically integrated devices,
+but we don’t have good processes for supporting what the server vendors need.
+We could potentially get there with DT, but doing so doesn’t buy us anything.
+ACPI already does what the hardware vendors need, Microsoft won’t collaborate
+with us on DT, and the hardware vendors would still need to provide two
+completely separate firmware interface; one for Linux and one for Windows.
+
--
2.1.0
From: Al Stone <ahs3(a)redhat.com>
While Hanjun cleaned up most of the commentary on the arm-acpi.txt file,
this patch goes several steps further. The biggest change to the existing
documentation was to add a section describing why ACPI is wanted, and to
do a lot of editing for continuity, and hopefully clarity.
Two documentation files are also being added:
(1) A verbatim copy of the "Why ACPI on ARM?" blog posting by Grant Likely,
which is also summarized in arm-acpi.txt, and
(2) A section by section review of the ACPI spec (acpi_object_usage.txt)
to note recommendations and prohibitions on the use of the numerous
ACPI tables and objects. This sets out the current expectations of
the firmware by Linux very explicitly (or as explicitly as I can, for
now).
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
Documentation/arm64/acpi_object_usage.txt | 592 ++++++++++++++++++++++++++++++
Documentation/arm64/arm-acpi.txt | 307 ++++++++++++----
Documentation/arm64/why_use_acpi.txt | 231 ++++++++++++
3 files changed, 1066 insertions(+), 64 deletions(-)
create mode 100644 Documentation/arm64/acpi_object_usage.txt
create mode 100644 Documentation/arm64/why_use_acpi.txt
diff --git a/Documentation/arm64/acpi_object_usage.txt b/Documentation/arm64/acpi_object_usage.txt
new file mode 100644
index 0000000..2c4f733
--- /dev/null
+++ b/Documentation/arm64/acpi_object_usage.txt
@@ -0,0 +1,592 @@
+ACPI Tables
+-----------
+The expectations of individual ACPI tables are discussed in the list that
+follows.
+
+If a section number is used, it refers to a section number in the ACPI
+specification where the object is defined. If "Signature Reserved" is used,
+the table signature (the first four bytes of the table) is the only portion
+of the table recognized by the specification, and the actual table is defined
+outside of the UEFI Forum (see Section 5.2.6 of the specification).
+
+For ACPI on arm64, tables also fall into the following categories:
+
+ -- Required: DSDT, FADT, GTDT, MADT, MCFG, RSDP, SPCR, XSDT
+
+ -- Recommended: BERT, EINJ, ERST, HEST, SSDT
+
+ -- Optional: BGRT, CPEP, CSRT, DRTM, ECDT, FACS, FPDT, MCHI, MPST,
+ MSCT, RASF, SBST, SLIT, SPMI, SRAT, TCPA, TPM2, UEFI
+
+ -- Not supported: BOOT, DBG2, DBGP, DMAR, ETDT, HPET, IBFT, IVRS,
+ LPIT, MSDM, RSDT, SLIC, WAET, WDAT, WDRT, WPBT
+
+
+Table Usage for ARMv8 Linux
+----- ----------------------------------------------------------------
+BERT Section 18.3 (signature == "BERT")
+ == Boot Error Record Table ==
+ Must be supplied if RAS support is provided by the platform. It
+ is recommended this table be supplied.
+
+BOOT Signature Reserved (signature == "BOOT")
+ == simple BOOT flag table ==
+ Microsoft only table, will not be supported.
+
+BGRT Section 5.2.22 (signature == "BGRT")
+ == Boot Graphics Resource Table ==
+ Optional, not currently supported, with no real use-case for an
+ ARM server.
+
+CPEP Section 5.2.18 (signature == "CPEP")
+ == Corrected Platform Error Polling table ==
+ Optional, not currently supported, and not recommended until such
+ time as ARM-compatible hardware is available, and the specification
+ suitably modified.
+
+CSRT Signature Reserved (signature == "CSRT")
+ == Core System Resources Table ==
+ Optional, not currently supported.
+
+DBG2 Signature Reserved (signature == "DBG2")
+ == DeBuG port table 2 ==
+ Microsoft only table, will not be supported.
+
+DBGP Signature Reserved (signature == "DBGP")
+ == DeBuG Port table ==
+ Microsoft only table, will not be supported.
+
+DSDT Section 5.2.11.1 (signature == "DSDT")
+ == Differentiated System Description Table ==
+ A DSDT is required; see also SSDT.
+
+ ACPI tables contain only one DSDT but can contain one or more SSDTs,
+ which are optional. Each SSDT can only add to the ACPI namespace,
+ but cannot modify or replace anything in the DSDT.
+
+DMAR Signature Reserved (signature == "DMAR")
+ == DMA Remapping table ==
+ x86 only table, will not be supported.
+
+DRTM Signature Reserved (signature == "DRTM")
+ == Dynamic Root of Trust for Measurement table ==
+ Optional, not currently supported.
+
+ECDT Section 5.2.16 (signature == "ECDT")
+ == Embedded Controller Description Table ==
+ Optional, not currently supported, but could be used on ARM if and
+ only if one uses the GPE_BIT field to represent an IRQ number, since
+ there are no GPE blocks defined in hardware reduced mode. This would
+ need to be modified in the ACPI specification.
+
+EINJ Section 18.6 (signature == "EINJ")
+ == Error Injection table ==
+ This table is very useful for testing platform response to error
+ conditions; it allows one to inject an error into the system as
+ if it had actually occurred. However, this table should not be
+ shipped with a production system; it should be dynamically loaded
+ and executed with the ACPICA tools only during testing.
+
+ERST Section 18.5 (signature == "ERST")
+ == Error Record Serialization Table ==
+ Must be supplied if RAS support is provided by the platform. It
+ is recommended this table be supplied.
+
+ETDT Signature Reserved (signature == "ETDT")
+ == Event Timer Description Table ==
+ Obsolete table, will not be supported.
+
+FACS Section 5.2.10 (signature == "FACS")
+ == Firmware ACPI Control Structure ==
+ It is unlikely that this table will be terribly useful. If it is
+ provided, the Global Lock will NOT be used since it is not part of
+ the hardware reduced profile, and only 64-bit address fields will
+ be considered valid.
+
+FADT Section 5.2.9 (signature == "FACP")
+ == Fixed ACPI Description Table ==
+ Required for arm64.
+
+ The HW_REDUCED_ACPI flag must be set. All of the fields that are
+ to be ignored when HW_REDUCED_ACPI is set are expected to be set to
+ zero.
+
+ If an FACS table is provided, the X_FIRMWARE_CTRL field is to be
+ used, not FIRMWARE_CTRL.
+
+ If PSCI is used (as is recommended), make sure that ARM_BOOT_ARCH is
+ filled in properly -- that the PSCI_COMPLIANT flag is set and that
+ PSCI_USE_HVC is set or unset as needed (see table 5-37).
+
+ For the DSDT that is also required, the X_DSDT field is to be used,
+ not the DSDT field.
+
+FPDT Section 5.2.23 (signature == "FPDT")
+ == Firmware Performance Data Table ==
+ Optional, not currently supported.
+
+GTDT Section 5.2.24 (signature == "GTDT")
+ == Generic Timer Description Table ==
+ Required for arm64.
+
+HEST Section 18.3.2 (signature == "HEST")
+ == Hardware Error Source Table ==
+ Until further error source types are defined, use only types 6 (AER
+ Root Port), 7 (AER Endpoint), 8 (AER Bridge), or 9 (Generic Hardware
+ Error Source). Firmware first error handling is possible if and only
+ if Trusted Firmware is being used on arm64.
+
+ Must be supplied if RAS support is provided by the platform. It
+ is recommended this table be supplied.
+
+HPET Signature Reserved (signature == "HPET")
+ == High Precision Event timer Table ==
+ x86 only table, will not be supported.
+
+IBFT Signature Reserved (signature == "IBFT")
+ == iSCSI Boot Firmware Table ==
+ Microsoft defined table, support TBD.
+
+IVRS Signature Reserved (signature == "IVRS")
+ == I/O Virtualization Reporting Structure ==
+ x86_64 (AMD) only table, will not be supported.
+
+LPIT Signature Reserved (signature == "LPIT")
+ == Low Power Idle Table ==
+ x86 only table as of ACPI 5.1; future versions have been adapted for
+ use with ARM and will be recommended in order to support ACPI power
+ management.
+
+MADT Section 5.2.12 (signature == "APIC")
+ == Multiple APIC Description Table ==
+ Required for arm64. Only the GIC interrupt controller structures
+ should be used (types 0xA - 0xE).
+
+MCFG Signature Reserved (signature == "MCFG")
+ == Memory-mapped ConFiGuration space ==
+ If the platform supports PCI/PCIe, an MCFG table is required.
+
+MCHI Signature Reserved (signature == "MCHI")
+ == Management Controller Host Interface table ==
+ Optional, not currently supported.
+
+MPST Section 5.2.21 (signature == "MPST")
+ == Memory Power State Table ==
+ Optional, not currently supported.
+
+MSDM Signature Reserved (signature == "MSDM")
+ == Microsoft Data Management table ==
+ Microsoft only table, will not be supported.
+
+MSCT Section 5.2.19 (signature == "MSCT")
+ == Maximum System Characteristic Table ==
+ Optional, not currently supported.
+
+RASF Section 5.2.20 (signature == "RASF")
+ == RAS Feature table ==
+ Optional, not currently supported.
+
+RSDP Section 5.2.5 (signature == "RSD PTR")
+ == Root System Description PoinTeR ==
+ Required for arm64.
+
+RSDT Section 5.2.7 (signature == "RSDT")
+ == Root System Description Table ==
+ Since this table can only provide 32-bit addresses, it is deprecated
+ on arm64, and will not be used.
+
+SBST Section 5.2.14 (signature == "SBST")
+ == Smart Battery Subsystem Table ==
+ Optional, not currently supported.
+
+SLIC Signature Reserved (signature == "SLIC")
+ == Software LIcensing table ==
+ Microsoft only table, will not be supported.
+
+SLIT Section 5.2.17 (signature == "SLIT")
+ == System Locality distance Information Table ==
+ Optional in general, but required for NUMA systems.
+
+SPCR Signature Reserved (signature == "SPCR")
+ == Serial Port Console Redirection table ==
+ Required for arm64.
+
+SPMI Signature Reserved (signature == "SPMI")
+ == Server Platform Management Interface table ==
+ Optional, not currently supported.
+
+SRAT Section 5.2.16 (signature == "SRAT")
+ == System Resource Affinity Table ==
+ Optional, but if used, only the GICC Affinity structures are read.
+ To support NUMA, this table is required.
+
+SSDT Section 5.2.11.2 (signature == "SSDT")
+ == Secondary System Description Table ==
+ These tables are a continuation of the DSDT; these are recommended
+ for use with devices that can be added to a running system, but can
+ also serve the purpose of dividing up device descriptions into more
+ manageable pieces.
+
+ An SSDT can only ADD to the ACPI namespace. It cannot modify or
+ replace existing device descriptions already in the namespace.
+
+ These tables are optional, however. ACPI tables should contain only
+ one DSDT but can contain many SSDTs.
+
+TCPA Signature Reserved (signature == "TCPA")
+ == Trusted Computing Platform Alliance table ==
+ Optional, not currently supported, and may need changes to fully
+ interoperate with arm64.
+
+TPM2 Signature Reserved (signature == "TPM2")
+ == Trusted Platform Module 2 table ==
+ Optional, not currently supported, and may need changes to fully
+ interoperate with arm64.
+
+UEFI Signature Reserved (signature == "UEFI")
+ == UEFI ACPI data table ==
+ Optional, not currently supported. No known use case for arm64,
+ at present.
+
+WAET Signature Reserved (signature == "WAET")
+ == Windows ACPI Emulated devices Table ==
+ Microsoft only table, will not be supported.
+
+WDAT Signature Reserved (signature == "WDAT")
+ == Watch Dog Action Table ==
+ Microsoft only table, will not be supported.
+
+WDRT Signature Reserved (signature == "WDRT")
+ == Watch Dog Resource Table ==
+ Microsoft only table, will not be supported.
+
+WPBT Signature Reserved (signature == "WPBT")
+ == Windows Platform Binary Table ==
+ Microsoft only table, will not be supported.
+
+XSDT Section 5.2.8 (signature == "XSDT")
+ == eXtended System Description Table ==
+ Required for arm64.
+
+
+ACPI Objects
+------------
+The expectations on individual ACPI objects are discussed in the list that
+follows:
+
+Name Section Usage for ARMv8 Linux
+---- ------------ -------------------------------------------------
+_ADR 6.1.1 Use as needed.
+
+_BBN 6.5.5 Use as needed; PCI-specific.
+
+_BDN 6.5.3 Optional; not likely to be used on arm64.
+
+_CCA 6.2.17 This method should be defined for all bus masters
+ on arm64. While cache coherency is assumed, making
+ it explicit ensures the kernel will set up DMA as
+ it should.
+
+_CDM 6.2.1 Optional, to be used only for processor devices.
+
+_CID 6.1.2 Use as needed.
+
+_CLS 6.1.3 Use as needed.
+
+_CRS 6.2.2 Required on arm64.
+
+_DCK 6.5.2 Optional; not likely to be used on arm64.
+
+_DDN 6.1.4 This field can be used for a device name. However,
+ it is meant for DOS device names (e.g., COM1), so be
+ careful of its use across OSes.
+
+_DEP 6.5.8 Use as needed.
+
+_DIS 6.2.3 Optional, for power management use.
+
+_DLM 5.7.5 Optional.
+
+_DMA 6.2.4 Optional.
+
+_DSD 6.2.5 To be used with caution. If this object is used, try
+ to use it within the constraints already defined by the
+ Device Properties UUID. Only in rare circumstances
+ should it be necessary to create a new _DSD UUID.
+
+ In either case, submit the _DSD definition along with
+ any driver patches for discussion, especially when
+ device properties are used. A driver will not be
+ considered complete without a corresponding _DSD
+ description. Once approved by kernel maintainers,
+ the UUID or device properties must then be registered
+ with the UEFI Forum; this may cause some iteration as
+ more than one OS will be registering entries.
+
+_DSM Do not use this method. It is not standardized, the
+ return values are not well documented, and it is
+ currently a frequent source of error.
+
+_DSW 7.2.1 Use as needed; power management specific.
+
+_EDL 6.3.1 Optional.
+
+_EJD 6.3.2 Optional.
+
+_EJx 6.3.3 Optional.
+
+_FIX 6.2.7 x86 specific, not used on arm64.
+
+\_GL 5.7.1 This object is not to be used in hardware reduced
+ mode, and therefore should not be used on arm64.
+
+_GLK 6.5.7 This object requires a global lock be defined; there
+ is no global lock on arm64 since it runs in hardware
+ reduced mode. Hence, do not use this object on arm64.
+
+\_GPE 5.3.1 This namespace is for x86 use only. Do not use it
+ on arm64.
+
+_GSB 6.2.7 Optional.
+
+_HID 6.1.5 Use as needed. This is the primary object to use in
+ device probing, though _CID and _CLS may also be used.
+
+_HPP 6.2.8 Optional, PCI specific.
+
+_HPX 6.2.9 Optional, PCI specific.
+
+_HRV 6.1.6 Optional, use as needed to clarify device behavior; in
+ some cases, this may be easier to use than _DSD.
+
+_INI 6.5.1 Not required, but can be useful in setting up devices
+ when UEFI leaves them in a state that may not be what
+ the driver expects before it starts probing.
+
+_IRC 7.2.15 Use as needed; power management specific.
+
+_LCK 6.3.4 Optional.
+
+_MAT 6.2.10 Optional; see also the MADT.
+
+_MLS 6.1.7 Optional, but highly recommended for use in
+ internationalization.
+
+_OFF 7.1.2 It is recommended to define this method for any device
+ that can be turned on or off.
+
+_ON 7.1.3 It is recommended to define this method for any device
+ that can be turned on or off.
+
+\_OS 5.7.3 This method will return "Linux" by default (this is
+ the value of the macro ACPI_OS_NAME on Linux). The
+ command line parameter acpi_os=<string> can be used
+ to set it to some other value.
+
+_OSC 6.2.11 This method can be a global method in ACPI (i.e.,
+ \_SB._OSC), or it may be associated with a specific
+ device (e.g., \_SB.DEV0._OSC), or both. When used
+ as a global method, only capabilities published in
+ the ACPI specification are allowed. When used as
+ a device-specifc method, the process described for
+ using _DSD MUST be used to create an _OSC definition;
+ out-of-process use of _OSC is not allowed. That is,
+ submit the device-specific _OSC usage description as
+ part of the kernel driver submission, get it approved
+ by the kernel community, then register it with the
+ UEFI Forum.
+
+\_OSI 5.7.2 Deprecated on ARM64. Any invocation of this method
+ will print a warning on the console and return false.
+ That is, as far as ACPI firmware is concerned, _OSI
+ cannot be used to determine what sort of system is
+ being used or what functionality is provided. The
+ _OSC method is to be used instead.
+
+_OST 6.3.5 Optional.
+
+_PDC 8.4.1 Deprecated, do not use on arm64.
+
+\_PIC 5.8.1 The method should not be used. On arm64, the only
+ interrupt model available is GIC.
+
+_PLD 6.1.8 Optional.
+
+\_PR 5.3.1 This namespace is for x86 use only on legacy systems.
+ Do not use it on arm64.
+
+_PRS 6.2.12 Optional.
+
+_PRT 6.2.13 Required as part of the definition of all PCI root
+ devices.
+
+_PRW 7.2.13 Use as needed; power management specific.
+
+_PRx 7.2.8-11 Use as needed; power management specific. If _PR0 is
+ defined, _PR3 must also be defined.
+
+_PSC 7.2.6 Use as needed; power management specific.
+
+_PSE 7.2.7 Use as needed; power management specific.
+
+_PSW 7.2.14 Use as needed; power management specific.
+
+_PSx 7.2.2-5 Use as needed; power management specific. If _PS0 is
+ defined, _PS3 must also be defined. If clocks or
+ regulators need adjusting to be consistent with power
+ usage, change them in these methods.
+
+\_PTS 7.3.1 Use as needed; power management specific.
+
+_PXM 6.2.14 Optional.
+
+_REG 6.5.4 Use as needed.
+
+\_REV 5.7.4 Always returns the latest version of ACPI supported.
+
+_RMV 6.3.6 Optional.
+
+\_SB 5.3.1 Required on arm64; all devices must be defined in this
+ namespace.
+
+_SEG 6.5.6 Use as needed; PCI-specific.
+
+\_SI 5.3.1, Optional.
+ 9.1
+
+_SLI 6.2.15 Optional; recommended when SLIT table is in use.
+
+_STA 6.3.7, It is recommended to define this method for any device
+ 7.1.4 that can be turned on or off.
+
+_SRS 6.2.16 Optional; see also _PRS.
+
+_STR 6.1.10 Recommended for conveying device names to end users;
+ this is preferred over using _DDN.
+
+_SUB 6.1.9 Use as needed; _HID or _CID are preferred.
+
+_SUN 6.1.11 Optional.
+
+\_Sx 7.3.2 Use as needed; power management specific.
+
+_SxD 7.2.16-19 Use as needed; power management specific.
+
+_SxW 7.2.20-24 Use as needed; power management specific.
+
+_SWS 7.3.3 Use as needed; power management specific; this may
+ require specification changes for use on arm64.
+
+\_TTS 7.3.4 Use as needed; power management specific.
+
+\_TZ 5.3.1 Optional.
+
+_UID 6.1.12 Recommended for distinguishing devices of the same
+ class; define it if at all possible.
+
+\_WAK 7.3.5 Use as needed; power management specific.
+
+
+ACPI Event Model
+----------------
+Do not use GPE block devices; these are not supported in the hardware reduced
+profile used by arm64. Since there are no GPE blocks defined for use on ARM
+platforms, GPIO-signaled interrupts should be used for creating system events.
+
+
+ACPI Processor Control
+----------------------
+Section 8 of the ACPI specification is currently undergoing change that
+should be completed in the 6.0 version of the specification. Processor
+performance control will be handled differently for arm64 at that point
+in time. Processor aggregator devices (section 8.5) will not be used,
+for example, but another similar mechanism instead.
+
+While UEFI constrains what we can say until the release of 6.0, it is
+recommended that CPPC (8.4.5) be used as the primary model. This will
+still be useful into the future. C-states and P-states will still be
+provided, but most of the current design work appears to favor CPPC.
+
+Further, it is essential that the ARMv8 SoC provide a fully functional
+implementation of PSCI; this will be the only mechanism supported by ACPI
+to control CPU power state (including secondary CPU booting).
+
+More details will be provided on the release of the ACPI 6.0 specification.
+
+
+ACPI System Address Map Interfaces
+----------------------------------
+In Section 15 of the ACPI specification, several methods are mentioned as
+possible mechanisms for conveying memory resource information to the kernel.
+For arm64, we will only support UEFI for booting with ACPI, hence the UEFI
+GetMemoryMap() boot service is the only mechanism that will be used.
+
+
+ACPI Platform Error Interfaces (APEI)
+-------------------------------------
+The APEI tables supported are described above.
+
+APEI requires the equivalent of an SCI and an NMI on ARMv8. The SCI is used
+to notify the OSPM of errors that have occurred but can be corrected and the
+system can continue correct operation, even if possibly degraded. The NMI is
+used to indicate fatal errors that cannot be corrected, and require immediate
+attention.
+
+Since there is no direct equivalent of the x86 SCI or NMI, arm64 handles
+these slightly differently. The SCI is handled as a normal GPIO-signaled
+interrupt; given that these are corrected (or correctable) errors being
+reported, this is sufficient. The NMI is emulated as the highest priority
+GPIO-signaled interrupt possible. This implies some caution must be used
+since there could be interrupts at higher privilege levels or even interrupts
+at the same priority as the emulated NMI. In Linux, this should not be the
+case but one should be aware it could happen.
+
+
+ACPI Objects Not Supported on ARM64
+-----------------------------------
+While this may change in the future, there are several classes of objects
+that can be defined, but are not currently of general interest to ARM servers.
+
+These are not supported:
+
+ -- Section 9.2: ambient light sensor devices
+
+ -- Section 9.3: battery devices
+
+ -- Section 9.4: lids (e.g., laptop lids)
+
+ -- Section 9.8.2: IDE controllers
+
+ -- Section 9.9: floppy controllers
+
+ -- Section 9.10: GPE block devices
+
+ -- Section 9.15: PC/AT RTC/CMOS devices
+
+ -- Section 9.16: user presence detection devices
+
+ -- Section 9.17: I/O APIC devices; all GICs must be enumerable via MADT
+
+ -- Section 9.18: time and alarm devices (see 9.15)
+
+
+ACPI Objects Not Yet Implemented
+--------------------------------
+While these objects have x86 equivalents, and they do make some sense in ARM
+servers, there is either no hardware available at present, or in some cases
+there may not yet be a non-ARM implementation. Hence, they are currently not
+implemented though that may change in the future.
+
+Not yet implemented are:
+
+ -- Section 10: power source and power meter devices
+
+ -- Section 11: thermal management
+
+ -- Section 12: embedded controllers interface
+
+ -- Section 13: SMBus interfaces
+
+ -- Section 17: NUMA support (prototypes have been submitted for
+ review)
+
diff --git a/Documentation/arm64/arm-acpi.txt b/Documentation/arm64/arm-acpi.txt
index 21e7020..275524e 100644
--- a/Documentation/arm64/arm-acpi.txt
+++ b/Documentation/arm64/arm-acpi.txt
@@ -1,20 +1,107 @@
ACPI on ARMv8 Servers
---------------------
ACPI can be used for ARMv8 general purpose servers designed to follow
-the ARM SBSA (Server Base System Architecture) and SBBR (Server Base
-Boot Requirements) specifications, currently available to those with
-an ARM login at http://silver.arm.com.
+the ARM SBSA (Server Base System Architecture) [0] and SBBR (Server
+Base Boot Requirements) [1] specifications. Please note that the SBBR
+can be retrieved simply by visiting [1], but the SBSA is currently only
+available to those with an ARM login due to ARM IP licensing concerns.
The ARMv8 kernel implements the reduced hardware model of ACPI version
-5.1 and later. Links to the specification and all external documents
+5.1 or later. Links to the specification and all external documents
it refers to are managed by the UEFI Forum. The specification is
-available at http://www.uefi.org/specifications and external documents
-can be found via http://www.uefi.org/acpi.
-
-If an ARMv8 system does not meet the requirements of the SBSA, or cannot
-be described using the mechanisms defined in the required ACPI specifications,
-then it is likely that Device Tree (DT) is more suitable than ACPI for the
-hardware.
+available at http://www.uefi.org/specifications and documents referenced
+by the specification can be found via http://www.uefi.org/acpi.
+
+If an ARMv8 system does not meet the requirements of the SBSA and SBBR,
+or cannot be described using the mechanisms defined in the required ACPI
+specifications, then ACPI may not be a good fit for the hardware.
+
+While the documents mentioned above set out the requirements for building
+industry-standard ARMv8 servers, they also apply to more than one operating
+system. The purpose of this document is to describe the interaction between
+ACPI and Linux only, on an ARMv8 system -- that is, what Linux expects of
+ACPI and what ACPI can expect of Linux.
+
+
+Why ACPI on ARM?
+----------------
+Before examining the details of the interface between ACPI and Linux, it is
+useful to understand why ACPI is being used. Several technologies already
+exist in Linux for describing non-enumerable hardware, after all. In this
+section we summarize a blog post [2] from Grant Likely that outlines the
+reasoning behind ACPI on ARMv8 servers. Actually, we snitch a good portion
+of the summary text almost directly, to be honest.
+
+The short form of the rationale for ACPI on ARM is:
+
+-- ACPI’s bytecode (AML) allows the platform to encode hardware behavior,
+ while DT explicitly does not support this. For hardware vendors, being
+ able to encode behavior is a key tool used in supporting operating
+ system releases on new hardware.
+
+-- ACPI’s OSPM defines a power management model that constrains what the
+ platform is allowed to do into a specific model, while still providing
+ flexibility in hardware design.
+
+-- In the enterprise server environment, ACPI has established bindings (such
+ as for RAS) which are currently used in production systems. DT does not.
+ Such bindings could be defined in DT at some point, but doing so means ARM
+ and x86 would end up using completely different code paths in both firmware
+ and the kernel.
+
+-- Choosing a single interface to describe the abstraction between a platform
+ and an OS is important. Hardware vendors would not be required to implement
+ both DT and ACPI if they want to support multiple operating systems. And,
+ agreeing on a single interface instead of being fragmented into per OS
+ interfaces makes for better interoperability overall.
+
+-- The new ACPI governance process works well and Linux is now at the same
+ table as hardware vendors and other OS vendors. In fact, there is no
+ longer any reason to feel that ACPI is only belongs to Windows or that
+ Linux is in any way secondary to Microsoft in this arena. The move of
+ ACPI governance into the UEFI forum has significantly opened up the
+ specification development process, and currently, a large portion of the
+ changes being made to ACPI is being driven by Linux.
+
+Key to the use of ACPI is the support model. For servers in general, the
+responsibility for hardware behaviour cannot solely be the domain of the
+kernel, but rather must be split between the platform and the kernel, in
+order to allow for orderly change over time. ACPI frees the OS from needing
+to understand all the minute details of the hardware so that the OS doesn’t
+need to be ported to each and every device individually. It allows the
+hardware vendors to take responsibility for power management behaviour without
+depending on an OS release cycle which is not under their control.
+
+ACPI is also important because hardware and OS vendors have already worked
+out the mechanisms for supporting a general purpose computing ecosystem. The
+infrastructure is in place, the bindings are in place, and the processes are
+in place. DT does exactly what Linux needs it to when working with vertically
+integrated devices, but there are no good processes for supporting what the
+server vendors need. Linux could potentially get there with DT, but doing so
+really just duplicates something that already works. ACPI already does what
+the hardware vendors need, Microsoft won’t collaborate on DT, and hardware
+vendors would still end up providing two completely separate firmware
+interfaces -- one for Linux and one for Windows.
+
+
+Kernel Compatibility
+--------------------
+One of the primary motivations for ACPI is standardization, and using that
+to provide backward compatibility for Linux kernels. In the server market,
+software and hardware are often used for long periods. ACPI allows the
+kernel and firmware to agree on a consistent abstraction that can be
+maintained over time, even as hardware or software change. As long as the
+abstraction is supported, systems can be updated without necessarily having
+to replace the kernel.
+
+When a Linux driver or subsystem is first implemented using ACPI, it by
+definition ends up requiring a specific version of the ACPI specification
+-- it's baseline. ACPI firmware must continue to work, even though it may
+not be optimal, with the earliest kernel version that first provides support
+for that baseline version of ACPI. There may be a need for additional drivers,
+but adding new functionality (e.g., CPU power management) should not break
+older kernel versions. Further, ACPI firmware must also work with the most
+recent version of the kernel.
Relationship with Device Tree
@@ -33,17 +120,27 @@ time).
Booting using ACPI tables
-------------------------
The only defined method for passing ACPI tables to the kernel on ARMv8
-is via the UEFI system configuration table.
+is via the UEFI system configuration table. Just so it is explicit, this
+means that ACPI is only supported on platforms that boot via UEFI.
+
+When an ARMv8 system boots, it can either have DT information, ACPI tables,
+or in some very unusual cases, both. If no command line parameters are used,
+the kernel will try to use DT for device enumeration; if there is no DT
+present, the kernel will try to use ACPI tables, but only if they are present.
+In neither is available, the kernel will not boot. If acpi=force is used
+on the command line, the kernel will attempt to use ACPI tables first, but
+fall back to DT if there are no ACPI tables present. The basic idea is that
+the kernel will not fail to boot unless it absolutely has no other choice.
Processing of ACPI tables may be disabled by passing acpi=off on the kernel
-command line; this is the default behavior if both ACPI and DT tables are
-present. If acpi=force is used, the kernel will ONLY use device configuration
-information contained in the ACPI tables if those tables are available.
+command line; this is the default behavior.
In order for the kernel to load and use ACPI tables, the UEFI implementation
MUST set the ACPI_20_TABLE_GUID to point to the RSDP table (the table with
the ACPI signature "RSD PTR "). If this pointer is incorrect and acpi=force
-is used, the kernel will disable ACPI and try to use DT to boot instead.
+is used, the kernel will disable ACPI and try to use DT to boot instead; the
+kernel has, in effect, determined that ACPI tables are not present at that
+point.
If the pointer to the RSDP table is correct, the table will be mapped into
the kernel by the ACPI core, using the address provided by UEFI.
@@ -65,7 +162,8 @@ be ignored on arm64.
Hardware reduced mode (see Section 4.1 of the ACPI 5.1 specification) will
be enforced by the ACPI core on arm64. Doing so allows the ACPI core to
run less complex code since it no longer has to provide support for legacy
-hardware from other architectures.
+hardware from other architectures. Any fields that are not to be used for
+hardware reduced mode must be set to zero.
For the ACPI core to operate properly, and in turn provide the information
the kernel needs to configure devices, it expects to find the following
@@ -123,27 +221,9 @@ invoke the method and not concern itself with what the method needs to do
to change the clock. Changing the hardware can then take place over time
by changing what the ACPI method does, and not the driver.
-ACPI drivers should only look at one specific ASL object -- the _DSD object
--- for device driver parameters (known in DT as "bindings", or "Device
-Properties" in ACPI). DT bindings also will be reviewed before used. The UEFI
-Forum provides a mechanism for registering such bindings [URL TBD by ASWG]
-so that they may be used on any operating system supporting ACPI. Device
-properties that have not been registered with the UEFI Forum should not be
-used.
-
-Drivers should look for device properties in the _DSD object ONLY; the _DSD
-object is described in the ACPI specification section 6.2.5, but more
-specifically, use the _DSD Device Properties UUID:
-
- -- UUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301
-
- -- http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UU…
-
-The kernel has an interface for looking up device properties in a manner
-independent of whether DT or ACPI is being used and that interface should
-be used; it can eliminate some duplication of code paths in driver probing
-functions and discourage divergence between DT bindings and ACPI device
-properties.
+In DT, the parameters needed by the driver to set up clocks as in the example
+above are known as "bindings"; in ACPI, these are known as "Device Properties"
+and provided to a driver via the _DSD object.
ACPI tables are described with a formal language called ASL, the ACPI
Source Language (section 19 of the specification). This means that there
@@ -166,19 +246,53 @@ be used if _DSD cannot represent the data required, and there is no way
to create a new UUID for the _DSD object. Note that there is even less
regulation of the use of _DSM than there is of _DSD. Drivers that depend
on the contents of _DSM objects will be more difficult to maintain over
-time because of this.
+time because of this; as of this writing, the use of _DSM is the cause
+of quite a few firmware problems and is not recommended.
-The _DSD object is a very flexible mechanism in ACPI, as are the registered
-Device Properties. This flexibility allows _DSD to cover more than just the
-generic server case and care should be taken in device drivers not to expect
-it to replicate highly specific embedded behaviour from DT.
+Drivers should look for device properties in the _DSD object ONLY; the _DSD
+object is described in the ACPI specification section 6.2.5, but this only
+describes how to define the structure of an object returned via _DSD, and
+how specific data structures are defined by specific UUIDs. Linux should
+only use the _DSD Device Properties UUID [5]:
-Both DT bindings and ACPI device properties for device drivers have review
-processes. Use them. And, before creating new device properties, check to
-be sure that they have not been defined before and either registered in the
-Linux kernel documentation or the UEFI Forum. If the device drivers supports
-ACPI and DT, please make sure the device properties are consistent in both
-places.
+ -- UUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301
+
+ -- http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UU…
+
+The UEFI Forum provides a mechanism for registering device properties [4]
+so that they may be used across all operating systems supporting ACPI.
+Device properties that have not been registered with the UEFI Forum should
+not be used.
+
+Before creating new device properties, check to be sure that they have not
+been defined before and either registered in the Linux kernel documentation
+as DT bindings, or the UEFI Forum as device properties. While we do not want
+to simply move all DT bindings into ACPI device properties, we can learn from
+what has been previously defined.
+
+If it is necessary to define a new device property, or if it makes sense to
+synthesize the definition of a binding so it can be used in any firmware,
+both DT bindings and ACPI device properties for device drivers have review
+processes. Use them both. When the driver itself is submitted for review
+to the Linux mailing lists, the device property definitions needed must be
+submitted at the same time. A driver that supports ACPI and uses device
+properties will not be considered complete without their definitions. Once
+the device property has been accepted by the Linux community, it must be
+registered with the UEFI Forum [4], which will review it again for consistency
+within the registry. This may require iteration. The UEFI Forum, though,
+will always be the canonical site for device property definitions.
+
+It may make sense to provide notice to the UEFI Forum that there is the
+intent to register a previously unused device property name as a means of
+reserving the name for later use. Other operating system vendors will
+also be submitting registration requests and this may help smooth the
+process.
+
+Once registration and review have been completed, the kernel provides an
+interface for looking up device properties in a manner independent of
+whether DT or ACPI is being used. This API should be used [6]; it can
+eliminate some duplication of code paths in driver probing functions and
+discourage divergence between DT bindings and ACPI device properties.
Programmable Power Control Resources
@@ -186,6 +300,9 @@ Programmable Power Control Resources
Programmable power control resources include such resources as voltage/current
providers (regulators) and clock sources.
+With ACPI, the kernel clock and regulator framework is not expected to be used
+at all.
+
The kernel assumes that power control of these resources is represented with
Power Resource Objects (ACPI section 7.1). The ACPI core will then handle
correctly enabling and disabling resources as they are needed. In order to
@@ -194,8 +311,10 @@ can be controlled through the optional ACPI methods _PS0, _PS1, _PS2, and _PS3;
in ACPI, _PS0 is the method to invoke to turn a device full on, and _PS3 is for
turning a device full off.
-There are two options for using those Power Resources.
- -- be managed in _PSx routine which gets called on entry to Dx.
+There are two options for using those Power Resources. They can:
+
+ -- be managed in a _PSx method which gets called on entry to power
+ state Dx.
-- be declared separately as power resources with their own _ON and _OFF
methods. They are then tied back to D-states for a particular device
@@ -232,14 +351,22 @@ UEFI, in this case -- to some working value before control is handed over
to the kernel. This has implications for devices such as UARTs, or SoC-driven
LCD displays, for example.
-When the kernel boots, the clock is assumed to be set to a reasonable
-working value. If for some reason the frequency needs to change -- e.g.,
+When the kernel boots, the clocks are assumed to be set to reasonable
+working values. If for some reason the frequency needs to change -- e.g.,
throttling for power management -- the device driver should expect that
process to be abstracted out into some ACPI method that can be invoked
(please see the ACPI specification for further recommendations on standard
-methods to be expected) except CPU clocks where CPPC provides a much richer
-interface instead of some method. If it is not, there is no direct way for
-ACPI to control the clocks.
+methods to be expected). The only exceptions to this are CPU clocks where
+CPPC provides a much richer interface than ACPI methods. If the clocks
+are not set, there is no direct way for Linux to control them.
+
+If an SoC vendor wants to provide fine-grained control of the system clocks,
+they could do so by providing ACPI methods that could be invoked by Linux
+drivers. However, this is NOT recommended and Linux drivers should NOT use
+such methods, even if they are provided. Such methods are not currently
+standardized in the ACPI specification, and using them could tie a kernel
+to a very specific SoC, or tie an SoC to a very specific version of the
+kernel, both of which we are trying to avoid.
Driver Recommendations
@@ -303,14 +430,11 @@ MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match);
ASWG
----
-The following areas are not yet fully defined for ARM in the 5.1 version
-of the ACPI specification and are expected to be worked through in the
-UEFI ACPI Specification Working Group (ASWG):
-
- -- ACPI based CPU topology
- -- ACPI based CPU idle control
- -- ACPI based SMMU and its IO topology
- -- ITS support for GIC in MADT
+The ACPI specification changes regularly. During the year 2014, for instance,
+version 5.1 was released and version 6.0 substantially completed, with most of
+the changes being driven by ARM-specific requirements. Proposed changes are
+presented and discussed in the ASWG (ACPI Specification Working Group) which
+is a part of the UEFI Forum.
Participation in this group is open to all UEFI members. Please see
http://www.uefi.org/workinggroup for details on group membership.
@@ -325,3 +449,58 @@ it from being used on a platform, ECRs (Engineering Change Requests) should be
submitted to ASWG and go through the normal approval process; for those that
are not UEFI members, many other members of the Linux community are and would
likely be willing to assist in submitting ECRs.
+
+
+Linux Code
+----------
+Individual items specific to Linux on ARM, contained in the the Linux
+source code, are in the list that follows:
+
+ACPI_OS_NAME This macro defines the string to be returned when
+ an ACPI method invokes the _OS method. On ARM64
+ systems, this macro will be "Linux" by default.
+ The command line parameter acpi_os=<string>
+ can be used to set it to some other value. The
+ default value for other architectures is "Microsoft
+ Windows NT", for example.
+
+ACPI Objects
+------------
+Detailed expectations for ACPI tables and object are listed in the file
+Documentation/arm64/acpi_object_usage.txt.
+
+
+References
+----------
+[0] http://silver.arm.com -- document ARM-DEN-0029, or newer
+ "Server Base System Architecture", version 2.3, dated 27 Mar 2014
+
+[1] http://infocenter.arm.com/help/topic/com.arm.doc.den0044a/Server_Base_Boot_…
+ Document ARM-DEN-0044A, or newer: "Server Base Boot Requirements, System
+ Software on ARM Platforms", dated 16 Aug 2014
+
+[2] http://www.secretlab.ca/archives/151, 10 Jan 2015, Copyright (c) 2015,
+ Linaro Ltd., written by Grant Likely. A copy of the verbatim text (apart
+ from formatting) is also in Documentation/arm64/why_use_acpi.txt.
+
+[3] AMD ACPI for Seattle platform documentation:
+ http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/Seattle_ACPI…
+
+[4] http://www.uefi.org/acpi -- please see the link for the "ACPI _DSD Device
+ Property Registry Instructions"
+
+[5] http://www.uefi.org/acpi -- please see the link for the "_DSD (Device
+ Specific Data) Implementation Guide"
+
+[6] Kernel code for the unified device property interface can be found in
+ include/linux/property.h and drivers/base/property.c.
+
+
+Authors
+-------
+Al Stone <al.stone(a)linaro.org>
+Graeme Gregory <graeme.gregory(a)linaro.org>
+Hanjun Guo <hanjun.guo(a)linaro.org>
+
+Grant Likely <grant.likely(a)linaro.org>, for the "Why ACPI on ARM?" section
+
diff --git a/Documentation/arm64/why_use_acpi.txt b/Documentation/arm64/why_use_acpi.txt
new file mode 100644
index 0000000..9bb583e
--- /dev/null
+++ b/Documentation/arm64/why_use_acpi.txt
@@ -0,0 +1,231 @@
+Why ACPI on ARM?
+----------------
+Copyright (c) 2015, Linaro, Ltd.
+Author: Grant Likely <grant.likely(a)linaro.org>
+
+Why are we doing ACPI on ARM? That question has been asked many times, but
+we haven’t yet had a good summary of the most important reasons for wanting
+ACPI on ARM. This article is an attempt to state the rationale clearly.
+
+During an email conversation late last year, Catalin Marinas asked for
+a summary of exactly why we want ACPI on ARM, Dong Wei replied with the
+following list:
+> 1. Support multiple OSes, including Linux and Windows
+> 2. Support device configurations
+> 3. Support dynamic device configurations (hot add/removal)
+> 4. Support hardware abstraction through control methods
+> 5. Support power management
+> 6. Support thermal management
+> 7. Support RAS interfaces
+
+The above list is certainly true in that all of them need to be supported.
+However, that list doesn’t give the rationale for choosing ACPI. We already
+have DT mechanisms for doing most of the above, and can certainly create
+new bindings for anything that is missing. So, if it isn’t an issue of
+functionality, then how does ACPI differ from DT and why is ACPI a better
+fit for general purpose ARM servers?
+
+The difference is in the support model. To explain what I mean, I’m first
+going to expand on each of the items above and discuss the similarities and
+differences between ACPI and DT. Then, with that as the groundwork, I’ll
+discuss how ACPI is a better fit for the general purpose hardware support
+model.
+
+
+Device Configurations
+---------------------
+2. Support device configurations
+3. Support dynamic device configurations (hot add/removal)
+
+From day one, DT was about device configurations. There isn’t any significant
+difference between ACPI & DT here. In fact, the majority of ACPI tables are
+completely analogous to DT descriptions. With the exception of the DSDT and
+SSDT tables, most ACPI tables are merely flat data used to describe hardware.
+
+DT platforms have also supported dynamic configuration and hotplug for years.
+There isn’t a lot here that differentiates between ACPI and DT. The biggest
+difference is that dynamic changes to the ACPI namespace can be triggered by
+ACPI methods, whereas for DT changes are received as messages from firmware
+and have been very much platform specific (e.g. IBM pSeries does this)
+
+
+Power Management
+----------------
+4. Support hardware abstraction through control methods
+5. Support power management
+6. Support thermal management
+
+Power, thermal, and clock management can all be dealt with as a group. ACPI
+defines a power management model (OSPM) that both the platform and the OS
+conform to. The OS implements the OSPM state machine, but the platform can
+provide state change behaviour in the form of bytecode methods. Methods can
+access hardware directly or hand off PM operations to a coprocessor. The OS
+really doesn’t have to care about the details as long as the platform obeys
+the rules of the OSPM model.
+
+With DT, the kernel has device drivers for each and every component in the
+platform, and configures them using DT data. DT itself doesn’t have a PM model.
+Rather the PM model is an implementation detail of the kernel. Device drivers
+use DT data to decide how to handle PM state changes. We have clock, pinctrl,
+and regulator frameworks in the kernel for working out runtime PM. However,
+this only works when all the drivers and support code have been merged into
+the kernel. When the kernel’s PM model doesn’t work for new hardware, then we
+change the model. This works very well for mobile/embedded because the vendor
+controls the kernel. We can change things when we need to, but we also struggle
+with getting board support mainlined.
+
+This difference has a big impact when it comes to OS support. Engineers from
+hardware vendors, Microsoft, and most vocally Red Hat have all told me bluntly
+that rebuilding the kernel doesn’t work for enterprise OS support. Their model
+is based around a fixed OS release that ideally boots out-of-the-box. It may
+still need additional device drivers for specific peripherals/features, but
+from a system view, the OS works. When additional drivers are provided
+separately, those drivers fit within the existing OSPM model for power
+management. This is where ACPI has a technical advantage over DT. The ACPI
+OSPM model and it’s bytecode gives the HW vendors a level of abstraction
+under their control, not the kernel’s. When the hardware behaves differently
+from what the OS expects, the vendor is able to change the behaviour without
+changing the HW or patching the OS.
+
+At this point you’d be right to point out that it is harder to get the whole
+system working correctly when behaviour is split between the kernel and the
+platform. The OS must trust that the platform doesn’t violate the OSPM model.
+All manner of bad things happen if it does. That is exactly why the DT model
+doesn’t encode behaviour: It is easier to make changes and fix bugs when
+everything is within the same code base. We don’t need a platform/kernel
+split when we can modify the kernel.
+
+However, the enterprise folks don’t have that luxury. The platform/kernel
+split isn’t a design choice. It is a characteristic of the market. Hardware
+and OS vendors each have their own product timetables, and they don’t line
+up. The timeline for getting patches into the kernel and flowing through into
+OS releases puts OS support far downstream from the actual release of hardware.
+Hardware vendors simply cannot wait for OS support to come online to be able to
+release their products. They need to be able to work with available releases,
+and make their hardware behave in the way the OS expects. The advantage of ACPI
+OSPM is that it defines behaviour and limits what the hardware is allowed to do
+without involving the kernel.
+
+What remains is sorting out how we make sure everything works. How do we make
+sure there is enough cross platform testing to ensure new hardware doesn’t
+ship broken and that new OS releases don’t break on old hardware? Those are
+the reasons why a UEFI/ACPI firmware summit is being organized, it’s why the
+UEFI forum holds plugfests 3 times a year, and it is why we’re working on
+FWTS and LuvOS.
+
+
+Reliability, Availability & Serviceability (RAS)
+------------------------------------------------
+7. Support RAS interfaces
+
+This isn’t a question of whether or not DT can support RAS. Of course it can.
+Rather it is a matter of RAS bindings already existing for ACPI, including a
+usage model. We’ve barely begun to explore this on DT. This item doesn’t make
+ACPI technically superior to DT, but it certainly makes it more mature.
+
+
+Multiplatform Support
+---------------------
+1. Support multiple OSes, including Linux and Windows
+
+I’m tackling this item last because I think it is the most contentious for
+those of us in the Linux world. I wanted to get the other issues out of the
+way before addressing it.
+
+The separation between hardware vendors and OS vendors in the server market
+is new for ARM. For the first time ARM hardware and OS release cycles are
+completely decoupled from each other, and neither are expected to have specific
+knowledge of the other (ie. the hardware vendor doesn’t control the choice of
+OS). ARM and their partners want to create an ecosystem of independent OSes
+and hardware platforms that don’t explicitly require the former to be ported
+to the latter.
+
+Now, one could argue that Linux is driving the potential market for ARM
+servers, and therefore Linux is the only thing that matters, but hardware
+vendors don’t see it that way. For hardware vendors it is in their best
+interest to support as wide a choice of OSes as possible in order to catch
+the widest potential customer base. Even if the majority choose Linux, some
+will choose BSD, some will choose Windows, and some will choose something
+else. Whether or not we think this is foolish is beside the point; it isn’t
+something we have influence over.
+
+During early ARM server planning meetings between ARM, its partners and other
+industry representatives (myself included) we discussed this exact point.
+Before us were two options, DT and ACPI. As one of the Linux people in the
+room, I advised that ACPI’s closed governance model was a show stopper for
+Linux and that DT is the working interface. Microsoft on the other hand made
+it abundantly clear that ACPI was the only interface that they would support.
+For their part, the hardware vendors stated the platform abstraction behaviour
+of ACPI is a hard requirement for their support model and that they would not
+close the door on either Linux or Windows.
+
+However, the one thing that all of us could agree on was that supporting
+multiple interfaces doesn’t help anyone: It would require twice as much
+effort on defining bindings (once for Linux-DT and once for Windows-ACPI)
+and it would require firmware to describe everything twice. Eventually we
+reached the compromise to use ACPI, but on the condition of opening the
+governance process to give Linux engineers equal influence over the
+specification. The fact that we now have a much better seat at the ACPI
+table, for both ARM and x86, is a direct result of these early ARM server
+negotiations. We are no longer second class citizens in the ACPI world and
+are actually driving much of the recent development.
+
+I know that this line of thought is more about market forces rather than a
+hard technical argument between ACPI and DT, but it is an equally significant
+one. Agreeing on a single way of doing things is important. The ARM server
+ecosystem is better for the agreement to use the same interface for all
+operating systems. This is what is meant by standards compliant. The standard
+is a codification of the mutually agreed interface. It provides confidence
+that all vendors are using the same rules for interoperability.
+
+
+Summary
+-------
+To summarize, here is the short form rationale for ACPI on ARM:
+
+-- ACPI’s bytecode allows the platform to encode behaviour. DT explicitly
+ does not support this. For hardware vendors, being able to encode behaviour
+ is an important tool for supporting operating system releases on new
+ hardware.
+
+-- ACPI’s OSPM defines a power management model that constrains what the
+ platform is allowed into a specific model while still having flexibility
+ in hardware design.
+
+-- For enterprise use-cases, ACPI has extablished bindings, such as for RAS,
+ which are used in production. DT does not. Yes, we can define those bindings
+ but doing so means ARM and x86 will use completely different code paths in
+ both firmware and the kernel.
+
+-- Choosing a single interface for platform/OS abstraction is important. It
+ is not reasonable to require vendors to implement both DT and ACPI if they
+ want to support multiple operating systems. Agreeing on a single interface
+ instead of being fragmented into per-OS interfaces makes for better
+ interoperability overall.
+
+-- The ACPI governance process works well and we’re at the same table as HW
+ vendors and other OS vendors. In fact, there is no longer any reason to
+ feel that ACPI is a Windows thing or that we are playing second fiddle to
+ Microsoft. The move of ACPI governance into the UEFI forum has significantly
+ opened up the processes, and currently, a large portion of the changes being
+ made to ACPI is being driven by Linux.
+
+At the beginning of this article I made the statement that the difference
+is in the support model. For servers, responsibility for hardware behaviour
+cannot be purely the domain of the kernel, but rather is split between the
+platform and the kernel. ACPI frees the OS from needing to understand all
+the minute details of the hardware so that the OS doesn’t need to be ported
+to each and every device individually. It allows the hardware vendors to take
+responsibility for PM behaviour without depending on an OS release cycle which
+it is not under their control.
+
+ACPI is also important because hardware and OS vendors have already worked
+out how to use it to support the general purpose ecosystem. The infrastructure
+is in place, the bindings are in place, and the process is in place. DT does
+exactly what we need it to when working with vertically integrated devices,
+but we don’t have good processes for supporting what the server vendors need.
+We could potentially get there with DT, but doing so doesn’t buy us anything.
+ACPI already does what the hardware vendors need, Microsoft won’t collaborate
+with us on DT, and the hardware vendors would still need to provide two
+completely separate firmware interface; one for Linux and one for Windows.
+
--
2.1.0
Hi,
I intend to import Andre's SBSA UART patches to leg-kernel in the next
release and remove my hack SBSA UART driver. This will mean your
console will change to be ttyAMA0.
If you are using the FVP model it must have these two arguments.
-C bp.pl011_uart0.untimed_fifos=1
-C bp.pl011_uart0.revision="r1p5"
Thanks
Graeme
From: Al Stone <ahs3(a)redhat.com>
The use of the ACPI _OSI method in Linux has a long and sordid history.
Instead of perpetuating the complications on new architectures, the
consensus appears to be to deprecate the use of _OSI. I will be proposing
such a change to the ACPI specification in the near future.
These patches rearrange the implementation of _OSI so that it can be
deprecated on arm64 platforms. For x86, there should be no change in
functionality. For ia64, there is no longer any connection to the ACPI
blacklist code that is only used by x86. For arm64, any use of the
_OSI method generates a warning that it has been deprecated, and then
always returns false; i.e., that the capability being queried for, whether
OS name or functionality, is not supported. This is the first four of
the patches.
The final patch changes the _OS method for arm64 only. Since there is
no need to pretend to be older versions of Windows, or any other OS, the
_OS method will return "Linux" on arm64.
I have only done simple boot testing with these patches on arm64 and x86
(AMD Seattle and a Lenovo t440s ThinkPad, respectively). Things seem to
work as they should, but this is a very small sample of possible machines.
The ia64 patches compile, but I have no way to test them.
These patches also rely on having already applied Hanjun's patches for
ACPI 5.1 on arm64 [0]. The x86 and ia64 parts are not dependent on that
patch set, though, and could be used independently.
[0] https://lkml.org/lkml/2015/1/14/586
Al Stone (4):
ia64: ACPI: move kernel acpi files to a directory
arm64: ACPI: move kernel acpi files to a directory
ACPI: arm64/x86/ia64: make acpi_osi_handler() arch-dependent
ACPI: x86/ia64/arm64: move _OSI support functions to arch-dependent
locations
Hanjun Guo (1):
ACPI: use Linux as ACPI_OS_NAME for _OS on ARM64
arch/arm64/Kconfig | 1 +
arch/arm64/kernel/Makefile | 2 +-
arch/arm64/kernel/acpi.c | 359 --------------
arch/arm64/kernel/acpi/Makefile | 1 +
arch/arm64/kernel/acpi/acpi.c | 359 ++++++++++++++
arch/arm64/kernel/acpi/osi.c | 26 +
arch/ia64/kernel/Makefile | 2 +-
arch/ia64/kernel/acpi-ext.c | 104 ----
arch/ia64/kernel/acpi.c | 1000 --------------------------------------
arch/ia64/kernel/acpi/Makefile | 1 +
arch/ia64/kernel/acpi/acpi-ext.c | 104 ++++
arch/ia64/kernel/acpi/acpi.c | 1000 ++++++++++++++++++++++++++++++++++++++
arch/ia64/kernel/acpi/osi.c | 119 +++++
arch/x86/kernel/acpi/Makefile | 2 +-
arch/x86/kernel/acpi/blacklist.c | 327 +++++++++++++
arch/x86/kernel/acpi/boot.c | 5 +-
arch/x86/kernel/acpi/osi.c | 255 ++++++++++
drivers/acpi/Kconfig | 8 +
drivers/acpi/Makefile | 1 -
drivers/acpi/blacklist.c | 323 ------------
drivers/acpi/osl.c | 217 ---------
include/acpi/acconfig.h | 2 +
include/acpi/platform/aclinux.h | 4 +
include/linux/acpi.h | 4 +-
24 files changed, 2215 insertions(+), 2011 deletions(-)
delete mode 100644 arch/arm64/kernel/acpi.c
create mode 100644 arch/arm64/kernel/acpi/Makefile
create mode 100644 arch/arm64/kernel/acpi/acpi.c
create mode 100644 arch/arm64/kernel/acpi/osi.c
delete mode 100644 arch/ia64/kernel/acpi-ext.c
delete mode 100644 arch/ia64/kernel/acpi.c
create mode 100644 arch/ia64/kernel/acpi/Makefile
create mode 100644 arch/ia64/kernel/acpi/acpi-ext.c
create mode 100644 arch/ia64/kernel/acpi/acpi.c
create mode 100644 arch/ia64/kernel/acpi/osi.c
create mode 100644 arch/x86/kernel/acpi/blacklist.c
create mode 100644 arch/x86/kernel/acpi/osi.c
delete mode 100644 drivers/acpi/blacklist.c
--
2.1.0
From: Al Stone <ahs3(a)redhat.com>
While Hanjun cleaned up most of the commentary on the arm-acpi.txt file,
this patch goes several steps further. The biggest change to the existing
documentation was to add a section describing why ACPI is wanted, and to
do a lot of editing for continuity, and hopefully clarity.
Two documentation files are also being added:
(1) A verbatim copy of the "Why ACPI on ARM?" blog posting by Grant Likely,
which is also summarized in arm-acpi.txt, and
(2) A section by section review of the ACPI spec (acpi_object_usage.txt)
to note recommendations and prohibitions on the use of the numerous
ACPI tables and objects. This sets out the current expectations of
the firmware by Linux very explicitly (or as explicitly as I can, for
now).
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
Documentation/arm64/acpi_object_usage.txt | 557 ++++++++++++++++++++++++++++++
Documentation/arm64/why_use_acpi.txt | 228 ++++++++++++
2 files changed, 785 insertions(+)
create mode 100644 Documentation/arm64/acpi_object_usage.txt
create mode 100644 Documentation/arm64/why_use_acpi.txt
diff --git a/Documentation/arm64/acpi_object_usage.txt b/Documentation/arm64/acpi_object_usage.txt
new file mode 100644
index 0000000..3fbc25d
--- /dev/null
+++ b/Documentation/arm64/acpi_object_usage.txt
@@ -0,0 +1,557 @@
+ACPI Tables
+-----------
+The expectations of individual ACPI tables are discussed in the list that
+follows.
+
+If a section number is used, it refers to a section number in the ACPI
+specification where the object is defined. If "Signature Reserved" is used,
+the table signature (the first four bytes of the table) is the only portion
+of the table recognized by the specification, and the actual table is defined
+outside of the UEFI Forum (see Section 5.2.6 of the specification).
+
+
+Table Usage for ARMv8 Linux
+----- ----------------------------------------------------------------
+BERT Section 18.3 (signature == "BERT")
+ == Boot Error Record Table ==
+ Must be supplied if RAS support is provided by the platform. It
+ is recommended this table be supplied.
+
+BOOT Signature Reserved (signature == "BOOT")
+ == simple BOOT flag table ==
+ Microsoft only table, will not be supported.
+
+BGRT Section 5.2.22 (signature == "BGRT")
+ == Boot Graphics Resource Table ==
+ Optional, not currently supported, with no real use-case for an
+ ARM server.
+
+CPEP Section 5.2.18 (signature == "CPEP")
+ == Corrected Platform Error Polling table ==
+ Optional, not currently supported, and not recommended until such
+ time as ARM-compatible hardware is available, and the specification
+ suitably modified.
+
+CSRT Signature Reserved (signature == "CSRT")
+ == Core System Resources Table ==
+ Optional, not currently supported.
+
+DBG2 Signature Reserved (signature == "DBG2")
+ == DeBuG port table 2 ==
+ Microsoft only table, will not be supported.
+
+DBGP Signature Reserved (signature == "DBGP")
+ == DeBuG Port table ==
+ Microsoft only table, will not be supported.
+
+DSDT Section 5.2.11.1 (signature == "DSDT")
+ == Differentiated System Description Table ==
+ At least one DSDT is required; more than one can be provided to
+ expand the ACPI namespace.
+
+DMAR Signature Reserved (signature == "DMAR")
+ == DMA Remapping table ==
+ x86 only table, will not be supported.
+
+DRTM Signature Reserved (signature == "DRTM")
+ == Dynamic Root of Trust for Measurement table ==
+ Optional, not currently supported.
+
+ECDT Section 5.2.16 (signature == "ECDT")
+ == Embedded Controller Description Table ==
+ Optional, not currently supported, but could be used on ARM if and
+ only if one uses the GPE_BIT field to represent an IRQ number, since
+ there are no GPE blocks defined in hardware reduced mode. This would
+ need to be modified in the ACPI specification.
+
+EINJ Section 18.6 (signature == "EINJ")
+ == Error Injection table ==
+ This table is very useful for testing platform response to error
+ conditions; it allows one to inject an error into the system as
+ if it had actually occurred. However, this table should not be
+ shipped with a production system; it should be dynamically loaded
+ and executed with the ACPICA tools only during testing.
+
+ERST Section 18.5 (signature == "ERST")
+ == Error Record Serialization Table ==
+ Must be supplied if RAS support is provided by the platform. It
+ is recommended this table be supplied.
+
+ETDT Signature Reserved (signature == "ETDT")
+ == Event Timer Description Table ==
+ Obsolete table, will not be supported.
+
+FACS Section 5.2.10 (signature == "FACS")
+ == Firmware ACPI Control Structure ==
+ It is unlikely that this table will be terribly useful. If it is
+ provided, the Global Lock will NOT be used since it is not part of
+ the hardware reduced profile, and only 64-bit address fields will
+ be considered valid.
+
+FADT Section 5.2.9 (signature == "FACP")
+ == Fixed ACPI Description Table ==
+ Required for arm64.
+
+ The HW_REDUCED_ACPI flag must be set. All of the fields that are
+ to be ignored when HW_REDUCED_ACPI is set are expected to be set to
+ zero.
+
+ If an FACS table is provided, the X_FIRMWARE_CTRL field is to be
+ used, not FIRMWARE_CTRL.
+
+ If a DSDT is provided, the X_DSDT field is to be used, not the DSDT
+ field.
+
+FPDT Section 5.2.23 (signature == "FPDT")
+ == Firmware Performance Data Table ==
+ Optional, not currently supported.
+
+GTDT Section 5.2.24 (signature == "GTDT")
+ == Generic Timer Description Table ==
+ Required for arm64.
+
+HEST Section 18.3.2 (signature == "HEST")
+ == Hardware Error Source Table ==
+ Until further error source types are defined, use only types 6 (AER
+ Root Port), 7 (AER Endpoint), 8 (AER Bridge), or 9 (Generic Hardware
+ Error Source). Firmware first error handling is possible if and only
+ if Trusted Firmware is being used on arm64.
+
+ Must be supplied if RAS support is provided by the platform. It
+ is recommended this table be supplied.
+
+HPET Signature Reserved (signature == "HPET")
+ == High Precision Event timer Table ==
+ x86 only table, will not be supported.
+
+IBFT Signature Reserved (signature == "IBFT")
+ == iSCSI Boot Firmware Table ==
+ Microsoft defined table, support TBD.
+
+IVRS Signature Reserved (signature == "IVRS")
+ == I/O Virtualization Reporting Structure ==
+ x86_64 (AMD) only table, will not be supported.
+
+LPIT Signature Reserved (signature == "LPIT")
+ == Low Power Idle Table ==
+ x86 only table as of ACPI 5.1; future versions adapted for use
+ with ARM are optional, and will be supported.
+
+MADT Section 5.2.12 (signature == "APIC")
+ == Multiple APIC Description Table ==
+ Only the GIC interrupt controller structures should be used (types
+ 0xA - 0xE).
+
+MCFG Signature Reserved (signature == "MCFG")
+ == Memory-mapped ConFiGuration space ==
+ If the platform supports PCI/PCIe, an MCFG table is required.
+
+MCHI Signature Reserved (signature == "MCHI")
+ == Management Controller Host Interface table ==
+ Optional, not currently supported.
+
+MPST Section 5.2.21 (signature == "MPST")
+ == Memory Power State Table ==
+ Optional, not currently supported.
+
+MSDM Signature Reserved (signature == "MSDM")
+ == Microsoft Data Management table ==
+ Microsoft only table, will not be supported.
+
+MSCT Section 5.2.19 (signature == "MSCT")
+ == Maximum System Characteristic Table ==
+ Optional, not currently supported.
+
+RASF Section 5.2.20 (signature == "RASF")
+ == RAS Feature table ==
+ Optional, not currently supported.
+
+RSDP Section 5.2.5 (signature == "RSD PTR")
+ == Root System Description PoinTeR ==
+ Required for arm64.
+
+RSDT Section 5.2.7 (signature == "RSDT")
+ == Root System Description Table ==
+ Deprecated on arm64; can only provide 32-bit addresses.
+
+SBST Section 5.2.14 (signature == "SBST")
+ == Smart Battery Subsystem Table ==
+ Optional, not currently supported.
+
+SLIC Signature Reserved (signature == "SLIC")
+ == Software LIcensing table ==
+ Microsoft only table, will not be supported.
+
+SLIT Section 5.2.17 (signature == "SLIT")
+ == System Locality distance Information Table ==
+ Optional in general, but required for NUMA systems.
+
+SPCR Signature Reserved (signature == "SPCR")
+ == Serial Port Console Redirection table ==
+ Required for arm64.
+
+SPMI Signature Reserved (signature == "SPMI")
+ == Server Platform Management Interface table ==
+ Optional, not currently supported.
+
+SRAT Section 5.2.16 (signature == "SRAT")
+ == System Resource Affinity Table ==
+ Optional, but if used, only the GICC Affinity structures are read.
+
+TCPA Signature Reserved (signature == "TCPA")
+ == Trusted Computing Platform Alliance table ==
+ Optional, not currently supported, and may need changes to fully
+ interoperate with arm64.
+
+TPM2 Signature Reserved (signature == "TPM2")
+ == Trusted Platform Module 2 table ==
+ Optional, not currently supported, and may need changes to fully
+ interoperate with arm64.
+
+UEFI Signature Reserved (signature == "UEFI")
+ == UEFI ACPI data table ==
+ Optional, not currently supported. No known use case for arm64,
+ at present.
+
+WAET Signature Reserved (signature == "WAET")
+ == Windows ACPI Emulated devices Table ==
+ Microsoft only table, will not be supported.
+
+WDAT Signature Reserved (signature == "WDAT")
+ == Watch Dog Action Table ==
+ Microsoft only table, will not be supported.
+
+WDRT Signature Reserved (signature == "WDRT")
+ == Watch Dog Resource Table ==
+ Microsoft only table, will not be supported.
+
+WPBT Signature Reserved (signature == "WPBT")
+ == Windows Platform Binary Table ==
+ Microsoft only table, will not be supported.
+
+XSDT Section 5.2.8 (signature == "XSDT")
+ == eXtended System Description Table ==
+ Required for arm64.
+
+
+ACPI Objects
+------------
+The expectations on individual ACPI objects are discussed in the list that
+follows:
+
+Name Section Usage for ARMv8 Linux
+---- ------------ -------------------------------------------------
+_ADR 6.1.1 Use as needed.
+
+_BBN 6.5.5 Use as needed; PCI-specific.
+
+_BDN 6.5.3 Optional; not likely to be used on arm64.
+
+_CCA 6.2.17 This method should be defined for all bus masters
+ on arm64. While cache coherency is assumed, making
+ it explicit ensures the kernel will set up DMA as
+ it should.
+
+_CDM 6.2.1 Optional, to be used only for processor devices.
+
+_CID 6.1.2 Use as needed.
+
+_CLS 6.1.3 Use as needed.
+
+_CRS 6.2.2 Required on arm64.
+
+_DCK 6.5.2 Optional; not likely to be used on arm64.
+
+_DDN 6.1.4 This field can be used for a device name. However,
+ it is meant for DOS device names (e.g., COM1), so be
+ careful of its use across OSes.
+
+_DEP 6.5.8 Use as needed.
+
+_DIS 6.2.3 Optional, for power management use.
+
+_DLM 5.7.5 Optional.
+
+_DMA 6.2.4 Optional.
+
+_DSD 6.2.5 To be used with caution. If this object is used, try
+ to use it within the constraints already defined by the
+ Device Properties UUID. Only in rare circumstances
+ should it be necessary to create a new _DSD UUID.
+
+ In either case, submit the _DSD definition along with
+ any driver patches for discussion, especially when
+ device properties are used. A driver will not be
+ considered complete without a corresponding _DSD
+ description. Once approved by kernel maintainers,
+ the UUID or device properties must then be registered
+ with the UEFI Forum; this may cause some iteration as
+ more than one OS will be registering entries.
+
+_DSM Do not use this method. It is not standardized, the
+ return values are not well documented, and it is
+ currently a frequent source of error.
+
+_DSW 7.2.1 Use as needed; power management specific.
+
+_EDL 6.3.1 Optional.
+
+_EJD 6.3.2 Optional.
+
+_EJx 6.3.3 Optional.
+
+_FIX 6.2.7 x86 specific, not used on arm64.
+
+\_GL 5.7.1 This object is not to be used in hardware reduced
+ mode, and therefore should not be used on arm64.
+
+_GLK 6.5.7 This object requires a global lock be defined; there
+ is no global lock on arm64 since it runs in hardware
+ reduced mode. Hence, do not use this object on arm64.
+
+\_GPE 5.3.1 This namespace is for x86 use only. Do not use it
+ on arm64.
+
+_GSB 6.2.7 Optional.
+
+_HID 6.1.5 Use as needed. This is the primary object to use in
+ device probing, though _CID and _CLS may also be used.
+
+_HPP 6.2.8 Optional, PCI specific.
+
+_HPX 6.2.9 Optional, PCI specific.
+
+_HRV 6.1.6 Optional, use as needed to clarify device behavior; in
+ some cases, this may be easier to use than _DSD.
+
+_INI 6.5.1 Not required, but can be useful in setting up devices
+ when UEFI leaves them in a state that may not be what
+ the driver expects before it starts probing.
+
+_IRC 7.2.15 Use as needed; power management specific.
+
+_LCK 6.3.4 Optional.
+
+_MAT 6.2.10 Optional; see also the MADT.
+
+_MLS 6.1.7 Optional, but highly recommended for use in
+ internationalization.
+
+_OFF 7.1.2 It is recommended to define this method for any device
+ that can be turned on or off.
+
+_ON 7.1.3 It is recommended to define this method for any device
+ that can be turned on or off.
+
+\_OS 5.7.3 This method will return "Linux" by default (this is
+ the value of the macro ACPI_OS_NAME on Linux). The
+ command line parameter acpi_os=<string> can be used
+ to set it to some other value.
+
+_OSC 6.2.11 This method can be a global method in ACPI (i.e.,
+ \_SB._OSC), or it may be associated with a specific
+ device (e.g., \_SB.DEV0._OSC), or both. When used
+ as a global method, only capabilities published in
+ the ACPI specification are allowed. When used as
+ a device-specifc method, the process described for
+ using _DSD MUST be used to create an _OSC definition;
+ out-of-process use of _OSC is not allowed. That is,
+ submit the device-specific _OSC usage description as
+ part of the kernel driver submission, get it approved
+ by the kernel community, then register it with the
+ UEFI Forum.
+
+\_OSI 5.7.2 Deprecated on ARM64. Any invocation of this method
+ will print a warning on the console and return false.
+ That is, as far as ACPI firmware is concerned, _OSI
+ cannot be used to determine what sort of system is
+ being used or what functionality is provided. The
+ _OSC method is to be used instead.
+
+_OST 6.3.5 Optional.
+
+_PDC 8.4.1 Deprecated, do not use on arm64.
+
+\_PIC 5.8.1 The method should not be used. On arm64, the only
+ interrupt model available is GIC.
+
+_PLD 6.1.8 Optional.
+
+\_PR 5.3.1 This namespace is for x86 use only on legacy systems.
+ Do not use it on arm64.
+
+_PRS 6.2.12 Optional.
+
+_PRT 6.2.13 Required as part of the definition of all PCI root
+ devices.
+
+_PRW 7.2.13 Use as needed; power management specific.
+
+_PRx 7.2.8-11 Use as needed; power management specific. If _PR0 is
+ defined, _PR3 must also be defined.
+
+_PSC 7.2.6 Use as needed; power management specific.
+
+_PSE 7.2.7 Use as needed; power management specific.
+
+_PSW 7.2.14 Use as needed; power management specific.
+
+_PSx 7.2.2-5 Use as needed; power management specific. If _PS0 is
+ defined, _PS3 must also be defined. If clocks or
+ regulators need adjusting to be consistent with power
+ usage, change them in these methods.
+
+\_PTS 7.3.1 Use as needed; power management specific.
+
+_PXM 6.2.14 Optional.
+
+_REG 6.5.4 Use as needed.
+
+\_REV 5.7.4 Always returns the latest version of ACPI supported.
+
+_RMV 6.3.6 Optional.
+
+\_SB 5.3.1 Required on arm64; all devices must be defined in this
+ namespace.
+
+_SEG 6.5.6 Use as needed; PCI-specific.
+
+\_SI 5.3.1, Optional.
+ 9.1
+
+_SLI 6.2.15 Optional; recommended when SLIT table is in use.
+
+_STA 6.3.7, It is recommended to define this method for any device
+ 7.1.4 that can be turned on or off.
+
+_SRS 6.2.16 Optional; see also _PRS.
+
+_STR 6.1.10 Recommended for conveying device names to end users;
+ this is preferred over using _DDN.
+
+_SUB 6.1.9 Use as needed; _HID or _CID are preferred.
+
+_SUN 6.1.11 Optional.
+
+\_Sx 7.3.2 Use as needed; power management specific.
+
+_SxD 7.2.16-19 Use as needed; power management specific.
+
+_SxW 7.2.20-24 Use as needed; power management specific.
+
+_SWS 7.3.3 Use as needed; power management specific; this may
+ require specification changes for use on arm64.
+
+\_TTS 7.3.4 Use as needed; power management specific.
+
+\_TZ 5.3.1 Optional.
+
+_UID 6.1.12 Recommended for distinguishing devices of the same
+ class; define it if at all possible.
+
+\_WAK 7.3.5 Use as needed; power management specific.
+
+
+ACPI Event Model
+----------------
+Do not use GPE block devices; these are not supported in the hardware reduced
+profile used by arm64. Since there are no GPE blocks defined for use on ARM
+platforms, SCI or NMI like interrupts are used, along with GPIO-signaled
+interrupts for creating system events.
+
+
+ACPI Processor Control
+----------------------
+Section 8 of the ACPI specification is currently undergoing change that
+should be completed in the 6.0 version of the specification. Processor
+performance control will be handled differently for arm64 at that point
+in time. Processor aggregator devices (section 8.5) will not be used,
+for example, but another similar mechanism instead.
+
+While UEFI constrains what we can say until the release of 6.0, it is
+recommended that CPPC (8.4.5) be used as the primary model. This will
+still be useful into the future. C-states and P-states will still be
+provided, but most of the current design work appears to favor CPPC.
+
+Further, it is essential that the ARMv8 SoC provide a fully functional
+implementation of PSCI; this will be the only mechanism supported by ACPI
+to control CPU power state (including secondary CPU booting).
+
+More details will be provided on the release of the ACPI 6.0 specification.
+
+
+ACPI System Address Map Interfaces
+----------------------------------
+In Section 15 of the ACPI specification, several methods are mentioned as
+possible mechanisms for conveying memory resource information to the kernel.
+For arm64, we will only support UEFI for booting with ACPI, hence the UEFI
+GetMemoryMap() boot service is the only mechanism that will be used.
+
+
+ACPI Platform Error Interfaces (APEI)
+-------------------------------------
+The APEI tables supported are described above.
+
+APEI requires the equivalent of an SCI and an NMI on ARMv8. The SCI is used
+to notify the OSPM of errors that have occurred but can be corrected and the
+system can continue correct operation, even if possibly degraded. The NMI is
+used to indicate fatal errors that cannot be corrected, and require immediate
+attention.
+
+Since there is no direct equivalent of the x86 SCI or NMI, arm64 handles
+these slightly differently. The SCI is handled as a normal GPIO-signaled
+interrupt; given that these are corrected (or correctable) errors being
+reported, this is sufficient. The NMI is emulated as the highest priority
+GPIO-signaled interrupt possible. This implies some caution must be used
+since there could be interrupts at higher privilege levels or even interrupts
+at the same priority as the emulated NMI. In Linux, this should not be the
+case but one should be aware it could happen.
+
+
+ACPI Objects Not Supported on ARM64
+-----------------------------------
+While this may change in the future, there are several classes of objects
+that can be defined, but are not currently of general interest to ARM servers.
+
+These are not supported:
+
+ -- Section 9.2: ambient light sensor devices
+
+ -- Section 9.3: battery devices
+
+ -- Section 9.4: lids (e.g., laptop lids)
+
+ -- Section 9.8.2: IDE controllers
+
+ -- Section 9.9: floppy controllers
+
+ -- Section 9.10: GPE block devices
+
+ -- Section 9.15: PC/AT RTC/CMOS devices
+
+ -- Section 9.16: user presence detection devices
+
+ -- Section 9.17: I/O APIC devices; all GICs must be enumerable via MADT
+
+ -- Section 9.18: time and alarm devices (see 9.15)
+
+
+ACPI Objects Not Yet Implemented
+--------------------------------
+While these objects have x86 equivalents, and they do make some sense in ARM
+servers, there is either no hardware available at present, or in some cases
+there may not yet be a non-ARM implementation. Hence, they are currently not
+implemented though that may change in the future.
+
+Not yet implemented are:
+
+ -- Section 10: power source and power meter devices
+
+ -- Section 11: thermal management
+
+ -- Section 12: embedded controllers interface
+
+ -- Section 13: SMBus interfaces
+
+ -- Section 17: NUMA support
+
diff --git a/Documentation/arm64/why_use_acpi.txt b/Documentation/arm64/why_use_acpi.txt
new file mode 100644
index 0000000..480a9ad
--- /dev/null
+++ b/Documentation/arm64/why_use_acpi.txt
@@ -0,0 +1,228 @@
+Why ACPI on ARM? [2]
+--------------------
+Why are we doing ACPI on ARM? That question has been asked many times, but
+we haven’t yet had a good summary of the most important reasons for wanting
+ACPI on ARM. This article is an attempt to state the rationale clearly.
+
+During an email conversation late last year, Catalin Marinas asked for
+a summary of exactly why we want ACPI on ARM, Dong Wei replied with the
+following list:
+> 1. Support multiple OSes, including Linux and Windows
+> 2. Support device configurations
+> 3. Support dynamic device configurations (hot add/removal)
+> 4. Support hardware abstraction through control methods
+> 5. Support power management
+> 6. Support thermal management
+> 7. Support RAS interfaces
+
+The above list is certainly true in that all of them need to be supported.
+However, that list doesn’t give the rationale for choosing ACPI. We already
+have DT mechanisms for doing most of the above, and can certainly create
+new bindings for anything that is missing. So, if it isn’t an issue of
+functionality, then how does ACPI differ from DT and why is ACPI a better
+fit for general purpose ARM servers?
+
+The difference is in the support model. To explain what I mean, I’m first
+going to expand on each of the items above and discuss the similarities and
+differences between ACPI and DT. Then, with that as the groundwork, I’ll
+discuss how ACPI is a better fit for the general purpose hardware support
+model.
+
+
+Device Configurations
+---------------------
+2. Support device configurations
+3. Support dynamic device configurations (hot add/removal)
+
+From day one, DT was about device configurations. There isn’t any significant
+difference between ACPI & DT here. In fact, the majority of ACPI tables are
+completely analogous to DT descriptions. With the exception of the DSDT and
+SSDT tables, most ACPI tables are merely flat data used to describe hardware.
+
+DT platforms have also supported dynamic configuration and hotplug for years.
+There isn’t a lot here that differentiates between ACPI and DT. The biggest
+difference is that dynamic changes to the ACPI namespace can be triggered by
+ACPI methods, whereas for DT changes are received as messages from firmware
+and have been very much platform specific (e.g. IBM pSeries does this)
+
+
+Power Management
+----------------
+4. Support hardware abstraction through control methods
+5. Support power management
+6. Support thermal management
+
+Power, thermal, and clock management can all be dealt with as a group. ACPI
+defines a power management model (OSPM) that both the platform and the OS
+conform to. The OS implements the OSPM state machine, but the platform can
+provide state change behaviour in the form of bytecode methods. Methods can
+access hardware directly or hand off PM operations to a coprocessor. The OS
+really doesn’t have to care about the details as long as the platform obeys
+the rules of the OSPM model.
+
+With DT, the kernel has device drivers for each and every component in the
+platform, and configures them using DT data. DT itself doesn’t have a PM model.
+Rather the PM model is an implementation detail of the kernel. Device drivers
+use DT data to decide how to handle PM state changes. We have clock, pinctrl,
+and regulator frameworks in the kernel for working out runtime PM. However,
+this only works when all the drivers and support code have been merged into
+the kernel. When the kernel’s PM model doesn’t work for new hardware, then we
+change the model. This works very well for mobile/embedded because the vendor
+controls the kernel. We can change things when we need to, but we also struggle
+with getting board support mainlined.
+
+This difference has a big impact when it comes to OS support. Engineers from
+hardware vendors, Microsoft, and most vocally Red Hat have all told me bluntly
+that rebuilding the kernel doesn’t work for enterprise OS support. Their model
+is based around a fixed OS release that ideally boots out-of-the-box. It may
+still need additional device drivers for specific peripherals/features, but
+from a system view, the OS works. When additional drivers are provided
+separately, those drivers fit within the existing OSPM model for power
+management. This is where ACPI has a technical advantage over DT. The ACPI
+OSPM model and it’s bytecode gives the HW vendors a level of abstraction
+under their control, not the kernel’s. When the hardware behaves differently
+from what the OS expects, the vendor is able to change the behaviour without
+changing the HW or patching the OS.
+
+At this point you’d be right to point out that it is harder to get the whole
+system working correctly when behaviour is split between the kernel and the
+platform. The OS must trust that the platform doesn’t violate the OSPM model.
+All manner of bad things happen if it does. That is exactly why the DT model
+doesn’t encode behaviour: It is easier to make changes and fix bugs when
+everything is within the same code base. We don’t need a platform/kernel
+split when we can modify the kernel.
+
+However, the enterprise folks don’t have that luxury. The platform/kernel
+split isn’t a design choice. It is a characteristic of the market. Hardware
+and OS vendors each have their own product timetables, and they don’t line
+up. The timeline for getting patches into the kernel and flowing through into
+OS releases puts OS support far downstream from the actual release of hardware.
+Hardware vendors simply cannot wait for OS support to come online to be able to
+release their products. They need to be able to work with available releases,
+and make their hardware behave in the way the OS expects. The advantage of ACPI
+OSPM is that it defines behaviour and limits what the hardware is allowed to do
+without involving the kernel.
+
+What remains is sorting out how we make sure everything works. How do we make
+sure there is enough cross platform testing to ensure new hardware doesn’t
+ship broken and that new OS releases don’t break on old hardware? Those are
+the reasons why a UEFI/ACPI firmware summit is being organized, it’s why the
+UEFI forum holds plugfests 3 times a year, and it is why we’re working on
+FWTS and LuvOS.
+
+
+Reliability, Availability & Serviceability (RAS)
+------------------------------------------------
+7. Support RAS interfaces
+
+This isn’t a question of whether or not DT can support RAS. Of course it can.
+Rather it is a matter of RAS bindings already existing for ACPI, including a
+usage model. We’ve barely begun to explore this on DT. This item doesn’t make
+ACPI technically superior to DT, but it certainly makes it more mature.
+
+
+Multiplatform Support
+---------------------
+1. Support multiple OSes, including Linux and Windows
+
+I’m tackling this item last because I think it is the most contentious for
+those of us in the Linux world. I wanted to get the other issues out of the
+way before addressing it.
+
+The separation between hardware vendors and OS vendors in the server market
+is new for ARM. For the first time ARM hardware and OS release cycles are
+completely decoupled from each other, and neither are expected to have specific
+knowledge of the other (ie. the hardware vendor doesn’t control the choice of
+OS). ARM and their partners want to create an ecosystem of independent OSes
+and hardware platforms that don’t explicitly require the former to be ported
+to the latter.
+
+Now, one could argue that Linux is driving the potential market for ARM
+servers, and therefore Linux is the only thing that matters, but hardware
+vendors don’t see it that way. For hardware vendors it is in their best
+interest to support as wide a choice of OSes as possible in order to catch
+the widest potential customer base. Even if the majority choose Linux, some
+will choose BSD, some will choose Windows, and some will choose something
+else. Whether or not we think this is foolish is beside the point; it isn’t
+something we have influence over.
+
+During early ARM server planning meetings between ARM, its partners and other
+industry representatives (myself included) we discussed this exact point.
+Before us were two options, DT and ACPI. As one of the Linux people in the
+room, I advised that ACPI’s closed governance model was a show stopper for
+Linux and that DT is the working interface. Microsoft on the other hand made
+it abundantly clear that ACPI was the only interface that they would support.
+For their part, the hardware vendors stated the platform abstraction behaviour
+of ACPI is a hard requirement for their support model and that they would not
+close the door on either Linux or Windows.
+
+However, the one thing that all of us could agree on was that supporting
+multiple interfaces doesn’t help anyone: It would require twice as much
+effort on defining bindings (once for Linux-DT and once for Windows-ACPI)
+and it would require firmware to describe everything twice. Eventually we
+reached the compromise to use ACPI, but on the condition of opening the
+governance process to give Linux engineers equal influence over the
+specification. The fact that we now have a much better seat at the ACPI
+table, for both ARM and x86, is a direct result of these early ARM server
+negotiations. We are no longer second class citizens in the ACPI world and
+are actually driving much of the recent development.
+
+I know that this line of thought is more about market forces rather than a
+hard technical argument between ACPI and DT, but it is an equally significant
+one. Agreeing on a single way of doing things is important. The ARM server
+ecosystem is better for the agreement to use the same interface for all
+operating systems. This is what is meant by standards compliant. The standard
+is a codification of the mutually agreed interface. It provides confidence
+that all vendors are using the same rules for interoperability.
+
+
+Summary
+-------
+To summarize, here is the short form rationale for ACPI on ARM:
+
+-- ACPI’s bytecode allows the platform to encode behaviour. DT explicitly
+ does not support this. For hardware vendors, being able to encode behaviour
+ is an important tool for supporting operating system releases on new
+ hardware.
+
+-- ACPI’s OSPM defines a power management model that constrains what the
+ platform is allowed into a specific model while still having flexibility
+ in hardware design.
+
+-- For enterprise use-cases, ACPI has extablished bindings, such as for RAS,
+ which are used in production. DT does not. Yes, we can define those bindings
+ but doing so means ARM and x86 will use completely different code paths in
+ both firmware and the kernel.
+
+-- Choosing a single interface for platform/OS abstraction is important. It
+ is not reasonable to require vendors to implement both DT and ACPI if they
+ want to support multiple operating systems. Agreeing on a single interface
+ instead of being fragmented into per-OS interfaces makes for better
+ interoperability overall.
+
+-- The ACPI governance process works well and we’re at the same table as HW
+ vendors and other OS vendors. In fact, there is no longer any reason to
+ feel that ACPI is a Windows thing or that we are playing second fiddle to
+ Microsoft. The move of ACPI governance into the UEFI forum has significantly
+ opened up the processes, and currently, a large portion of the changes being
+ made to ACPI is being driven by Linux.
+
+At the beginning of this article I made the statement that the difference
+is in the support model. For servers, responsibility for hardware behaviour
+cannot be purely the domain of the kernel, but rather is split between the
+platform and the kernel. ACPI frees the OS from needing to understand all
+the minute details of the hardware so that the OS doesn’t need to be ported
+to each and every device individually. It allows the hardware vendors to take
+responsibility for PM behaviour without depending on an OS release cycle which
+it is not under their control.
+
+ACPI is also important because hardware and OS vendors have already worked
+out how to use it to support the general purpose ecosystem. The infrastructure
+is in place, the bindings are in place, and the process is in place. DT does
+exactly what we need it to when working with vertically integrated devices,
+but we don’t have good processes for supporting what the server vendors need.
+We could potentially get there with DT, but doing so doesn’t buy us anything.
+ACPI already does what the hardware vendors need, Microsoft won’t collaborate
+with us on DT, and the hardware vendors would still need to provide two
+completely separate firmware interface; one for Linux and one for Windows.
+
--
2.1.0
Hi,
This is the sixth version of ACPI core patches for ARM64 based on ACPI
5.1.
updates from v5:
- fix the NULL pointer reference in cpu_get_ops() if PSCI is absent
and NULL will passed, which found by Suravee when he was testing
those patches on Seattle platform. I added his Tested-by for all
those ACPI patches.
- Rebased on 3.19-rc2 which ACPI table related patches already merged
into 3.19 by Rafael, and remove the first patch in v5 which is not needed
any more.
- Add two cleanup patches to convert ACPI ID to physical ID to make the
ACPI core looks more ARCH agnostic, those two patches were expected going
into 3.19 but conflicted with IOAPIC hotplug patches so Rafael left them
for 3.20.
- updates to the doc about ACPI on ARM to address comments from Catalin,
Timur, Ashwin. continue discussion will bw needed about this doc.
- we did lots of work as Al pointed out in the "[RFC] ACPI on arm64 TODO List"
thread [1], and we already make FWTS running on ARM64, thanks FuWei for doing
that. Here is the test results for linaro leg kernel release test results:
Test report for leg-20141215.0 (Revision: d37eefeb160cc9cc1db997031793723e317be7b7)
This test Image comes from https://ci.linaro.org/job/linux-leg-fuwei
The CI job Link: https://ci.linaro.org/job/linux-leg-fuwei/37/
Notes : All the tests ran on FVP base model in LAVA server : http://validation.linaro.org/
The startup.nsh boot test Link :https://validation.linaro.org/scheduler/job/222779
The ACPI test Link : https://validation.linaro.org/scheduler/job/222781
The results.log file Link : https://validation.linaro.org/dashboard/attachment/1267957/view
The grub-install test Link : https://validation.linaro.org/scheduler/job/222780
and here is the *summary*:
summary -SUM:77 passed, 6 failed, 2 warnings, 5 aborted, 186 skipped, 8 info only.
summary -NLN:
summary -SUM:Test Failure Summary
summary -SEP:===========================================================================================
summary -NLN:
summary -SUM:Critical failures: NONE
summary -NLN:
summary -SUM:High failures: 2
summary -SUM: uefirttime: Failed to get wakeup time with UEFI runtime service.
summary -SUM: uefirttime: Failed to set wakeup time with UEFI runtime service.
summary -NLN:
summary -SUM:Medium failures: 5
summary -SUM: wakealarm: Could not find an RTC with an alarm ioctl() interface.
summary -SUM: method: \_SB_.COM0._CID returned a string 'PL011' but it was not a valid PNP ID or a valid ACPI ID.
summary -SUM: method: Object _PRS did not exist.
summary -SUM: method: Object _PTS did not exist.
summary -SUM: method: Object _WAK did not exist.
summary -NLN:
summary -SUM:Low failures: NONE
summary -NLN:
summary -SUM:Other failures: NONE
summary -NLN:
summary -SUM:Test |Pass |Fail |Abort|Warn |Skip |Info |
summary -SUM:---------------+-----+-----+-----+-----+-----+-----+
summary -SUM:acpidump | | | | | | 1|
summary -SUM:acpiinfo | | | | | | 3|
summary -SUM:acpitables | 11| | | 1| | |
summary -SUM:aspm | | | | | 1| |
summary -SUM:checksum | 8| | | | | |
summary -SUM:cpufreq | | | | 1| | |
summary -SUM:crsdump | | | | | | |
summary -SUM:gpedump | | | | | | |
summary -SUM:hda_audio | | | | | 1| |
summary -SUM:klog | 1| | | | | |
summary -SUM:maxreadreq | | | | | | |
summary -SUM:method | 29| 4| | | 173| |
summary -SUM:oops | 2| | | | | |
summary -SUM:plddump | | | | | | |
summary -SUM:prsdump | | | | | | |
summary -SUM:securebootcert | | | 1| | | |
summary -SUM:syntaxcheck | 1| | | | | |
summary -SUM:uefibootpath | 1| | | | | |
summary -SUM:uefidump | | | | | | |
summary -SUM:uefirtmisc | 2| | | | 10| |
summary -SUM:uefirttime | 2| 2| | | | |
summary -SUM:uefirtvariable | 20| | | | | |
summary -SUM:uefivarinfo | | | | | | |
summary -SUM:version | | | | | 1| 4|
summary -SUM:wakealarm | | | 4| | | |
summary -SUM:---------------+-----+-----+-----+-----+-----+-----+
summary -SUM:Total: | 77| 6| 5| 2| 186| 8|
summary -SUM:---------------+-----+-----+-----+-----+-----+-----+
[1]: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-December/310921.…
Thanks
So. What do you think of this version? I've tried to fill out
some areas, clean up some others -- and it probably needs more.
At one point, I broke this into a bunch of individual files, which
made it easier to edit, but it does not flow very smoothly. Let
me know if a bunch of small files would be preferred.
Hanjun already got most of the edits from the commentary on list;
this version is mostly trying to add more content...
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Linaro Enterprise Group
al.stone(a)linaro.org
-----------------------------------
Hi Hanjun,
> ---------- Forwarded message ----------
> From: Hanjun Guo <hanjun.guo(a)linaro.org>
> Date: 14 January 2015 at 10:05
> Subject: [Linaro-acpi] [PATCH v7 17/17] Documentation: ACPI for ARM64
From: Graeme Gregory <graeme.gregory(a)linaro.org>
> Add documentation for the guidelines of how to use ACPI
> on ARM64.
> Reviewed-by: Suravee Suthikulpanit <Suravee.Suthikulpanit(a)amd.com>
Reviewed-by: Yi Li <phoenix.liyi(a)huawei.com>
> Signed-off-by: Graeme Gregory <graeme.gregory(a)linaro.org>
> Signed-off-by: Al Stone <al.stone(a)linaro.org>
> Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
> ---
> Documentation/arm64/arm-acpi.txt | 327
> +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 327 insertions(+)
> create mode 100644 Documentation/arm64/arm-acpi.txt
Thanks for including previous feedback. This version looks good to us.
Reviewed-by: Ashwin Chaugule <ashwinc(a)codeaurora.org>
Sign-offs on the other patches in this series should follow shortly.
Thanks,
Ashwin
--
Qualcomm Innovation Center, Inc
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
--
ACPI 5.1 has some major changes for ARM platform and the following
tables which are essential for ARM platforms:
1) MADT table updates for GIC v2/v3.
2) FADT updates for PSCI
3) GTDT for arch timer
This patch set is the ARM64 ACPI core patches covered MADT, FADT
and GTDT, platform board specific drivers are not covered by this
patch set.
We first introduce acpi.c and its related head file which are needed
by ACPI core, and then get RSDP to extract all the ACPI boot-time tables.
When all the boot-time tables (FADT, MADT, GTDT) are ready, then
parse them to init the sytem when booted. Specifically,
a) we use FADT to init PSCI and use PSCI to boot SMP;
b) Use MADT for GIC init and SMP init;
c) GTDT for arch timer init.
This patch set is based on 3.17-rc4 and was tested by Graeme on Juno
and FVP base model boot with ACPI only OK, if you want to test them,
you can pull from acpi-5.1-v5 branch in leg/acpi repo:
git://git.linaro.org/leg/acpi/acpi.git
Updates since v4:
- ACPI uasge doc for ARM64 was updated a lot by Al
- Collect some ACKs from Grant, Olof, Mark
- address some comments from Olof and Catalin since last version
Updates since v3:
- Compile out sleep.c on ARM64 when ACPI enabled
- refactor the GIC init code to address the comments from Marc and
Arnd
- refactor the SMP init code to fix some logic problem when PSCI is
not present, also address some of Grant and Lorenzo's comments
- reorder the patch series and move ACPI table changes to the front
of patch set
- rebase on top of 3.17-rc4
Updates since v2:
- Refactor the code to make SMP/PSCI init with less sperated init
path by Tomasz
- make ACPI depend on EXPERT
- Address lots of comments from Catalin, Sudeep, Geoff
- Add Juno device ACPI driver patches for review
Updates since v1:
- Set ACPI default off on ARM64 suggested by Olof;
- Rebase the patch set on top of linux-next branch/linux-pm tree which
includes the ACPICA for full ACPI 5.1 support.
- Update the document as suggested;
- Adress lots of comments from Mark, Sudeep, Randy, Naresh, Olof, Geoff
and more...
Al Stone (3):
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
Ashwin Chaugule (1):
ACPI / table: Add new function to get table entries
Graeme Gregory (4):
ARM64 / ACPI: Introduce sleep-arm.c
ARM64 / ACPI: If we chose to boot from acpi then disable FDT
ARM64 / ACPI: Enable ARM64 in Kconfig
Documentation: ACPI for ARM64
Hanjun Guo (8):
ARM64: Move the init of cpu_logical_map(0) before
unflatten_device_tree()
ARM64 / ACPI: Make PCI optional for ACPI on ARM64
ARM64 / ACPI: Parse FADT table to get PSCI flags for PSCI init
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
ARM64 / ACPI: Parse GTDT to initialize arch timer
Tomasz Nowicki (2):
ACPI / table: Count matched and successfully parsed entries without
specifying max entries
ARM64 / ACPI: Add GICv2 specific ACPI boot support
Documentation/arm64/arm-acpi.txt | 323 ++++++++++++++++++++++++++++++
Documentation/kernel-parameters.txt | 3 +-
arch/arm64/Kconfig | 3 +
arch/arm64/include/asm/acenv.h | 18 ++
arch/arm64/include/asm/acpi.h | 99 ++++++++++
arch/arm64/include/asm/cpu_ops.h | 1 +
arch/arm64/include/asm/pci.h | 11 ++
arch/arm64/include/asm/psci.h | 3 +-
arch/arm64/include/asm/smp.h | 5 +-
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/acpi.c | 356 ++++++++++++++++++++++++++++++++++
arch/arm64/kernel/cpu_ops.c | 4 +-
arch/arm64/kernel/psci.c | 78 +++++---
arch/arm64/kernel/setup.c | 25 ++-
arch/arm64/kernel/smp.c | 2 +-
arch/arm64/kernel/time.c | 7 +
drivers/acpi/Kconfig | 6 +-
drivers/acpi/Makefile | 6 +-
drivers/acpi/bus.c | 3 +
drivers/acpi/internal.h | 5 +
drivers/acpi/processor_core.c | 37 ++++
drivers/acpi/sleep-arm.c | 28 +++
drivers/acpi/tables.c | 115 +++++++++--
drivers/clocksource/arm_arch_timer.c | 117 +++++++++--
drivers/irqchip/irq-gic.c | 106 ++++++++++
drivers/irqchip/irqchip.c | 3 +
include/linux/acpi.h | 5 +
include/linux/clocksource.h | 6 +
include/linux/irqchip/arm-gic-acpi.h | 31 +++
include/linux/pci.h | 37 +++-
30 files changed, 1353 insertions(+), 91 deletions(-)
create mode 100644 Documentation/arm64/arm-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/include/asm/pci.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.7.9.5
Back in September 2014, a meeting was held at Linaro Connect where we
discussed what issues remained before the arm64 ACPI core patches could
be merged into the kernel, creating the TODO list below. I should have
published this list sooner; I got focused on trying to resolve some of
the issues instead.
We have made some progress on all of these items. But, I want to make
sure we haven't missed something. Since this list was compiled by only
the people in the room at Connect, it is probable we have. I, for one,
do not yet claim omniscience.
So, I want to ask the ARM and ACPI communities:
-- Is this list correct?
-- Is this list complete?
Below is what we currently know about; very brief notes on status are
included. The TL;DR versions of the TODO list and the current status
can be found at:
https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/CoreUpstreamNotes
and I'll do my best to kept that up to date.
Thanks. Any and all feedback is greatly appreciated.
TODO List for ACPI on arm64:
============================
1. Define how Aarch64 OS identifies itself to firmware.
* Problem:
* _OSI method is demonstrably unreliable. On x86 Linux claims to
be Windows
* Proposal to use _OSC method as replacement is complicated and
creates an explosion of combinations
* Solution:
* Draft and propose OS identification rules to ABST and ASWG for
inclusion in ACPI spec.
* Draft and propose recommended practice for current ACPI 5.1 spec
platforms.
* Status: Little progress, still under investigation
2. Linux must choose DT booting by default when offered both ACPI and
DT on arm64
* DONE
3. Linux UEFI/ACPI testing tools must be made available
* Problem:
* Hardware/Firmware vendors do not have tools to test Linux
compatibility.
* Common problems go undetected if not tested for.
* Solution:
* Port FWTS tool and LuvOS distribution to AArch64
* Make LuvOS images readily available
* Require hardware vendors to actively test against old and new
kernels.
* Status: LuvOS and FWTS ported to arm64 and running; patches being
mainlined; additional test cases being written.
4. Set clear expectations for those providing ACPI for use with Linux
* Problem:
* Hardware/Firmware vendors can and will create ACPI tables that
cannot be used by Linux without some guidance
* Kernel developers cannot determine whether the kernel or firmware
is broken without knowing what the firmware should do
* Solution: document the expectations, and iterate as needed.
Enforce when we must.
* Status: initial kernel text available; AMD has offered to make
their guidance document generic; firmware summit planned for
deeper discussions.
5. Demonstrate the ACPI core patches work
* Problem: how can we be sure the patches work?
* Solution: verify the patches on arm64 server platforms
* Status:
* ACPI core works on at least the Foundation model, Juno, APM
Mustang, and AMD Seattle
* FWTS results will be published as soon as possible
6. How does the kernel handle_DSD usage?
* Problem:
* _DSD defines key-value properties in the DT style. How do we
ensure _DSD bindings are well defined?
* How do we ensure DT and _DSD bindings remain consistent with
each other?
* Solution: public documentation for all bindings, and a process
for defining them
* Status: proposal to require patch authors to point at public
binding documentation; kernel Documentation/devicetree/bindings
remains the default if no other location exists; UEFI forum has
set up a binding repository.
7. Why is ACPI required?
* Problem:
* arm64 maintainers still haven't been convinced that ACPI is
necessary.
* Why do hardware and OS vendors say ACPI is required?
* Status: Al & Grant collecting statements from OEMs to be posted
publicly early in the new year; firmware summit for broader
discussion planned.
8. Platform support patches need review
* Problem: the core Aarch64 patches have been reviewed and are in
good shape, but there is not yet a good example of server platform
support patches that use them.
* Solution: Post *good* patches for multiple ACPI platforms
* Status: first version for AMD Seattle has been posted to the
public linaro-acpi mailing list for initial review (thanks,
Arnd), refined versions to be posted to broader lists after a
few iterations for basic cleanup
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Linaro Enterprise Group
al.stone(a)linaro.org
-----------------------------------
This patch series introduce ACPI support for non-PCI AHCI platform driver.
Existing ACPI support for AHCI assumes the device controller is a PCI device.
Also, since there is no ACPI _HID/_CID for generic AHCI controller, the driver
could not use them for matching devices. Therefore, this patch introduces a mechanism
for drivers to match devices using ACPI _CLS method.
This patch series is rebased from:
http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v6
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 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/scan.c | 63 +++++++++++++++++++++++++++++++++++++++++
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 3 ++
include/acpi/acnames.h | 1 +
include/linux/acpi.h | 12 +++++++-
include/linux/device.h | 1 +
include/linux/mod_devicetable.h | 6 ++++
7 files changed, 86 insertions(+), 2 deletions(-)
--
1.9.3
From: Al Stone <ahs3(a)redhat.com>
The following patches are pretty much the same core as used for the Seattle
topic branch. There are a few additional APM X-Gene specific patches.
These are not final by any stretch of the imagination. As with the Seattle
patches, there is much work to be done for PCI (especially since the Mustang
hardware is a very special case), and it is a known the the network card does
not yet work properly.
So why commit these patches? Simply put, to record the current progress
and make visible the current work on Mustang.
This kernel does boot and run, and PCI does seem to work. As noted, the
NIC is not yet correct but this is being investigated and may be firmware
related, not kernel.
Al Stone (3):
Fix arm64 compilation error in PNP code
clocksource: arm_arch_timer: fix system hang
arm64/pci/acpi: initial support for ACPI probing of PCI
Graeme Gregory (2):
acpi: add arm to the platforms that use ioremap
tty: SBSA compatible UART
Hanjun Guo (1):
ARM64 / ACPI: Introduce some PCI functions when PCI is enabled
Kyle McMartin (1):
arm64: don't set READ_IMPLIES_EXEC for EM_AARCH64 ELF objects
Mark Salter (17):
ahci_xgene: add errata workaround for ATA_CMD_SMART
arm64: use EFI as last resort for reboot and poweroff
acpi: fix acpi_os_ioremap for arm64
arm64: add parking protocol support
sata/xgene: support acpi probing
xgene: add support for ACPI-probed serial port
Revert "ahci_xgene: Skip the PHY and clock initialization if already
configured by the firmware."
arm64: add sev to parking protocol
arm64: avoid need for console= to enable serial console
xgene acpi network - first cut
acpi: add utility to test for device dma coherency
arm64: [NOT FOR UPSTREAM] fix dma_ops for ACPI and PCI devices
arm64/pci: replace weak raw pci ops with settable ops
arm64/acpi/pci: add support for parsing MCFG table
arm64/acpi/pci: provide hook for MCFG fixups
PCI: xgene: Provide fixup for ACPI MCFG support
iommu/arm-smmu: fix NULL dereference with ACPI PCI devices
Mika Westerberg (2):
ACPI: Add support for device specific properties
ACPI: Allow drivers to match using Device Tree compatible property
Rafael J. Wysocki (2):
Driver core: Unified device properties interface for platform firmware
Driver core: Unified interface for firmware node properties
arch/arm64/Kconfig | 6 +
arch/arm64/Makefile | 1 +
arch/arm64/include/asm/acpi.h | 3 +
arch/arm64/include/asm/elf.h | 3 +-
arch/arm64/include/asm/pci.h | 57 +++
arch/arm64/include/asm/smp.h | 5 +
arch/arm64/kernel/Makefile | 3 +-
arch/arm64/kernel/acpi.c | 54 +-
arch/arm64/kernel/cpu_ops.c | 4 +
arch/arm64/kernel/efi.c | 11 +
arch/arm64/kernel/pci.c | 108 ++--
arch/arm64/kernel/process.c | 6 +
arch/arm64/kernel/setup.c | 22 +
arch/arm64/kernel/smp_parking_protocol.c | 110 ++++
arch/arm64/mm/dma-mapping.c | 103 ++++
arch/arm64/pci/Makefile | 2 +
arch/arm64/pci/mmconfig.c | 431 ++++++++++++++++
arch/arm64/pci/pci.c | 375 ++++++++++++++
drivers/acpi/Makefile | 1 +
drivers/acpi/internal.h | 6 +
drivers/acpi/osl.c | 6 +-
drivers/acpi/property.c | 567 ++++++++++++++++++++
drivers/acpi/scan.c | 120 ++++-
drivers/acpi/utils.c | 26 +
drivers/ata/ahci_xgene.c | 30 +-
drivers/base/Makefile | 2 +-
drivers/base/property.c | 625 +++++++++++++++++++++++
drivers/clocksource/arm_arch_timer.c | 9 +-
drivers/iommu/arm-smmu.c | 8 +-
drivers/irqchip/irq-gic-v3.c | 10 +
drivers/irqchip/irq-gic.c | 10 +
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 77 ++-
drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 68 ++-
drivers/net/ethernet/apm/xgene/xgene_enet_main.h | 1 +
drivers/of/base.c | 102 +++-
drivers/pci/host/pci-xgene.c | 144 ++++++
drivers/pnp/resource.c | 2 +
drivers/tty/Kconfig | 6 +
drivers/tty/Makefile | 1 +
drivers/tty/sbsauart.c | 355 +++++++++++++
drivers/tty/serial/8250/8250_dw.c | 9 +
include/acpi/acpi_bus.h | 27 +
include/acpi/acpi_io.h | 6 +
include/asm-generic/vmlinux.lds.h | 7 +
include/linux/acpi.h | 106 +++-
include/linux/irqchip/arm-gic.h | 2 +
include/linux/of.h | 44 ++
include/linux/property.h | 107 ++++
48 files changed, 3670 insertions(+), 118 deletions(-)
create mode 100644 arch/arm64/kernel/smp_parking_protocol.c
create mode 100644 arch/arm64/pci/Makefile
create mode 100644 arch/arm64/pci/mmconfig.c
create mode 100644 arch/arm64/pci/pci.c
create mode 100644 drivers/acpi/property.c
create mode 100644 drivers/base/property.c
create mode 100644 drivers/tty/sbsauart.c
create mode 100644 include/linux/property.h
--
1.9.3
Update for 11 Jan 2015:
Back in September 2014, a meeting was held at Linaro Connect where we
discussed what issues remained before the arm64 ACPI core patches could
be merged into the kernel, creating the TODO list below. I should have
published this list sooner; I got focused on trying to resolve some of
the issues instead.
We have made some progress on all of these items. But, I want to make
sure we haven't missed something. Since this list was compiled by only
the people in the room at Connect, it is probable we have. I, for one,
do not yet claim omniscience.
So, I want to ask the ARM and ACPI communities:
-- Is this list correct?
-- Is this list complete?
Below is what we currently know about; very brief notes on status are
included. The TL;DR versions of the TODO list and the current status
can be found at:
https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/CoreUpstreamNotes
and I'll do my best to kept that up to date.
Thanks. Any and all feedback is greatly appreciated.
Changes since 14 Dec 2014:
-- v6 of ACPI core patches posted
-- Good progress in _OSI investigation, started preparing RFC for the
mailing lists
-- Precise definition of kernel behavior when defaulting to DT and/or
using acpi=force being discussed again
-- FWTS now runs and results posted after each merge of leg-kernel
(includes ACPI) with Linus' tree (i.e., each -rc).
-- ACPI on arm64 kernel document updated, under extensive discussion on
the lists; starting coordination with SBBR content.
-- Firmware Summit: planned for 26 Mar 2015, San Jose, CA, at the ARM
office; mailing list (with archives) now up and running; updated
agenda being prepared
-- Merged items "Demonstrate the ACPI core patches work", and "Platform
support patches need review" because of their similarity.
-- Further discussions have occurred regarding "Why ACPI?"; Grant has
a blog post explaining this better, and we will add that to kernel
document
-- Further discussion on the usage of _DSD has occurred, but much more
is needed
TODO List for ACPI on arm64:
============================
1. Define how Aarch64 OS identifies itself to firmware
* Problem:
* _OSI method is demonstrably unreliable. On x86, Linux claims to
be Windows.
* Proposal to use _OSC method as replacement is complicated and
creates an explosion of combinations
* Solution:
* Draft and propose OS identification rules to ABST and ASWG for
inclusion in ACPI spec.
* Draft and propose recommended practice for current ACPI 5.1 spec
platforms.
* Status: Good progress in _OSI investigation, started preparing RFC
for the mailing lists; general agreement to deprecate _OSI
completely
2. Linux must choose DT booting by default when offered both ACPI and
DT on arm64
* Status: DONE, but being revisited for possible algorithmic change
3. Linux UEFI/ACPI testing tools must be made available
* Problem:
* Hardware/Firmware vendors do not have tools to test Linux
compatibility.
* Common problems go undetected if not tested for.
* Solution:
* Port FWTS tool and LuvOS distribution to AArch64
* Make LuvOS images readily available
* Require hardware vendors to actively test against old and new
kernels.
* Status:
* LuvOS and FWTS ported to arm64; patches in mainline; additional
test cases being written.
* CI loop set up to run FWTS on Foundation model for each -rc
merge of Linus' tree into leg-kernel.
* AMD Seattle results pending updated kernel patches.
* LuvOS details at https://wiki.linaro.org/LEG/Engineering/luvOS
4. Set clear expectations for those providing ACPI for use with Linux
* Problem:
* Hardware/Firmware vendors can and will create ACPI tables that
cannot be used by Linux without some guidance
* Kernel developers cannot determine whether the kernel or
firmware is broken without knowing what the firmware should do
* Solution: document the expectations, and iterate as needed.
Enforce when we must.
* Status: kernel text updated and under heavy discussion, AMD has
made their guidance document available, and starting to coordinate
content with SBBR; firmware summit date and location seems firm,
agenda being updated.
5. Platform support patches need verification and review
* Problem: the core Aarch64 patches have been reviewed and are in
good shape, but there is not yet a good example of server platform
support patches that use them.
* Solution: post *good* patches for multiple ACPI platforms,
demonstrating that both the core patches work, and that the use of
the ACPI core makes sense.
* Status:
* ACPI core works on at least the Foundation model, Juno, APM
Mustang, and AMD Seattle
* FWTS results for the Foundation model have been posted
* First version for AMD Seattle has been posted to the public
linaro-acpi mailing list for initial review, refined versions to
be posted to broader lists after a few iterations for basic
cleanup
6. How does the kernel handle_DSD usage?
* Problem:
* _DSD defines key-value properties in the DT style. How do we
ensure _DSD bindings are well defined?
* How do we ensure DT and _DSD bindings remain consistent with
each other?
* Solution: public documentation for all bindings, and a process for
defining them
* Status: proposal to require patch authors to point at public
binding documentation; kernel Documentation/devicetree/bindings
remains the default if no other location exists; UEFI forum has
set up a binding repository. Discussion continues.
7. Why is ACPI required?
* Problem:
* arm64 maintainers still haven't been convinced that ACPI is
necessary.
* Why do hardware and OS vendors say ACPI is required?
* Solution: discussions between those who want ACPI and arm64
maintainers
* Status: Grant has provided a blog post at
http://www.secretlab.ca/archives/151. Al will roll that content
into the kernel documentation, also.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3(a)redhat.com
-----------------------------------
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).
>
> diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c
> index 44de133..b5fc732 100644
> --- a/arch/arm64/kernel/acpi_numa.c
> +++ b/arch/arm64/kernel/acpi_numa.c
> @@ -147,7 +147,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
> goto out_err_bad_srat;
> }
>
> - if (numa_add_memblk(node, start, end) < 0)
> + if (numa_add_memblk(node, start, ma->length) < 0)
Good catch! I didn't notice Ganapat updated the numa_add_memblk()
API for ARM64.
> goto out_err_bad_srat;
>
> node_set(node, numa_nodes_parsed);
>
> Ganapat,
> Is it possible to change the info prints of numa_add_memblk_to like below
>
> diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
> index 7bead6a..f293182 100644
> --- a/arch/arm64/mm/numa.c
> +++ b/arch/arm64/mm/numa.c
> @@ -194,7 +194,7 @@ static int __init numa_add_memblk_to(int nid, u64 start, u64 end,
> }
>
> pr_info("NUMA: Adding memblock %d [0x%llx - 0x%llx] on node %d\n",
> - mi->nr_blks, start, end, nid);
> + mi->nr_blks, start, end - 1, nid);
I think this is reasonable, 0x60000000 is belong to another
block I think.
Thanks
Hanjun
Hi Hanjun,
Overall the document looks good to us. Some minor clarifications below.
> ---------- Forwarded message ----------
> From: Graeme Gregory <graeme.gregory(a)linaro.org>
>
> Add documentation for the guidelines of how to use ACPI
> on ARM64.
>
> Signed-off-by: Graeme Gregory <graeme.gregory(a)linaro.org>
> Signed-off-by: Al Stone <al.stone(a)linaro.org>
> Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
> ---
> Documentation/arm64/arm-acpi.txt | 323
> ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 323 insertions(+)
> create mode 100644 Documentation/arm64/arm-acpi.txt
>
[..]
> +Relationship with Device Tree
> +-----------------------------
[..]
> +When booting using ACPI tables, the /chosen node in DT will still be
> parsed
> +to extract the kernel command line and initrd path. No other section of
> the
> +DT will be used.
Is this still true?
> +Programmable Power Control Resources
> +------------------------------------
> +Programmable power control resources include such resources as
> voltage/current
> +providers (regulators) and clock sources.
> +
> +The kernel assumes that power control of these resources is represented
> with
> +Power Resource Objects (ACPI section 7.1). The ACPI core will then
> handle
> +correctly enabling and disabling resources as they are needed. In order
> to
> +get that to work, ACPI assumes each device has defined D-states and that
> these
> +can be controlled through the optional ACPI methods _PS0, _PS1, _PS2, and
> _PS3;
> +in ACPI, _PS0 is the method to invoke to turn a device full on, and _PS3
> is for
> +turning a device full off.
> +
> +The kernel ACPI code will also assume that the _PS? methods follow the
> normal
> +ACPI rules for such methods:
> +
> + -- If either _PS0 or _PS3 is implemented, then the other method must
> also
> + be implemented.
> +
> + -- If a device requires usage or setup of a power resource when on,
> the ASL
> + should organize that it is allocated/enabled using the _PS0 method.
> +
> + -- Resources allocated or enabled in the _PS0 method should be
> disabled
> + or de-allocated in the _PS3 method.
> +
> + -- Firmware will leave the resources in a reasonable state before
> handing
> + over control to the kernel.
> +
We found this section could be improved a bit by explicitly calling out
the options for handling device PM. Platform vendor has two choices.
Resources can be managed in _PSx routine which gets called on entry to Dx.
Or they can be declared separately as power resources with their own _ON
and _OFF methods. They are then tied back to D-states for a particular
device via _PRx which specifies which power resources a device needs to be
on while in Dx. Kernel then tracks number of devices using a power
resource and calls _ON/_OFF as needed.
> +Such code in _PS? methods will of course be very platform specific. But,
> +this allows the driver to abstract out the interface for operating the
> device
> +and avoid having to read special non-standard values from ACPI tables.
> Further,
> +abstracting the use of these resources allows the hardware to change over
> time
> +without requiring updates to the driver.
> +
I think its been mentioned in the past and you planned to add it here: we
should explicitly state that with ACPI, the kernel clock/vreg framework
are not expected to be used at all.
> +
> +Clocks
> +------
> +ACPI makes the assumption that clocks are initialized by the firmware --
> +UEFI, in this case -- to some working value before control is handed over
> +to the kernel. This has implications for devices such as UARTs, or SoC
> +driven LCD displays, for example.
> +
> +When the kernel boots, the clock is assumed to be set to reasonable
> +working value. If for some reason the frequency needs to change -- e.g.,
> +throttling for power management -- the device driver should expect that
> +process to be abstracted out into some ACPI method that can be invoked
Exception to this is CPU clocks where CPPC provides a much richer
interface than just blindly invoking some method.
> +(please see the ACPI specification for further recommendations on
> standard
> +methods to be expected). If is not, there is no direct way for ACPI to
> +control the clocks.
> +
> +
[..]
> +ASWG
> +----
> +The following areas are not yet fully defined for ARM in the 5.1 version
> +of the ACPI specification and are expected to be worked through in the
> +UEFI ACPI Specification Working Group (ASWG):
> +
> + -- ACPI based CPU topology
> + -- ACPI based Power management
Should clarify this to idle management rather than generic power management.
> + -- CPU idle control based on PSCI
> + -- CPU performance control (CPPC)
There is no ongoing work on CPPC. Additional enhancements may be explored
in the future, but spec is viable as is.
Regards,
Ashwin
--
Qualcomm Innovation Center, Inc
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
--
This patchset introduces CPPC(Collaborative Processor Performance Control) as a backend
to the PID governor. The PID governor from intel_pstate.c maps cleanly onto some CPPC
interfaces.
e.g. The CPU performance requests are made on a continuous scale as against discrete pstate
levels. The CPU performance feedback over an interval is gauged using platform specific
counters which are also described by CPPC.
Although CPPC describes several other registers to provide more hints to the platform,
Linux as of today does not have the infrastructure to make use of those registers.
Some of the CPPC specific information could be made available from the scheduler as
part of the CPUfreq and Scheduler intergration work. Until then PID can be used as the
front end for CPPC.
This implementation was tested using a Thinkpad X240 Laptop which enumerates CPPC and PCC
tables in its ACPI firmware.
This patchset builds on top of the PCC driver which is being reviewed separately[3].
Changes since V2:
- Select driver if !X86, since intel_pstate will use HWP extensions instead.
- Added more comments.
- Added Freq domain awareness and PSD parsing.
Changes since V1:
- Create a new driver based on Dirks suggestion.
- Fold in CPPC backend hooks into main driver.
Changes since V0: [1]
- Split intel_pstate.c into a generic PID governor and platform specific backend.
- Add CPPC accessors as PID backend.
CPPC:
====
CPPC (Collaborative Processor Performance Control) is a new way to control CPU
performance using an abstract continous scale as against a discretized P-state scale
which is tied to CPU frequency only. It is defined in the ACPI 5.0+ spec. In brief,
the basic operation involves:
- OS makes a CPU performance request. (Can provide min and max tolerable bounds)
- Platform (such as BMC) is free to optimize request within requested bounds depending
on power/thermal budgets etc.
- Platform conveys its decision back to OS
The communication between OS and platform occurs through another medium called (PCC)
Platform communication Channel. This is a generic mailbox like mechanism which includes
doorbell semantics to indicate register updates. The PCC driver is being discussed in a
separate patchset [3] and is not included here, since CPPC is only one client of PCC.
Finer details about the PCC and CPPC spec are available in the latest ACPI 5.1
specification.[2]
[1] - http://lwn.net/Articles/608715/
[2] - http://www.uefi.org/sites/default/files/resources/ACPI_5_1release.pdf
[3] - https://patches.linaro.org/40705/
Ashwin Chaugule (2):
CPPC as a PID controller backend
ACPI PID: Add frequency domain awareness.
drivers/cpufreq/Kconfig | 12 +
drivers/cpufreq/Makefile | 1 +
drivers/cpufreq/acpi_pid.c | 1230 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 1243 insertions(+)
create mode 100644 drivers/cpufreq/acpi_pid.c
--
1.9.1
From: Al Stone <ahs3(a)redhat.com>
This patch set is in the acpi-topic-seattle branch of acpi.git.
The basic idea is that these patches are an example of how to implement
ACPI for the AMD Seattle platform. Many of them have been borrowed from
the Fedora arm64 kernel tree which is at:
git://git.fedorahosted.org/git/kernel-arm64.git
Additional patches come from Linaro and LKMLA. With the exception of the
PCI patches, or others mentioned below, the intent is that the original
authors of these patches will submit them upstream. As always, they rely
on the ACPI core patches already being in place.
Patches 0001-006 are some cleanup and nice-to-have patches that let
ACPI, UEFI and the Seattle platform work better together.
Patch 0007 is Graeme's SBSA console patch, which ultimately needs to
be replaced with a proper pl011 console driver (still being worked on
by ARM, I believe).
Patch 0008 introduces ACPI support for the Seattle's AHCI code.
Patch 0009 fixes a compilation error in the PNP code.
Patch 0010 introduces some skeleton PCI functions to be replaced later.
Patch 0011 adds support for the secondary CPU parking protocol.
Patches 0011 and 0012 add general support for the AMD XGBE 10Gbe network
interface.
Patches 0014-0025 are from the device properties previously posted on
the ACPI mailing list; these may need updates if the final versions put
into the Linux tree differ. NB: 0017-0025 are not strictly required for
Seattle, but have been included so that the entire patch set posted on
LKMLA is included.
Patch 0026 adds ACPI support to the AMD XGBE 10Gbe interface. Yes, just
one patch.
Patch 0027 adds code to make it easy to set up DMA coherency on a device
using ACPI.
Patch 0028 may or may not be useful for upstream; it corrects a problem
with DMA operations when ACPI and PCI are being used but there may be
better ways to handle it.
Patch 0029 removes at DT dependency in the arch timer that can cause a
hang when using ACPI.
Patches 0030-0034 do basic PCI setup based on the contents of the MCFG
table in ACPI (for PCIe); these are also a first generation and definitely
need refinement and refactoring -- in some cases, there is code duplicated
from x86 or ia64, for example.
Patches 0035-0037 fix compiler warnings that annoyed me.
Patch 0038 allows one to skip adding a console= parameter on the command
line.
These patches were tested on an AMD Seattle platform, using the 71C version
of their firmware (future versions will have needed fixes for PCI windows
and some other odds and ends). The kernel command line was:
BOOT_IMAGE=/Image.acpi.git root=UUID=d5f87d27-cd7d-4ac5-9e16-dfa850ae32ad \
ro console=ttySBSA0,115200 earlycon=sbsauart,0xe1010000 vconsole.keymap=us \
crashkernel=auto vconsole.font=latarcyrheb-sun16 acpi=force \
acpi_force_table_verification uefi_debug
The console, SATA, and NIC all work as expected. PCIe works (PCI will need
a new DSDT) with a SATA card I had laying around. It is known to work with
a couple of other PCIe devices, but that's all I tried.
Things to do:
-- Get PCI re-done; there are way too many x86-isms in the code, and
some serious refactoring and cleanup is needed; the ia64 seems to
have taken some good steps in this direction.
-- MSI(-X) support: a DT version has been posted, and some ACPI work
is under way.
-- KVM support: ACPI support patches are available, but were not included
here since I have not had time to test them.
-- Subject the code to the full FWTS; this is pending available LAVA
machines and some patches to FWTS, but the CI loop is set up.
-- Plus whatever ACPI spec changes or additions arise....
Tested-by: Al Stone <al.stone(a)linaro.org>
Aaron Lu (2):
input: gpio_keys_polled - Add support for GPIO descriptors
input: gpio_keys_polled - Make use of device property API
Al Stone (5):
Fix arm64 compilation error in PNP code
arm64/pci/acpi: initial support for ACPI probing of PCI
drivers/base: correct function prototype to remove compiler warning
drivers/of: fix new device property function that could return a bad
value
AMD / XGBE : remove duplicate function definition
Graeme Gregory (2):
acpi: add arm to the platforms that use ioremap
tty: SBSA compatible UART
Hanjun Guo (1):
ARM64 / ACPI: Introduce some PCI functions when PCI is enabled
Mark Salter (11):
arm64: use EFI as last resort for reboot and poweroff
acpi: fix acpi_os_ioremap for arm64
arm64: add parking protocol support
acpi: add utility to test for device dma coherency
arm64: [NOT FOR UPSTREAM] fix dma_ops for ACPI and PCI devices
clocksource: arm_arch_timer: fix system hang
arm64/pci: replace weak raw pci ops with settable ops
arm64/acpi/pci: add support for parsing MCFG table
arm64/acpi/pci: provide hook for MCFG fixups
iommu/arm-smmu: fix NULL dereference with ACPI PCI devices
arm64: avoid need for console= to enable serial console
Mika Westerberg (7):
ACPI: Add support for device specific properties
ACPI: Allow drivers to match using Device Tree compatible property
misc: at25: Make use of device property API
gpio / ACPI: Add support for _DSD device properties
gpio: sch: Consolidate core and resume banks
leds: leds-gpio: Add support for GPIO descriptors
gpio: Support for unified device properties interface
Rafael J. Wysocki (3):
Driver core: Unified device properties interface for platform firmware
Driver core: Unified interface for firmware node properties
leds: leds-gpio: Make use of device property API
Russell King (2):
ARM: Blacklist GCC 4.8.0 to GCC 4.8.2 - PR58854
ARM: fix some printk formats
Suravee Suthikulpanit (1):
ata: ahci_platform: Add ACPI support for AMD Seattle SATA controller
Tom Lendacky (3):
drivers: net: AMD Seattle XGBE 10GbE support for A0 silicon
drivers: net: AMD Seattle XGBE PHY support for A0 silicon
amd-xgbe: AMD 10GbE driver APCI support for A0
Will Deacon (1):
zap_pte_range: update addr when forcing flush after TLB batching
faiure
Documentation/acpi/gpio-properties.txt | 52 ++
arch/arm/kernel/asm-offsets.c | 12 +-
arch/arm/mm/init.c | 8 +-
arch/arm64/Kconfig | 6 +
arch/arm64/Makefile | 1 +
arch/arm64/include/asm/acpi.h | 3 +
arch/arm64/include/asm/pci.h | 57 +++
arch/arm64/include/asm/smp.h | 5 +
arch/arm64/kernel/Makefile | 3 +-
arch/arm64/kernel/acpi.c | 54 +-
arch/arm64/kernel/cpu_ops.c | 4 +
arch/arm64/kernel/efi.c | 11 +
arch/arm64/kernel/pci.c | 108 ++--
arch/arm64/kernel/process.c | 6 +
arch/arm64/kernel/setup.c | 22 +
arch/arm64/kernel/smp_parking_protocol.c | 107 ++++
arch/arm64/mm/dma-mapping.c | 103 ++++
arch/arm64/pci/Makefile | 2 +
arch/arm64/pci/mmconfig.c | 431 ++++++++++++++++
arch/arm64/pci/pci.c | 375 ++++++++++++++
drivers/acpi/Makefile | 1 +
drivers/acpi/internal.h | 6 +
drivers/acpi/osl.c | 6 +-
drivers/acpi/property.c | 567 +++++++++++++++++++++
drivers/acpi/scan.c | 120 ++++-
drivers/acpi/utils.c | 26 +
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 13 +
drivers/base/Makefile | 2 +-
drivers/base/dma-coherent.c | 6 +-
drivers/base/property.c | 625 +++++++++++++++++++++++
drivers/clocksource/arm_arch_timer.c | 11 +-
drivers/gpio/devres.c | 36 ++
drivers/gpio/gpio-sch.c | 293 +++++------
drivers/gpio/gpiolib-acpi.c | 78 ++-
drivers/gpio/gpiolib.c | 86 +++-
drivers/gpio/gpiolib.h | 7 +-
drivers/input/keyboard/gpio_keys_polled.c | 112 ++---
drivers/iommu/arm-smmu.c | 8 +-
drivers/irqchip/irq-gic-v3.c | 10 +
drivers/irqchip/irq-gic.c | 10 +
drivers/leds/leds-gpio.c | 186 +++----
drivers/misc/eeprom/at25.c | 34 +-
drivers/net/ethernet/amd/Kconfig | 2 +-
drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 16 +-
drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 289 ++++++++---
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 20 +-
drivers/net/ethernet/amd/xgbe/xgbe-ptp.c | 4 +-
drivers/net/ethernet/amd/xgbe/xgbe.h | 13 +
drivers/net/phy/Kconfig | 2 +-
drivers/net/phy/amd-xgbe-phy.c | 791 ++++++++++++++++--------------
drivers/of/base.c | 103 +++-
drivers/pnp/resource.c | 2 +
drivers/tty/Kconfig | 6 +
drivers/tty/Makefile | 1 +
drivers/tty/sbsauart.c | 355 ++++++++++++++
include/acpi/acpi_bus.h | 27 +
include/acpi/acpi_io.h | 6 +
include/asm-generic/vmlinux.lds.h | 7 +
include/linux/acpi.h | 106 +++-
include/linux/gpio/consumer.h | 8 +
include/linux/gpio_keys.h | 3 +
include/linux/irqchip/arm-gic.h | 2 +
include/linux/leds.h | 1 +
include/linux/of.h | 44 ++
include/linux/property.h | 107 ++++
mm/memory.c | 1 +
68 files changed, 4611 insertions(+), 923 deletions(-)
create mode 100644 Documentation/acpi/gpio-properties.txt
create mode 100644 arch/arm64/kernel/smp_parking_protocol.c
create mode 100644 arch/arm64/pci/Makefile
create mode 100644 arch/arm64/pci/mmconfig.c
create mode 100644 arch/arm64/pci/pci.c
create mode 100644 drivers/acpi/property.c
create mode 100644 drivers/base/property.c
create mode 100644 drivers/tty/sbsauart.c
create mode 100644 include/linux/property.h
--
1.9.3
On 12/19/2014 12:47 PM, Suravee Suthikulanit wrote:
> On 12/19/2014 8:56 AM, Hanjun Guo wrote:
>> Hi Suravee,
>>
>> On 2014年12月18日 07:16, Suravee Suthikulpanit wrote:
>>> From: Suravee Suthikulpanit <Suravee.Suthikulpanit(a)amd.com>
>>>
>>> Device drivers typically use ACPI _HIDs/_CIDs listed in struct
>>> device_driver
>>> acpi_match_table to match devices. However, for generic drivers, we do
>>> not want to list _HID for all supported devices, and some device classes
>>> do not have _CID (e.g. SATA, USB). Instead, we can leverage ACPI _CLS,
>>> which specifies PCI-defined class code (i.e. base-class, subclass and
>>> programming interface).
>>>
>>> This patch adds support for matching ACPI devices using the _CLS method.
>>>
>>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit(a)amd.com>
>>> ---
>>> drivers/acpi/scan.c | 73
>>> +++++++++++++++++++++++++++++++++++++++++
>>> include/acpi/acnames.h | 1 +
>>> include/linux/acpi.h | 12 ++++++-
>>> include/linux/device.h | 1 +
>>> include/linux/mod_devicetable.h | 6 ++++
>>> 5 files changed, 92 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
>>> index d670158..6406648 100644
>>> --- a/drivers/acpi/scan.c
>>> +++ b/drivers/acpi/scan.c
>>> @@ -864,6 +864,79 @@ int acpi_match_device_ids(struct acpi_device
>>> *device,
>>> }
>>> EXPORT_SYMBOL(acpi_match_device_ids);
>>>
>>> +/**
>>> + * acpi_match_device_cls - Match a struct device against a ACPI _CLS
>>> method
>>> + * @dev_cls: A pointer to struct acpi_device_cls object to match
>>> against.
>>> + * @dev: The ACPI device structure to match.
>>> + *
>>> + * Check if @dev has a valid ACPI and _CLS handle. If there is a
>>> + * struct acpi_device_cls object for that handle, use that object to
>>> match
>>> + * against the given struct acpi_device_cls object.
>>> + *
>>> + * Return 0 on success or error code on failure.
>>> + */
>>> +int acpi_match_device_cls(const struct acpi_device_cls *dev_cls,
>>> + const struct device *dev)
>>> +{
>>> + int ret = -EINVAL;
>>> + acpi_status status;
>>> + struct acpi_device *adev;
>>> + union acpi_object *pkg;
>>> + struct acpi_device_cls cls;
>>> + struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
>>> + struct acpi_buffer format = { sizeof("NNN"), "NNN" };
>>> + struct acpi_buffer state = { 0, NULL };
>>> + acpi_handle handle = ACPI_HANDLE(dev);
>>
>> ...
>>
>>> + acpi_handle cls_handle;
>>> +
>>> + if (!handle || acpi_bus_get_device(handle, &adev))
>>
>> if handle is not NULL, adev will not NULL too :)
>> because you get the handle from adev, ACPI_HANDLE() is defined as:
>> acpi_device_handle(ACPI_COMPANION(dev)), and adev = ACPI_COMPANION(dev);
>>
>> you may use adev = ACPI_COMPANION(dev) to simplify the code.
>>
Thanks for the pointer.
>>> + return ret;
>>> +
>>> + if (!adev->status.present || !dev_cls)
>>> + return ret;
>>> +
>>> + status = acpi_get_handle(adev->handle, METHOD_NAME__CLS,
>>> &cls_handle);
>>
>> do we need this function called here? _CLS is the method under ACPI
>> device object in DSDT/SSDT, and you will get adev->handle == cls_handle
>> if I'm not wrong :)
You are right. It is not needed, and we can just evaluate right from the
handle.
>>> + if (ACPI_FAILURE(status))
>>> + return ret;
>>> +
>>> + status = acpi_evaluate_object(cls_handle, "_CLS", NULL, &buffer);
>>> + if (ACPI_FAILURE(status)) {
>>> + ACPI_EXCEPTION((AE_INFO, status, "Failed to Evaluat _CLS"));
>>> + return ret;
>>> + }
>>
>> I think you can evaluate _CLS directly with handle here.
>>
>> Thanks
>> Hanjun
>
Yep. I will send out the new patch in a bit.
Thanks,
Suravee
From: Suravee Suthikulpanit <Suravee.Suthikulpanit(a)amd.com>
This patch series introduce ACPI support for non-PCI AHCI platform driver.
Existing ACPI support for AHCI assumes the device controller is a PCI device.
Also, since there is no ACPI _HID/_CID for generic AHCI controller, the driver
could not use them for matching devices. Therefore, this patch introduces a mechanism
for drivers to match devices using ACPI _CLS method.
This patch series is rebased from:
http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v6
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
Suravee Suthikulpanit (2):
ACPI / scan: Add support for ACPI _CLS device matching
ata: ahci_platform: Add ACPI _CLS matching
drivers/acpi/scan.c | 73 +++++++++++++++++++++++++++++++++++++++++
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 10 ++++++
include/acpi/acnames.h | 1 +
include/linux/acpi.h | 12 ++++++-
include/linux/device.h | 1 +
include/linux/mod_devicetable.h | 6 ++++
7 files changed, 103 insertions(+), 2 deletions(-)
--
1.9.3
If a wait_for_completion_timeout() call returns due to a timeout,
the mbox code can still call complete() after returning from the wait.
This can cause subsequent transmissions on a channel to fail, since
the wait_for_completion_timeout() sees the completion variable
is !=0, caused by the erroneous complete() call, and immediately
returns without waiting for the time as expected by the client.
Fix this by calling complete() only if the TX was successful.
Signed-off-by: Ashwin Chaugule <ashwin.chaugule(a)linaro.org>
---
drivers/mailbox/mailbox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 17e9e4a..4acaddb 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -101,7 +101,7 @@ static void tx_tick(struct mbox_chan *chan, int r)
if (mssg && chan->cl->tx_done)
chan->cl->tx_done(chan->cl, mssg, r);
- if (chan->cl->tx_block)
+ if ((!r) && chan->cl->tx_block)
complete(&chan->tx_complete);
}
--
1.9.1
With ACPI arm64 core paches and NUMA patch from Ganapatrao,
I prepared those ACPI based NUMA support for ARM64.
updates since RFC version:
- Address some comments from Arnd
- I tested those patches on simulation platform and find the
mappings of CPU to NUMA node and memory to NUMA node are
correct;
- fix some compile issues with CONFIG_ACPI_NUMA disabled;
- fix logical problem for the mappings of CPU to node ID
There is still a warning about not released a early remapped
memory, I'm working on it now.
Ganapatrao Kulkarni (1):
arm64:numa: adding numa support for arm64 platforms
Hanjun Guo (4):
ACPI / NUMA: Use pr_fmt() instead of printk
ACPI / NUMA: Remove redundant ACPI_DEBUG_OUTPUT and 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 | 33 ++
arch/arm64/include/asm/acpi.h | 7 +-
arch/arm64/include/asm/mmzone.h | 32 ++
arch/arm64/include/asm/numa.h | 46 +++
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/acpi_numa.c | 176 +++++++++++
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 | 674 ++++++++++++++++++++++++++++++++++++++++
drivers/acpi/Kconfig | 2 +-
drivers/acpi/numa.c | 108 ++++---
drivers/acpi/processor_core.c | 5 +
include/acpi/processor.h | 1 +
include/linux/acpi.h | 15 +
16 files changed, 1097 insertions(+), 51 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/mm/numa.c
--
1.9.1
Hi,
The luvOS distribution is booting on arm64 FVP base model.
The log goes here https://pastebin.linaro.org/view/dc319415 certainly
it is required to update the FWTS with arm64 patches.
The git repo - http://git.linaro.org/people/naresh.bhat/luvOS/luv-yocto.git
The wiki page is Under construction...:)
If you want to try it on your machine. You can just copy and paste
the below commands on your machine after installing the OE/Yocto
dependency packages on your host machine distribution.
$ git clone ssh://git@git.linaro.org/people/naresh.bhat/luvOS/luv-yocto.git
$ cd luv-yocto
$ . ./oe-init-build-env
$ vim conf/local.conf
and change the following lines in your local.conf file
BB_NUMBER_THREADS ?= "16"
...
......
MACHINE ??= "genericarmv8"
....
.........
DISTRO ?= "luv"
save and quit local.conf file
$ vim conf/bblayers.conf
Add the following line to BBLAYERS variable
<project-path>/luv-yocto/meta-luv
e.g.
BBLAYERS ?= " \
/home/nareshbhat/Projects/OE/arm64/luv-yocto/meta \
/home/nareshbhat/Projects/OE/arm64/luv-yocto/meta-yocto \
/home/nareshbhat/Projects/OE/arm64/luv-yocto/meta-yocto-bsp \
/home/nareshbhat/Projects/OE/arm64/luv-yocto/meta-luv \
"
Save and quit the bblayers.conf file
Now,
you can start building the project
$ bitbake luv-live-image
which generates HDD image, ISO image. You can also generate the
core-image-efi image which gives a rootfs from command
$ bitbake core-image-efi
Let me know if you have any issues.
-Cheers
Naresh
this is the RFC version of ACPI based NUMA support for ARM64,
it is based on 3.18-rc4 and v5 of ARM64 ACPI core patches, it also
based on DT based NUMA patch from Ganapatrao [1].
Have not tested yet, will do that after posted this patch
for RFC, any comment are welcomed.
[1] http://www.spinics.net/lists/arm-kernel/msg380197.html
Ganapatrao Kulkarni (1):
arm64:numa: adding numa support for arm64 platforms.
Hanjun Guo (4):
ACPI / NUMA: Use pr_fmt() instead of printk
ACPI / NUMA: Remove redundant ACPI_DEBUG_OUTPUT
ARM64 / ACPI: NUMA support based on SRAT and SLIT
ACPI / NUMA: Enable ACPI based NUMA on ARM64
arch/arm64/Kconfig | 33 ++
arch/arm64/include/asm/acpi.h | 3 +
arch/arm64/include/asm/mmzone.h | 32 ++
arch/arm64/include/asm/numa.h | 46 +++
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/acpi_numa.c | 176 +++++++++++
arch/arm64/kernel/setup.c | 10 +
arch/arm64/kernel/smp.c | 2 +
arch/arm64/mm/Makefile | 1 +
arch/arm64/mm/init.c | 34 +-
arch/arm64/mm/numa.c | 675 ++++++++++++++++++++++++++++++++++++++++
drivers/acpi/Kconfig | 2 +-
drivers/acpi/numa.c | 64 ++--
drivers/acpi/processor_core.c | 5 +
include/acpi/processor.h | 1 +
include/linux/acpi.h | 15 +
16 files changed, 1074 insertions(+), 26 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/mm/numa.c
--
1.9.1
Changes since V10:
- Replace array with dynamic allocation.
- Rename index to subspace_id to avoid confusion.
- Use latency instead of min turnaround time.
Changes since V9:
- Default to PCC subspace headers as defined in ACPI v5.1
Changes since V8:
- Removed unncessary header files.
- Added kerneldoc comments.
- Added intro about PCC in pcc.c
Changes since V7:
- Added timeout to tx method in case the remote dies.
- Restructured usage of acpi_status. Had inverted logic previously.
Changes since V6:
- Cosmetic changes based on Lv's suggestions
Changes since V5:
- Optimize loop that matches channel request.
- Use platform_create_bundle.
- Replace ioread/writes.
- Remove redundant code and headers.
- Restructure common mailbox macros.
- Reformat PCC cmd parsing.
Changes since V4:
- Folded PCC Mailbox helpers into pcc.c
Changes since V3:
- Added PCC helper functions to work around "struct device" limitations.
- PCC driver changes to work with PCC specific Mailbox helpers.
Changes since V2:
- Rebased on top of git://git.linaro.org/landing-teams/working/fujitsu/integration.git
branch mailbox-for-3.17
- Added PCC API to mailbox framework as per Arnd's suggestion to allow usage without ACPI.
Changes since V1:
- Integration with Mailbox framework - https://lkml.org/lkml/2014/5/15/49
This patchset adds support for the PCC (Platform Communication Channel)
interface as described in the current ACPI 5.0 spec. See Section 14 of the
ACPI spec - http://acpi.info/DOWNLOADS/ACPI_5_Errata%20A.pdf for more details
on how PCC works.
In brief PCC is a generic means for PCC clients, to talk to the firmware. The
PCC register space is typically memory mapped IO and uses a doorbell mechanism
to communicate synchronously from the OS to the firmware. The PCC driver is
completely agnostic to the protocol implemented by the PCC clients. It only
implements the enumeration of PCC channels and the low level transport mechanism
and leaves the rest to the PCC clients.
The PCC is meant to be useable in the future by clients such as CPPC
(Collaborative Processor Performance Control), RAS (Reliability,
Availability and Serviceability) and MPST (Memory Power State Tables) and possibly others.
Ashwin Chaugule (1):
Mailbox: Add support for Platform Communication Channel
drivers/mailbox/Kconfig | 12 ++
drivers/mailbox/Makefile | 2 +
drivers/mailbox/mailbox.c | 4 +-
drivers/mailbox/mailbox.h | 16 ++
drivers/mailbox/pcc.c | 403 ++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 434 insertions(+), 3 deletions(-)
create mode 100644 drivers/mailbox/mailbox.h
create mode 100644 drivers/mailbox/pcc.c
--
1.9.1
Hi,
Just a small series to enable better testing of ACPI in LAVA without having
to fetch and built test suites with git.
Changes since v1 :-
Missed a hunk from aapits patch that prevents test results being overwritten
on test end.
Thanks
Graeme
Some cleanups to convert apic_id to phys_id to accommodate
ACPI 5.0+.
updates since v1:
- rebase on top of linux-next git repo to slove the conflicts
with IOAPIC hotplug patch
- modify patch 2 to update the comments and print message using
arch independent words instead of APIC
Hanjun Guo (3):
ACPI / processor: Update the comments in processor.h
ACPI / processor: Convert apic_id to phys_id to make it arch agnostic
ACPI / processor: Rename acpi_(un)map_lsapic() to acpi_(un)map_cpu()
arch/ia64/kernel/acpi.c | 9 ++++---
arch/x86/kernel/acpi/boot.c | 9 ++++---
drivers/acpi/acpi_processor.c | 25 ++++++++++---------
drivers/acpi/processor_core.c | 56 +++++++++++++++++++++----------------------
include/acpi/processor.h | 12 ++++++----
include/linux/acpi.h | 4 ++--
6 files changed, 59 insertions(+), 56 deletions(-)
--
1.9.1
Hi,
So over the last couple of days I have been looking into the test
suites we currently have available in the leg-kernel CI/test cycle and
come to the following conclusions.
1) aapits - tests the core of the acpica code, does not test anything
in the kernel or the BIOS. Is unmaintained by acpica folks and Tomasz
patches have sat idle on bug tracker for 3/4 of a year. This test
suite does not test anything we are interested in I propose we drop it
from CI.
2) acpica-tools - tests the iasl compiler, is run on every tools
packaging for rpm/deb. I suggest the tools CI/packaging cycles are a
better location for these tests and we drop them from CI
3) acpi-smoke-test - This is the basic test that we booted from ACPI,
I think this is useful to keep as a quick getout of testing if it
fails.
4) FWTS - current target of our testing for BIOS testing. This we keep.
So I am suggesting we only have tests that exercise the kernel or BIOS
in some manner. We are still lacking in tests that exercise the kernel
but I have no idea what these tests should be at current time.
Thanks
Graeme