From: Al Stone <al.stone(a)linaro.org>
These patches are purely experimental; they just barely compile and they
do not run just yet. 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 much more difficult but over time that can
likely be improved as well. 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?
Al Stone (5):
ACPI: GUFI: add kernel config options for GUFI
ACPI: GUFI: add build commands for drivers/gufi
ACPI: GUFI: add in early prototype code for some GUFI functions
ACPI: GUFI: add in simple test driver placeholders
ACPI: GUFI: start modifying the vexpress-sysreg driver to use the GUFI
arch/arm64/Kconfig | 6 -
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/acpi/acpi_platform.c | 1 +
drivers/gufi/Kconfig | 54 ++++++++
drivers/gufi/Makefile | 11 ++
drivers/gufi/gufi.c | 309 ++++++++++++++++++++++++++++++++++++++++++
drivers/gufi/gufi_acpi_test.c | 84 ++++++++++++
drivers/gufi/gufi_of_test.c | 83 ++++++++++++
drivers/mfd/vexpress-sysreg.c | 14 +-
include/linux/gufi.h | 83 ++++++++++++
11 files changed, 636 insertions(+), 12 deletions(-)
create mode 100644 drivers/gufi/Kconfig
create mode 100644 drivers/gufi/Makefile
create mode 100644 drivers/gufi/gufi.c
create mode 100644 drivers/gufi/gufi_acpi_test.c
create mode 100644 drivers/gufi/gufi_of_test.c
create mode 100644 include/linux/gufi.h
--
1.8.3.1
This patch set is based on part1 "Make ACPI core running on ARM64" patch
set.
After we can get the ACPI tables from UEFI, we can use these tables
to initialise the system now.
GIC (means GIC cpu interface) structure and GIC distributor structure in
MADT table contains the information of GIC cpu interface base address
and GIC distributor base address, which can be used to initialise GIC.
Further more, parked address in GIC structure can be used as cpu release
address for spin table SMP initialisation.
This patch set use these information to init SMP and GIC.
Please refer to chapter 5.2.12.14/15 of ACPI 5.0 spec for GIC and GIC
distributor structure information.
Amit Daniel Kachhap (1):
irqdomain: Add a new API irq_create_acpi_mapping()
Hanjun Guo (8):
ARM64 / ACPI: Implement core functions for parsing MADT table
ARM64 / ACPI: Prefill cpu possible/present maps and map logical cpu
id to APIC id
ARM64 / ACPI: Introduce map_gic_id() to get apic id from MADT or _MAT
method
ARM64 / ACPI: Use Parked Address in GIC structure for spin table SMP
initialisation
ACPI: Define ACPI_IRQ_MODEL_GIC needed for arm
Irqchip / gic: Set as default domain so we can access from ACPI
ACPI / ARM64: Update acpi_register_gsi to register with the core IRQ
subsystem
ACPI / GIC: Initialize GIC using the information in MADT
arch/arm64/include/asm/acpi.h | 16 +-
arch/arm64/kernel/irq.c | 5 +
arch/arm64/kernel/setup.c | 2 +
arch/arm64/kernel/smp.c | 2 +
arch/arm64/kernel/smp_spin_table.c | 16 +-
drivers/acpi/bus.c | 3 +
drivers/acpi/plat/arm-core.c | 397 +++++++++++++++++++++++++++++++++++-
drivers/acpi/processor_core.c | 26 +++
drivers/acpi/tables.c | 21 ++
drivers/irqchip/irq-gic.c | 7 +
include/linux/acpi.h | 9 +
kernel/irq/irqdomain.c | 27 +++
12 files changed, 521 insertions(+), 10 deletions(-)
--
1.7.9.5
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
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 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 to enable 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 | 8 ++++++++
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, 63 insertions(+), 35 deletions(-)
--
1.8.3.1
This is the first part of making ACPI core running on ARM.
PCI is optional on ARM64 but ACPI is dependent on PCI now, so
in the first patch we try to make ACPI can be running without
PCI.
_PDC is requred for ACPI processor_core.c, but its related code
is a little bit x86/ia64 dependent, so I rework _PDC related staff
to make it more arch independent, and then introduce the skeleton
of _PDC related for ARM64, it should be fully implemented after
ACPI spec is ready for processor idle control.
After that, arm-core.c is introduced so we can get ACPI table from
UEFI, then we can parsed for SMP initialisation, GIC initialisation
and for ACPI drivers.
This patch set is based on:
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
origin/linux-next branch and plus Al Stone's v2 reduced hardware profile
patch.
Hanjun Guo (7):
ACPI: Make ACPI core running without PCI on ARM64
ARM64 : Add dummy asm/cpu.h
ACPI / processor_core: Rework _PDC related stuff to make it more
arch-independent
ARM64 / ACPI: Introduce the skeleton of _PDC related for ARM64
ARM64 / ACPI: Introduce arm_core.c and its related head file
ARM64 / ACPI: Introduce lowlevel suspend function
ARM64 / ACPI: Enable ARM64 in Kconfig
arch/arm64/Kconfig | 2 +
arch/arm64/include/asm/acpi.h | 93 +++++++++++++++
arch/arm64/include/asm/cpu.h | 25 ++++
arch/arm64/include/asm/processor.h | 11 ++
arch/arm64/kernel/process.c | 5 +
arch/arm64/kernel/setup.c | 8 ++
drivers/acpi/Kconfig | 12 +-
drivers/acpi/Makefile | 4 +-
drivers/acpi/internal.h | 5 +
drivers/acpi/osl.c | 16 +++
drivers/acpi/plat/Makefile | 1 +
drivers/acpi/plat/arm-core.c | 226 ++++++++++++++++++++++++++++++++++++
drivers/acpi/processor_core.c | 27 ++---
drivers/acpi/reboot.c | 47 +++++---
drivers/pnp/pnpacpi/rsparser.c | 2 +
15 files changed, 452 insertions(+), 32 deletions(-)
create mode 100644 arch/arm64/include/asm/acpi.h
create mode 100644 arch/arm64/include/asm/cpu.h
create mode 100644 drivers/acpi/plat/Makefile
create mode 100644 drivers/acpi/plat/arm-core.c
--
1.7.9.5