Hi Yi,
I prepared couple of pointers for you.
- wiki page about APEI which use SCI mechanism for x86:
https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/EINJ
- since there is no SCI for ARM we added to our acpi git tree commit
which simulates SCI behaviour for test purposes:
ACPI: Enable SCI_EMULATE to manually simulate physical hotplug testing
You can find SCI emulation usage example on wiki page above.
- JIRA card description which gives brief description of GPIO signalled
events idea for ACPI Hardware Reduced profile:
https://cards.linaro.org/browse/CARD-756
Let me know if you will have any questions.
Tomasz
From: Al Stone <al.stone(a)linaro.org>
These patches are experimental; they do actually compile and they even
seem to execute correctly. They are by no means complete. The reason
for posting them is really just to stir some discussion and see if this
is a truly crazy idea or if it has some potential for easing the ACPI
transition.
These patches introduce GUFI: the Grand Unified Firmware Interface. Okay,
yes, it is a silly name. I didn't spend a lot of time on it. What I'm
most interested in is the idea and whether it is worth pursuing further,
and whether or not there are better ways to do this if it does make sense.
The idea is very simple: introduce a shim layer that looks like a merge of
some sort between ACPI and FDT functionality in the kernel. In that shim
layer, make it possible for a driver to make a single call to a function,
and with that call, retrieve configuration information stored in either
ACPI tables or a DT. Further, allow the kernel to specify which has
priority -- i.e., search through ACPI tables, and then through FDT if
data is not found, or vice versa -- or which is exclusive, either ACPI
or FDT only.
Why would I do this? As a kernel developer, this allows me to make changes
in the direction of either FDT or ACPI as quickly or as slowly as I want to.
Most of my config can be in FDT and I can then piecemeal convert to ACPI
as I figure out ASL and/or any driver changes that may be needed. Secondly,
if I do this well, the changes to convert from FDT to ACPI *should* be very
small; from ACPI to FDT may be more difficult but over time that can likely
be improved as well. If someone was clever, they could even add support for
a specific board file and gradually convert that to FDT or ACPI. Third, in
the really, really long term, maybe someone comes up with yet another hardware
configuration description format that is so cool it provides sharks with
laser beams on their heads and *everyone* wants to convert to it. With this
layer in place, perhaps we can smooth even that transition by abstracting out
the config info that's needed and the API to retrieve it.
So, what do you think?
Changes in v2:
-- Took a completely different approach to the overall structure based
on feedback from Tomasz Nowicki.
-- Changed an assumption: originally, I wanted to absolutely minimize
the changes in API between OF and GUFI. That assumption has been
dropped in favor of defining a more general API that will attempt
to merge the best of ACPI and OF.
-- The changes to vexpress-sysreg are for only one OF call for now.
The previous version was more complete, but this version works. Over
time, further changes will be made as each call is converted to this
newer API.
Al Stone (4):
GUFI: add kernel config options for GUFI
GUFI: introduce the basic framework
ARM64: GUFI: add setup_arch() call to gufi_init()
GUFI: MFD: initial change to use one GUFI API call in vexpress-sysreg
arch/arm64/Kconfig | 6 -
arch/arm64/kernel/setup.c | 5 +
drivers/Kconfig | 2 +
drivers/gufi/Kconfig | 44 +++++++
drivers/gufi/Makefile | 11 ++
drivers/gufi/acpi_protocol.c | 35 +++++
drivers/gufi/acpi_protocol.h | 37 ++++++
drivers/gufi/core.c | 296 ++++++++++++++++++++++++++++++++++++++++++
drivers/gufi/of_protocol.c | 44 +++++++
drivers/gufi/of_protocol.h | 37 ++++++
drivers/mfd/vexpress-sysreg.c | 5 +-
include/linux/gufi.h | 62 +++++++++
12 files changed, 577 insertions(+), 7 deletions(-)
create mode 100644 drivers/gufi/Kconfig
create mode 100644 drivers/gufi/Makefile
create mode 100644 drivers/gufi/acpi_protocol.c
create mode 100644 drivers/gufi/acpi_protocol.h
create mode 100644 drivers/gufi/core.c
create mode 100644 drivers/gufi/of_protocol.c
create mode 100644 drivers/gufi/of_protocol.h
create mode 100644 include/linux/gufi.h
--
1.8.4.2
From: Al Stone <al.stone(a)linaro.org>
This series of patches starts with Hanjun's patch to create a kernel
config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I
then reviewed all of the code that touched any of several fields in the
FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced
mode [1]. Any time there was a use of one of the fields to be ignored,
I evaluated whether or not the code was implementing Hardware Reduced
mode correctly. Similarly, for each the flags in the FADT flags field
that are to be ignored in Hardware Reduced mode, the kernel code was again
scanned for proper usage. The remainder of the patches are to fix all of
the situations I could find where the kernel would not behave correctly
in this ACPI mode.
These seem to work just fine on the RTSM model for ARMv7, both with and
without ACPI enabled, and with and without ACPI_REDUCED_HARDWARE enabled;
similarly for the FVP model for ARMv8. The patches for ACPI on ARM
hardware have been submitted elsewhere but they presume that reduced HW
mode is functioning correctly. In the meantime, there's no way I can think
of to test all possible scenarios so feedback would be greatly appreciated.
[0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5…
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced
mode (sections 3.11.1, 4.1, 5.2.9, at a minimum).
Changes for v6:
-- Allow selection of CONFIG_ACPI_REDUCED_HARDWARE_ONLY to be more
architecture-independent, but make it harder to accidentally enable.
-- Make sure that ACPI ECs do not use the ACPI global lock when in
hardware reduced mode (I had missed this case in earlier reviews
of the kernel tree).
Changes for v5:
-- Clarify that if the kernel config option to build ACPI hardware reduced
mode is used, it builds a hardware reduced *only* kernel (i.e., full
legacy ACPI mode will no longer work).
Changes for v4:
-- Given the current state of ACPICA, disable CONFIG_ACPI_REDUCED_HARDWARE
for use on anything other than ARM.
-- Replaced #ifdefs with run-time checking for hardware reduced mode,
whenever possible
Changes for v3:
-- Modified enabling ACPI_REDUCED_HARDWARE in ACPICA when using
kernel config item CONFIG_ACPI_REDUCED_HARDWARE; now consistent
with ACPICA code base where needed
-- Enable X86 for CONFIG_ACPI_REDUCED_HARDWARE
-- Minimize bus master reload patching
-- Remove unneeded patch for dmi_check_system() (was 4/6)
-- Correct the patch for removing unneeded map/unmap of FADT fields
Changes for v2:
-- Remove patch that was outside of reduced HW mode changes
-- Simplify CONFIG_ACPI_REDUCED_HARDWARE in Kconfig
-- Simplify use of CONFIG_ACPI_REDUCED_HARDWARE in #ifdefs
-- Ensure changelogs are present
-- Combine and simplify previous patches 8 & 10
Al Stone (6):
ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE_ONLY to enforce this ACPI
mode
ACPI: bus master reload not supported in reduced HW mode
ACPI: HW reduced mode does not allow use of the FADT sci_interrupt
field
ACPI: in HW reduced mode, using FADT PM information is not allowed.
ACPI: do not map/unmap memory regions for FADT entries in reduced HW
mode
ACPI: make sure ECs do not use the ACPI global lock
drivers/acpi/Kconfig | 12 ++++++++++++
drivers/acpi/bus.c | 30 ++++++++++++++++--------------
drivers/acpi/ec.c | 12 ++++++++++--
drivers/acpi/osl.c | 38 +++++++++++++++++++-------------------
drivers/acpi/pci_link.c | 2 ++
drivers/acpi/processor_idle.c | 14 ++++++++++++--
include/acpi/platform/aclinux.h | 6 ++++++
7 files changed, 77 insertions(+), 37 deletions(-)
--
1.8.4.2
From: Al Stone <al.stone(a)linaro.org>
This series of patches starts with Hanjun's patch to create a kernel
config item for CONFIG_ACPI_REDUCED_HARDWARE [0]. Building on that, I
then reviewed all of the code that touched any of several fields in the
FADT that the OSPM is supposed to ignore when ACPI is in Hardware Reduced
mode [1]. Any time there was a use of one of the fields to be ignored,
I evaluated whether or not the code was implementing Hardware Reduced
mode correctly. Similarly, for each the flags in the FADT flags field
that are to be ignored in Hardware Reduced mode, the kernel code was again
scanned for proper usage. The remainder of the patches are to fix all of
the situations I could find where the kernel would not behave correctly
in this ACPI mode.
These seem to work just fine on the RTSM model for ARMv7, both with and
without ACPI enabled, and with and without ACPI_REDUCED_HARDWARE enabled;
similarly for the FVP model for ARMv8. The patches for ACPI on ARM
hardware have been submitted elsewhere but they presume that reduced HW
mode is functioning correctly. In the meantime, there's no way I can think
of to test all possible scenarios so feedback would be greatly appreciated.
[0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5…
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced
mode (sections 3.11.1, 4.1, 5.2.9, at a minimum).
Changes for v5:
-- Clarify that if the kernel config option to build ACPI hardware reduced
mode is used, it builds a hardware reduced *only* kernel (i.e., full
legacy ACPI mode will no longer work).
Changes for v4:
-- Given the current state of ACPICA, disable CONFIG_ACPI_REDUCED_HARDWARE
for use on anything other than ARM.
-- Replaced #ifdefs with run-time checking for hardware reduced mode,
whenever possible
Changes for v3:
-- Modified enabling ACPI_REDUCED_HARDWARE in ACPICA when using
kernel config item CONFIG_ACPI_REDUCED_HARDWARE; now consistent
with ACPICA code base where needed
-- Enable X86 for CONFIG_ACPI_REDUCED_HARDWARE
-- Minimize bus master reload patching
-- Remove unneeded patch for dmi_check_system() (was 4/6)
-- Correct the patch for removing unneeded map/unmap of FADT fields
Changes for v2:
-- Remove patch that was outside of reduced HW mode changes
-- Simplify CONFIG_ACPI_REDUCED_HARDWARE in Kconfig
-- Simplify use of CONFIG_ACPI_REDUCED_HARDWARE in #ifdefs
-- Ensure changelogs are present
-- Combine and simplify previous patches 8 & 10
Al Stone (5):
ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE_ONLY to enforce this ACPI
mode
ACPI: bus master reload not supported in reduced HW mode
ACPI: HW reduced mode does not allow use of the FADT sci_interrupt
field
ACPI: in HW reduced mode, using FADT PM information is not allowed.
ACPI: do not map/unmap memory regions for FADT entries in reduced HW
mode
drivers/acpi/Kconfig | 12 ++++++++++++
drivers/acpi/bus.c | 30 ++++++++++++++++--------------
drivers/acpi/osl.c | 38 +++++++++++++++++++-------------------
drivers/acpi/pci_link.c | 2 ++
drivers/acpi/processor_idle.c | 14 ++++++++++++--
include/acpi/platform/aclinux.h | 6 ++++++
6 files changed, 67 insertions(+), 35 deletions(-)
--
1.8.4.2
I took the _DSM lookup code from Brandon and moved it to generic acpi
drivers directory so it can be accessed from any driver.
I then implemented a fixed-regulator in ACPI using the _DSM lookups for
the regulator parameters.
This is obviously all prototype stuff until upstream/UEFI guys make
a decision on _DSM vs _PRP and also unified key/value fetching.
ASL patch will follow.
Graeme