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
Hi,
I checked this out in preperation for Connect as we know from experience
that getting a network connection is pot luck normally.
The ACPI kernel we generate will boot with the Foundation model.
Download the Linaro 14.01 release from here :-
http://releases.linaro.org/14.01/openembedded/aarch64
The you can start the Foundation model with the following commandline
Foundation_v8pkg/models/Linux64_GCC-4.1/Foundation_v8 --cores=4 --visualization --no-secure-memory --data=bl1.bin@0x0 --data=uefi_fvp-base.bin@0x8000000 --block-device=<YOUR ROOT FILESYSTEM IMAGE> --gicv3 --network=nat
You will get a few errors as AMBA bus does not actually exist on Foundation
model. But these are harmless.
Further details are in the release notes from Linaro.
Graeme
Some of the ACPI code is arch-dependent and make the code can't be
compiled on !x86 or !ia64, the first two patches just do some rework
on the idle_boot_override and _PDC related stuff to make the ACPI
code more arch-independent.
The third patch just introduce map_gic_id() for ACPI processor core
followed the ACPI 5.0 spec. Last two patches are just some cleanups.
I have compiled the kernel successfully after appling this patch set
on x86 and ia64.
Changs for v5:
Realign the additional lines to the open parenthesis
pr_info(xxxx);
xxxx;
Changes for v4:
a) remove preprocessor directives in function bodies;
b) add another two patches for cleanups.
Changes for v3:
Fix the issues pointed out by Lan Tianyu and add the Reviewed-by for
first patch.
Changes for v2:
a) add #if defined(CONFIG_X86) || defined(CONFIG_IA64) for
idle_boot_override related code;
b) Rebased on 3.14-rc1.
Changes since the RFC version:
a) Remove the RFC tag;
b) Move idle_boot_override out of the arch directory suggested
by Alan;
c) Make these 3 patches as a separate patch set since there are
not not related to the ARM/ARM64 platform.
Hanjun Guo (5):
ACPI / idle: Make idle_boot_override depend on x86 and ia64
ACPI / processor_core: Rework _PDC related stuff to make it more
arch-independent
ACPI / processor: Introduce map_gic_id() to get apic id from MADT or
_MAT method
ACPI: Move BAD_MADT_ENTRY() to linux/acpi.h
ACPI: Replace printk with pr_* in tables.c
arch/ia64/include/asm/acpi.h | 5 +-
arch/ia64/kernel/acpi.c | 18 ++++--
arch/x86/include/asm/acpi.h | 19 +------
arch/x86/kernel/acpi/boot.c | 4 --
arch/x86/kernel/acpi/cstate.c | 29 ++++++++++
drivers/acpi/processor_core.c | 92 ++++++++++++++++++------------
drivers/acpi/tables.c | 124 ++++++++++++++++++-----------------------
include/linux/acpi.h | 4 ++
8 files changed, 158 insertions(+), 137 deletions(-)
--
1.7.9.5
Hi List,
It seems I forgot to send a summary of the new branch layout on :-
https://git.linaro.org/arm/acpi/acpi.git
1) acpi-mainline-core is a copy of the latest patch series sent by Hanjun
to the linux-acpi list.
2) acpi-core is work on top of this patch series that has not yet been
sent to upstream.
3) acpi-drivers is work on top of acpi-core and contains the drivers to
boot the FVP Base model. It is likely these shall never be presented for
upstream.
Graeme
This commit moves ISA-specific code to separate function and makes that
function depend on CONFIG_{E}ISA so that we do not have to maintain
acpi_isa_irq_to_gsi() function for architectures which do not support ISA.
Signed-off-by: Tomasz Nowicki <tomasz.nowicki(a)linaro.org>
---
drivers/acpi/pci_irq.c | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 361b40c..9c62340 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -370,6 +370,30 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
return NULL;
}
+#if IS_ENABLED(CONFIG_ISA) || IS_ENABLED(CONFIG_EISA)
+static int acpi_isa_register_gsi(struct pci_dev *dev)
+{
+ u32 dev_gsi;
+
+ /* Interrupt Line values above 0xF are forbidden */
+ if (dev->irq > 0 && (dev->irq <= 0xF) &&
+ (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
+ dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
+ pin_name(dev->pin), dev->irq);
+ acpi_register_gsi(&dev->dev, dev_gsi,
+ ACPI_LEVEL_SENSITIVE,
+ ACPI_ACTIVE_LOW);
+ return 0;
+ }
+ return -EINVAL;
+}
+#else
+static inline int acpi_isa_register_gsi(struct pci_dev *dev)
+{
+ return -ENODEV;
+}
+#endif
+
int acpi_pci_irq_enable(struct pci_dev *dev)
{
struct acpi_prt_entry *entry;
@@ -416,19 +440,9 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
* driver reported one, then use it. Exit in any case.
*/
if (gsi < 0) {
- u32 dev_gsi;
- /* Interrupt Line values above 0xF are forbidden */
- if (dev->irq > 0 && (dev->irq <= 0xF) &&
- (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
- dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
- pin_name(pin), dev->irq);
- acpi_register_gsi(&dev->dev, dev_gsi,
- ACPI_LEVEL_SENSITIVE,
- ACPI_ACTIVE_LOW);
- } else {
+ if (acpi_isa_register_gsi(dev))
dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
pin_name(pin));
- }
kfree(entry);
return 0;
--
1.7.9.5