linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hanjun.guo@linaro.org (Hanjun Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 17/17] Documentation: ACPI for ARM64
Date: Mon,  1 Sep 2014 22:57:55 +0800	[thread overview]
Message-ID: <1409583475-6978-18-git-send-email-hanjun.guo@linaro.org> (raw)
In-Reply-To: <1409583475-6978-1-git-send-email-hanjun.guo@linaro.org>

From: Graeme Gregory <graeme.gregory@linaro.org>

Add documentation for the guidelines of how to use ACPI
on ARM64.

Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 Documentation/arm64/arm-acpi.txt |  218 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 218 insertions(+)
 create mode 100644 Documentation/arm64/arm-acpi.txt

diff --git a/Documentation/arm64/arm-acpi.txt b/Documentation/arm64/arm-acpi.txt
new file mode 100644
index 0000000..704a9e0
--- /dev/null
+++ b/Documentation/arm64/arm-acpi.txt
@@ -0,0 +1,218 @@
+ACPI on ARMv8 Servers
+---------------------
+
+ACPI can be used for ARMv8 general purpose servers designed to follow
+the SBSA specification (currently available to people with an ARM login at
+http://silver.arm.com).
+
+The kernel will implement minimum ACPI version is 5.1 + errata as released by
+the UEFI Forum, which is available at <http://www.uefi.org/acpi/specs>.
+
+If the machine does not meet the requirements of the SBSA, or cannot be
+described in the required ACPI specifications then it is likely that Device Tree
+(DT) is more suitable for the hardware.
+
+Relationship with Device Tree
+-----------------------------
+
+ACPI support in drivers and subsystems for ARMv8 should never be mutually
+exclusive with DT support at compile time.
+
+At boot time the kernel will only use one description method depending on
+parameters passed from the bootloader (including kernel bootargs).
+
+Regardless of whether DT or ACPI is used, the kernel must always be capable
+of booting with either scheme (in kernels with both schemes enabled at compile
+time).
+
+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.
+
+Booting using ACPI tables
+-------------------------
+
+Currently, the only defined method to pass ACPI tables to the kernel on ARMv8
+is via the UEFI system configuration table.
+
+The UEFI implementation MUST set the ACPI_20_TABLE_GUID to point to the
+RSDP table (the table with the ACPI signature "RSD PTR ").
+
+The pointer to the RSDP table will be retrieved from EFI by the ACPI core.
+
+Processing of ACPI tables may be disabled by passing acpi=off on the kernel
+command line.
+
+DO use an XSDT; RSDTs are deprecated and should not be used on arm64. They
+only allow for 32-bit addresses.
+
+DO NOT use the 32-bit address fields in the FADT; they are deprecated. The
+64-bit alternatives MUST be used.
+
+The minimum set of tables MUST include RSDP, XSDT, FACS, FADT, DSDT, MADT
+and GTDT. If PCI is used the MCFG table MUST also be present.
+
+ACPI Detection
+--------------
+
+Drivers should determine their probe() type by checking for ACPI_HANDLE,
+or .of_node, or other information in the device structure. This is
+detailed further in the "Driver Recommendations" section.
+
+In non-driver code If the presence of ACPI needs to be detected at runtime,
+then check the value of acpi_disabled. If CONFIG_ACPI is not set,
+acpi_disabled will always be 1.
+
+Device Enumeration
+------------------
+
+Device descriptions in ACPI should use standard recognized ACPI interfaces.
+These are far simpler than the information provided via Device Tree. Drivers
+should take into account this simplicity and work with sensible defaults.
+
+On no account should a Device Tree attempt to be replicated in ASL using such
+constructs as Name(KEY0, "Value1") type constructs. Additional driver specific
+data should be represented with the appropriate _DSD (ACPI Section 6.2.5)
+structure. _DSM (ACPI Section 9.14.1) should only be used if _DSD cannot
+represent the data required.
+
+This data should be rare and not OS specific. For x86 ACPI has taken to
+identifying itself as Windows because it was found that only one path was
+routinely tested. For ARMv8 it would be preferable to have only one well
+tested path.
+
+_DSD covers more than the generic server case and care should be taken not to
+replicate highly specific embedded behaviour from DT into generic servers.
+
+Common _DSD bindings should be submitted to ASWG to be included in the
+document :-
+
+http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel.htm
+
+If these bindings are mirrored from DT care should be taken to ensure they are
+reviewed as DT bindings before submission to limit divergance in bindings.
+
+Programmable Power Control Resources
+------------------------------------
+
+Programmable power control resources include such resources as voltage/current
+providers (regulators) and clock sources.
+
+For power control of these resources they should be represented with Power
+Resource Objects (ACPI Section 7.1). The ACPI core will then handle correctly
+enabling/disabling of resources as they are needed.
+
+The ACPI 5.1 specification does not contain any standard binding for these
+objects to enable programmable levels or rates so this should be avoided if
+possible and the resources set to appropriate levels by the firmware. If this is
+not possible then any manipulation should be abstracted in ASL.
+
+Each device in ACPI has D-states and these can be controlled through
+the optional methods _PS0..._PS3 where _PS0 is full on and _PS3 is full off.
+
+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/enabled in the _PS0 method should be disabled/de-allocated
+in the _PS3 method.
+
+Such code in _PS? methods will of course be very platform specific but
+should allow the driver to operate the device without special non-standard
+values being read from ASL. Further, abstracting the use of these resources
+allows hardware revisions without requiring updates to the kernel.
+
+Clocks
+------
+
+Like clocks that are part of the power resources there is no standard way
+to represent a clock tree in ACPI 5.1 in a similar manner to how it is
+described in DT.
+
+Devices affected by this include things like UARTs, SoC driven LCD displays,
+etc.
+
+The firmware (for example, UEFI) should initialize these clocks to fixed working
+values before the kernel is executed.
+
+Driver Recommendations
+----------------------
+
+DO NOT remove any FDT handling when adding ACPI support for a driver. Different
+systems may use the same device.
+
+DO try and keep complex sections of ACPI and DT functionality separate. This
+may mean a patch to break out some complex DT to another function before
+the patch to add ACPI. This may happen in other functions but is most likely
+in probe function. This gives a clearer flow of data for reviewing driver
+source.
+
+probe() :-
+
+static int device_probe_dt(struct platform_device *pdev)
+{
+	/* DT specific functionality */
+	...
+}
+
+static int device_probe_acpi(struct platform_device *pdev)
+{
+	/* ACPI specific functionality */
+	...
+}
+
+static int device_probe(stuct platform_device *pdev)
+{
+	...
+	struct device_node node = pdev->dev.of_node;
+	...
+
+	if (node)
+		ret = device_probe_dt(pdev);
+	else if (ACPI_HANDLE(&pdev->dev))
+		ret = device_probe_acpi(pdev);
+	else
+		/* other initialization */
+		...
+	/* Continue with any generic probe operations */
+	...
+}
+
+DO keep the MODULE_DEVICE_TABLE entries together in the driver to make it clear
+the different names the driver is probed for, both from DT and from ACPI.
+
+module device tables :-
+
+static struct of_device_id virtio_mmio_match[] = {
+        { .compatible = "virtio,mmio", },
+        { }
+};
+MODULE_DEVICE_TABLE(of, virtio_mmio_match);
+
+static const struct acpi_device_id virtio_mmio_acpi_match[] = {
+        { "LNRO0005", },
+        { }
+};
+MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match);
+
+ASWG
+----
+
+The following areas are not yet well defined for ARM in the current ACPI
+specification and are expected to be worked through in the UEFI ACPI
+Specification Working Group (ASWG) <http://www.uefi.org/workinggroups>.
+Participation in this group is open to all UEFI members.
+
+	- ACPI based CPU topology
+	- ACPI based Power management
+	- CPU idle control based on PSCI
+	- CPU performance control (CPPC)
+	- ACPI based SMMU
+	- ITS support for GIC in MADT
+
+No code shall be accepted into the kernel unless it complies with the released
+standards from UEFI ASWG. If there are features missing from ACPI to make it
+function on a platform, ECRs should be submitted to ASWG and go through the
+approval process.
-- 
1.7.9.5

  parent reply	other threads:[~2014-09-01 14:57 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01 14:57 [PATCH v3 00/17] Introduce ACPI for ARM64 based on ACPI 5.1 Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 01/17] ARM64: Move the init of cpu_logical_map(0) before unflatten_device_tree() Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 02/17] ARM64 / ACPI: Get RSDP and ACPI boot-time tables Hanjun Guo
2014-09-09 16:26   ` Catalin Marinas
2014-09-09 16:41     ` Jon Masters
2014-09-09 16:44       ` Jon Masters
2014-09-09 17:15       ` Mark Rutland
2014-09-09 17:33         ` Jon Masters
2014-09-09 17:50         ` Lorenzo Pieralisi
2014-09-09 18:05           ` Sudeep Holla
2014-09-09 19:06             ` Jon Masters
2014-09-10 11:13               ` Hanjun Guo
2014-09-10 12:33                 ` Catalin Marinas
2014-09-10 21:51                   ` Grant Likely
2014-09-11 11:01                     ` Catalin Marinas
2014-09-14 15:40                       ` Grant Likely
2014-09-14 21:59                         ` Catalin Marinas
2014-09-15  3:53                           ` Grant Likely
2014-09-16  5:29                     ` Zheng, Lv
2014-09-10 21:41                 ` Grant Likely
2014-09-09 16:54     ` Mark Rutland
2014-09-10  7:30     ` Hanjun Guo
2014-09-10 21:37     ` Grant Likely
2014-09-01 14:57 ` [PATCH v3 03/17] ARM64 / ACPI: Introduce lowlevel suspend function Hanjun Guo
2014-09-09 16:35   ` Catalin Marinas
2014-09-09 22:04     ` Graeme Gregory
2014-09-01 14:57 ` [PATCH v3 04/17] ARM64 / ACPI: Introduce early_param for "acpi" Hanjun Guo
2014-09-09 16:37   ` Catalin Marinas
2014-09-09 17:17   ` Bjorn Helgaas
2014-09-09 22:14     ` Jon Masters
2014-09-10 13:04       ` Will Deacon
2014-09-10 13:21         ` Bjorn Helgaas
2014-09-10 18:30           ` Will Deacon
2014-09-10 21:58           ` Grant Likely
2014-09-01 14:57 ` [PATCH v3 05/17] ARM64 / ACPI: If we chose to boot from acpi then disable FDT Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 06/17] ARM64 / ACPI: Make PCI optional for ACPI on ARM64 Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 07/17] ARM64 / ACPI: Parse FADT table to get PSCI flags for PSCI init Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 08/17] ACPI / table: Print GIC information when MADT is parsed Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 09/17] ARM64 / ACPI: Parse MADT for SMP initialization Hanjun Guo
2014-09-03 17:21   ` Lorenzo Pieralisi
2014-09-04 15:29     ` Hanjun Guo
2014-09-09  4:29       ` Jon Masters
2014-09-09  5:11         ` Hanjun Guo
2014-09-09  5:34           ` Jon Masters
2014-09-09 16:52       ` Lorenzo Pieralisi
2014-09-09 17:00         ` Jon Masters
2014-09-09 17:02         ` Jon Masters
2014-09-09  4:23   ` Jon Masters
2014-09-09  4:57     ` Hanjun Guo
2014-09-09  5:44       ` Jon Masters
2014-09-09 16:00         ` Hanjun Guo
2014-09-09 16:04           ` Jon Masters
2014-09-09 16:14             ` Hanjun Guo
2014-09-11 14:15             ` Will Deacon
2014-09-12 21:30               ` Jon Masters
2014-09-11 10:24   ` Grant Likely
2014-09-01 14:57 ` [PATCH v3 10/17] ACPI / processor: Make it possible to get CPU hardware ID via GICC Hanjun Guo
2014-09-03 16:27   ` Lorenzo Pieralisi
2014-09-08 13:10     ` Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 11/17] ARM64 / ACPI: Introduce ACPI_IRQ_MODEL_GIC and register device's gsi Hanjun Guo
2014-09-11 11:08   ` Grant Likely
2014-09-11 11:34     ` Grant Likely
2014-09-12  9:42     ` Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 12/17] ACPI / table: Add new function to get table entries Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 13/17] ARM64 / ACPI: Add GICv2 specific ACPI boot support Hanjun Guo
2014-09-01 17:35   ` Marc Zyngier
2014-09-02  8:28     ` [Linaro-acpi] " Alexander Spyridakis
2014-09-02 11:48     ` Tomasz Nowicki
2014-09-02 13:02       ` Marc Zyngier
2014-09-02 15:45         ` Hanjun Guo
2014-09-02 15:59           ` Marc Zyngier
2014-09-02 16:11           ` Sudeep Holla
2014-09-03 10:30           ` Marc Zyngier
2014-09-03 11:17             ` Hanjun Guo
2014-09-04 14:03               ` Hanjun Guo
2014-09-09  6:21             ` Jon Masters
2014-09-03  9:26         ` Tomasz Nowicki
2014-09-03 14:57           ` Arnd Bergmann
2014-09-05  8:52             ` Tomasz Nowicki
2014-09-05  9:47             ` Marc Zyngier
2014-09-05 10:13               ` [Linaro-acpi] " Arnd Bergmann
2014-09-05 10:36                 ` Tomasz Nowicki
2014-09-05 10:39                 ` Marc Zyngier
2014-09-05 10:49                   ` Tomasz Nowicki
2014-09-09  6:27             ` Jon Masters
2014-09-11 13:43         ` Grant Likely
2014-09-02 16:34       ` Catalin Marinas
2014-09-11 11:48       ` Grant Likely
2014-09-11 12:01         ` Marc Zyngier
2014-09-09  6:14     ` Jon Masters
2014-09-03 18:42   ` Arnd Bergmann
2014-09-04 10:10     ` Tomasz Nowicki
2014-09-04 10:14       ` Arnd Bergmann
2014-09-04 10:39         ` Tomasz Nowicki
2014-09-09  6:35     ` Jon Masters
2014-09-01 14:57 ` [PATCH v3 14/17] ARM64 / ACPI: Parse GTDT to initialize arch timer Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 15/17] ARM64 / ACPI: Select ACPI_REDUCED_HARDWARE_ONLY if ACPI is enabled on ARM64 Hanjun Guo
2014-09-01 14:57 ` [PATCH v3 16/17] ARM64 / ACPI: Enable ARM64 in Kconfig Hanjun Guo
2014-09-11 15:18   ` Lorenzo Pieralisi
2014-09-01 14:57 ` Hanjun Guo [this message]
2014-09-11 13:29 ` [PATCH v3 00/17] Introduce ACPI for ARM64 based on ACPI 5.1 Grant Likely
2014-09-11 13:49   ` Will Deacon
2014-09-12 21:38     ` Jon Masters
2014-09-12 21:43       ` Jon Masters
2014-09-15  4:21     ` Grant Likely
2014-09-11 14:23   ` Rafael J. Wysocki
2014-09-11 14:04     ` Grant Likely
2014-09-11 15:37   ` Catalin Marinas
2014-09-11 15:57     ` Sudeep Holla
2014-09-11 16:06       ` Graeme Gregory
2014-09-11 16:14         ` Sudeep Holla
2014-09-15  4:31     ` Grant Likely
2014-09-15  9:15       ` Catalin Marinas
2014-09-15 22:48         ` Grant Likely
2014-09-16 10:12           ` Catalin Marinas
2014-09-11 16:05   ` Olof Johansson
2014-09-15  4:37     ` Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409583475-6978-18-git-send-email-hanjun.guo@linaro.org \
    --to=hanjun.guo@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).