This is the last part of patch set for core of ARM64 ACPI, and is based
on the patch set part2 "Using ACPI MADT table to initialise SMP and GIC".
ACPI GTDT (Generic Timer Description Table) is used for ARM/ARM64 only,
and contains the information for arch timer initialisation.
This patch trys to convert the arch timer to ACPI using GTDT.
After this patch set was posted, we already finished the SMP, GIC and
arch timer initialisation, which all are essential for ARM64 core system
running, then we will focus on converting the device drivers to ACPI.
Here is the GTDT ASL code I used:
---
platforms/foundation-v8.acpi/gtdt.asl | 35 ++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/platforms/foundation-v8.acpi/gtdt.asl b/platforms/foundation-v8.acpi/gtdt.asl
index 18c821a..714d61c 100644
--- a/platforms/foundation-v8.acpi/gtdt.asl
+++ b/platforms/foundation-v8.acpi/gtdt.asl
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, Al Stone <al.stone(a)linaro.org>
+ * Hanjun Guo <hanjun.guo(a)linaro.org>
*
* [GTDT] Generic Timer Description Table
* Format: [ByteLength] FieldName : HexFieldValue
@@ -21,22 +22,32 @@
[0004] Flags (decoded below) : 00000001
Memory Present : 1
-[0004] Secure PL1 Interrupt : 00000000
-[0004] SPL1 Flags (decoded below) : 00000000
- Trigger Mode : 0
+/* In Foundation model's dts file, the last cell of interrupts
+ * is 0xff01, it means its cpu mask is FF, and trigger type
+ * and flag is 1 = low-to-high edge triggered.
+ *
+ * so in ACPI the Trigger Mode is 1 - Edge triggered, and
+ * Polarity is 0 - Active high as ACPI spec describled.
+ *
+ * using direct mapping for hwirqs, it means that we using
+ * ID [16, 31] for PPI, not [0, 15] used in FDT.
+ */
+[0004] Secure PL1 Interrupt : 0000001d
+[0004] SPL1 Flags (decoded below) : 00000001
+ Trigger Mode : 1
Polarity : 0
-[0004] Non-Secure PL1 Interrupt : 00000000
-[0004] NSPL1 Flags (decoded below) : 00000000
- Trigger Mode : 0
+[0004] Non-Secure PL1 Interrupt : 0000001e
+[0004] NSPL1 Flags (decoded below) : 00000001
+ Trigger Mode : 1
Polarity : 0
-[0004] Virtual Timer Interrupt : 00000000
-[0004] VT Flags (decoded below) : 00000000
- Trigger Mode : 0
+[0004] Virtual Timer Interrupt : 0000001b
+[0004] VT Flags (decoded below) : 00000001
+ Trigger Mode : 1
Polarity : 0
-[0004] Non-Secure PL2 Interrupt : 00000000
-[0004] NSPL2 Flags (decoded below) : 00000000
- Trigger Mode : 0
+[0004] Non-Secure PL2 Interrupt : 0000001a
+[0004] NSPL2 Flags (decoded below) : 00000001
+ Trigger Mode : 1
Polarity : 0
Hanjun Guo (2):
clocksource / arch_timer: Use ACPI GTDT table to initialize arch
timer
ARM64 / clocksource: Use arch_timer_acpi_init()
arch/arm64/kernel/time.c | 4 ++
drivers/clocksource/arm_arch_timer.c | 129 ++++++++++++++++++++++++++++++----
include/clocksource/arm_arch_timer.h | 7 +-
3 files changed, 124 insertions(+), 16 deletions(-)
--
1.7.9.5
Hi Hanjun/ACPI team,
I am trying to boot V8 foundation model.
I am using boot wrapper code from
git://git.linaro.org/arm/models/boot-wrapper-aarch64.git
Kernel is booting fine but I cannot load ACPI blob as there are no
hooks in it to pass to kernel.
However in the git://git.linaro.org/arm/models/boot-wrapper.git there
are some ACPI hooks but it is for armv7 and does not compile for arm64
linaro toolchain.
Any pointer where i am going wrong?
Thanks,
Amit Daniel
From: Al Stone <al.stone(a)linaro.org>
Correct "coolign" to "cooling" and "*_ptg" to "*_pctg" as intended.
This changes comment text only.
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
drivers/acpi/processor_thermal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index d1d2e7f..1ea79739 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -186,14 +186,14 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state)
#endif
-/* thermal coolign device callbacks */
+/* thermal cooling device callbacks */
static int acpi_processor_max_state(struct acpi_processor *pr)
{
int max_state = 0;
/*
* There exists four states according to
- * cpufreq_thermal_reduction_ptg. 0, 1, 2, 3
+ * cpufreq_thermal_reduction_pctg. 0, 1, 2, 3
*/
max_state += cpufreq_get_max_state(pr->id);
if (pr->flags.throttling)
--
1.8.3.1
acpi_dock_init() will only be called in acpi_scan_init(),
and the code logic shows that if (acpi_disabled) is redundant:
acpi_init();
if (acpi_disabled) return;
acpi_scan_init();
acpi_dock_init();
if (acpi_disabled) /* redundant */
return;
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
This patch set is inspired by Rob's question for my ACPI ARM64
core patches :)
drivers/acpi/dock.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 8da6be9..61d0c3f 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -893,9 +893,6 @@ find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
void __init acpi_dock_init(void)
{
- if (acpi_disabled)
- return;
-
/* look for dock stations and bays */
acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, find_dock_and_bay, NULL, NULL, NULL);
--
1.7.9.5
This is the last part of patch set for core of ARM64 ACPI, and is based
on the patch set part2 "Using ACPI MADT table to initialise SMP and GIC".
ACPI GTDT (Generic Timer Description Table) is used for ARM/ARM64 only,
and contains the information for arch timer initialisation.
This patch trys to convert the arch timer to ACPI using GTDT.
After this patch set was posted, we already finished the SMP, GIC and
arch timer initialisation, which all are essential for ARM64 core system
running, then we will focus on converting the device drivers to ACPI.
Here is the GTDT ASL code I used:
---
platforms/foundation-v8.acpi/gtdt.asl | 35 ++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/platforms/foundation-v8.acpi/gtdt.asl b/platforms/foundation-v8.acpi/gtdt.asl
index 18c821a..714d61c 100644
--- a/platforms/foundation-v8.acpi/gtdt.asl
+++ b/platforms/foundation-v8.acpi/gtdt.asl
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, Al Stone <al.stone(a)linaro.org>
+ * Hanjun Guo <hanjun.guo(a)linaro.org>
*
* [GTDT] Generic Timer Description Table
* Format: [ByteLength] FieldName : HexFieldValue
@@ -21,22 +22,32 @@
[0004] Flags (decoded below) : 00000001
Memory Present : 1
-[0004] Secure PL1 Interrupt : 00000000
-[0004] SPL1 Flags (decoded below) : 00000000
- Trigger Mode : 0
+/* In Foundation model's dts file, the last cell of interrupts
+ * is 0xff01, it means its cpu mask is FF, and trigger type
+ * and flag is 1 = low-to-high edge triggered.
+ *
+ * so in ACPI the Trigger Mode is 1 - Edge triggered, and
+ * Polarity is 0 - Active high as ACPI spec describled.
+ *
+ * using direct mapping for hwirqs, it means that we using
+ * ID [16, 31] for PPI, not [0, 15] used in FDT.
+ */
+[0004] Secure PL1 Interrupt : 0000001d
+[0004] SPL1 Flags (decoded below) : 00000001
+ Trigger Mode : 1
Polarity : 0
-[0004] Non-Secure PL1 Interrupt : 00000000
-[0004] NSPL1 Flags (decoded below) : 00000000
- Trigger Mode : 0
+[0004] Non-Secure PL1 Interrupt : 0000001e
+[0004] NSPL1 Flags (decoded below) : 00000001
+ Trigger Mode : 1
Polarity : 0
-[0004] Virtual Timer Interrupt : 00000000
-[0004] VT Flags (decoded below) : 00000000
- Trigger Mode : 0
+[0004] Virtual Timer Interrupt : 0000001b
+[0004] VT Flags (decoded below) : 00000001
+ Trigger Mode : 1
Polarity : 0
-[0004] Non-Secure PL2 Interrupt : 00000000
-[0004] NSPL2 Flags (decoded below) : 00000000
- Trigger Mode : 0
+[0004] Non-Secure PL2 Interrupt : 0000001a
+[0004] NSPL2 Flags (decoded below) : 00000001
+ Trigger Mode : 1
Polarity : 0
Hanjun Guo (2):
clocksource / arch_timer: Use ACPI GTDT table to initialize arch
timer
ARM64 / clocksource: Use arch_timer_acpi_init()
arch/arm64/kernel/time.c | 4 ++
drivers/clocksource/arm_arch_timer.c | 129 ++++++++++++++++++++++++++++++----
include/clocksource/arm_arch_timer.h | 7 +-
3 files changed, 124 insertions(+), 16 deletions(-)
--
1.7.9.5
From: Naresh Bhat <naresh.bhat(a)linaro.org>
We had a missing symbol so define this as NULL for arm as it is currenly
unused on arm64 platform
Signed-off-by: Naresh Bhat <naresh.bhat(a)linaro.org>
---
arch/arm64/include/asm/acpi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index 5f17424..9095a7f 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -83,7 +83,7 @@ extern struct acpi_arm_root acpi_arm_rsdp_info;
void arm_acpi_reserve_memory(void);
/* Low-level suspend routine. */
-extern int acpi_suspend_lowlevel(void);
+extern int (*acpi_suspend_lowlevel)(void);
extern void prefill_possible_map(void);
--
1.7.9.5
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
From: Al Stone <al.stone(a)linaro.org>
These patches are a bit of all over the place. Each of them cleans up
or removes BOZO comments that have been in the ACPI ARM port from the
very early days of the port (I inserted the BOZO comments when it was
not clear what needed to be done but I could temporarily hack around
a problem). Removing each of those had all sorts of different changes
needed, from the simplest (the comment turns out to be wrong in hindsight),
to stubbing out or even removing functions that make no sense on an
ARMv7/v8 platform.
Changes for v2:
-- Simplification by using kernel config items to exclude code versus
obtuse #ifdef logic
Al Stone (7):
ACPI: ARM: make use of an ACPI blob address in FDT /chosen
configurable.
ACPI: ARM: Clean up a leftover comment that is no longer pertinent.
ACPI: ARM: remove x86 acpi_wakeup_address usage when running on ARM
ACPI: ARM: remove unnecessary comments
ACPI: ARM: cleanup comments and isolate out x86-specific PAD code
ACPI: ARM: stub out PCI configuration call for non-PCI systems
ACPI: ARM: stub out processor idle routines for use on non-x86
platforms
arch/arm/Kconfig.debug | 11 ++++++
arch/arm/include/asm/acpi.h | 7 ----
arch/arm/include/asm/io.h | 6 +---
arch/arm/include/asm/processor.h | 6 ----
arch/arm64/Kconfig.debug | 11 ++++++
arch/arm64/include/asm/acpi.h | 7 ----
arch/arm64/include/asm/processor.h | 6 ----
drivers/acpi/acpi_pad.c | 15 +++-----
drivers/acpi/osl.c | 42 ++++++++++++----------
drivers/acpi/processor_idle.c | 74 +++++++++++++++++++-------------------
drivers/acpi/sleep.c | 2 ++
11 files changed, 91 insertions(+), 96 deletions(-)
--
1.8.3.1
Al Stone (7):
ACPI: ARM: make use of an ACPI blob address in FDT /chosen
configurable.
ACPI: ARM: Clean up a leftover comment that is no longer pertinent.
ACPI: ARM: remove x86 acpi_wakeup_address usage when running on ARM
ACPI: ARM: remove unnecessary comments
ACPI: ARM: clean up comments and disable PAD code for ARM
ACPI: ARM: stub out PCI configuration call for non-PCI systems
ACPI: ARM: disable x86-specific processor idle code
arch/arm/Kconfig.debug | 11 ++++++++++
arch/arm/include/asm/acpi.h | 5 -----
arch/arm/include/asm/io.h | 6 +-----
arch/arm/include/asm/processor.h | 6 ------
arch/arm64/Kconfig.debug | 11 ++++++++++
arch/arm64/include/asm/acpi.h | 5 -----
arch/arm64/include/asm/processor.h | 6 ------
drivers/acpi/Kconfig | 5 +++--
drivers/acpi/acpi_pad.c | 17 ---------------
drivers/acpi/osl.c | 42 ++++++++++++++++++++++----------------
drivers/acpi/processor_idle.c | 35 -------------------------------
11 files changed, 50 insertions(+), 99 deletions(-)
--
1.8.3.1
From: Al Stone <ahs3(a)redhat.com>
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 will be coming later 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.
Al Stone (12):
ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode
ACPI: bus master reload not supported in reduced HW mode
ACPI: clean up compiler warning about uninitialized field
ACPI: HW reduced mode does not allow use of the FADT sci_interrupt
field
ACPI: ARM: exclude calls on ARM platforms, not include them on x86
ACPI: ensure several FADT fields are only used in HW reduced mode
ACPI: do not reserve memory regions for some FADT entries in HW
reduced mode
ACPI: in HW reduced mode, getting power latencies from FADT is not
allowed
ACPI: add clarifying comment about processor throttling in HW reduced
mode
ACPI: ACPI_FADT_C2_MP_SUPPORTED must be ignored in HW reduced mode
ACPI: use of ACPI_FADT_32BIT_TIMER is not allowed in HW reduced mode
ACPI: correct #ifdef so compilation without ACPI_REDUCED_HARDWARE
works
drivers/acpi/Kconfig | 8 ++++++++
drivers/acpi/acpica/utxface.c | 3 ++-
drivers/acpi/bus.c | 7 ++++++-
drivers/acpi/osl.c | 28 ++++++++++++++++++++--------
drivers/acpi/pci_link.c | 14 ++++++++------
drivers/acpi/processor_idle.c | 19 ++++++++++++++-----
drivers/acpi/processor_throttling.c | 8 ++++++++
drivers/acpi/sleep.c | 2 +-
include/acpi/acpixf.h | 6 ++++++
include/acpi/platform/aclinux.h | 4 ++++
10 files changed, 77 insertions(+), 22 deletions(-)
--
1.8.3.1
From: Al Stone <ahs3(a)redhat.com>
These patches are a bit of all over the place. Each of them cleans up
or removes BOZO comments that have been in the ACPI ARM port from the
very early days of the port (I inserted the BOZO comments when it was
not clear what needed to be done but I could temporarily hack around
a problem). Removing each of those had all sorts of different changes
needed, from the simplest (the comment turns out to be wrong in hindsight),
to stubbing out or even removing functions that make no sense on an
ARMv7/v8 platform.
The only file in the ARM ACPI code that still has a "BOZO" comment in it
should be drivers/acpi/plat/arm/sleep.c; this has been left alone since
there are discussions about removing the file completely (which is probably
a good idea).
Al Stone (7):
ACPI: ARM: make use of an ACPI blob address in FDT /chosen
configurable.
ACPI: ARM: Clean up a leftover comment that is no longer pertinent.
ACPI: ARM: remove x86 acpi_wakeup_address usage when running on ARM
ACPI: ARM: remove unnecessary comments
ACPI: ARM: cleanup comments and isolate out x86-specific PAD code
ACPI: ARM: stub out PCI configuration call for non-PCI systems
ACPI: ARM: stub out processor idle routines for use on non-x86
platforms
arch/arm/Kconfig.debug | 11 ++++++
arch/arm/include/asm/acpi.h | 7 ----
arch/arm/include/asm/io.h | 6 +---
arch/arm/include/asm/processor.h | 6 ----
arch/arm64/Kconfig.debug | 11 ++++++
arch/arm64/include/asm/acpi.h | 7 ----
arch/arm64/include/asm/processor.h | 6 ----
drivers/acpi/acpi_pad.c | 15 +++-----
drivers/acpi/osl.c | 42 ++++++++++++----------
drivers/acpi/processor_idle.c | 74 +++++++++++++++++++-------------------
drivers/acpi/sleep.c | 2 ++
11 files changed, 91 insertions(+), 96 deletions(-)
--
1.8.3.1