This is the RFC version for converting the fixed clock to ACPI.
Since the ACPI namespace is ok at the very late stage of system
boot, so I did some major change in boot sequence for the enumeration
of fixed clock, amba bus and its child device. I think this part should
be review carefully.
For DT, it works well for armv8 foudation model after the change in
boot sequence, but the UART and amba bus are dependent on the fixed
clock, if I only convert the fixed clock to ACPI, UART will not
work. So this is the RFC version and the UART will be converted
together in next version.
Hanjun Guo (5):
Driver / clk: add platform driver for fixed clock
ACPI / ARM64: Whitelist the ACPI ID for fixed clock
ACPI / platform: add some comments for internel registry of _HID
names
ACPI / fixed-clock: Add ACPI driver for fixed clock
Clk / fixed clock: Delay the enumeration of fixed clock and make it
popssible for ACPI
arch/arm64/kernel/setup.c | 2 +-
drivers/acpi/acpi_platform.c | 7 ++--
drivers/clk/clk-fixed-rate.c | 78 +++++++++++++++++++++++++++++++++++++++++-
3 files changed, 82 insertions(+), 5 deletions(-)
--
1.7.9.5
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 are being submitted as an RFC to the linaro-acpi@ list so I can get
some other eyes looking at them before sending them to linux-acpi@ where
they really need to go. 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. However, there's no way I can think of
or test all possible scenarios so feedback would be greatly appreciated.
Changes for v2:
-- Change patch series title
-- Add in the FACS global lock patch as further hardware reduced mode
cleanup that is needed
-- Remove whitespace change that should not have gotten in
[1] Please see the ACPI Specification v5.0 for details on Hardware Reduced
mode.
[0] List at https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/AcpiReducedHw#Section_5…
Al Stone (13):
ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode
ACPI: bus master reload is unsupported in ACPI 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 #ifdefs so compiling without ACPI_REDUCED_HARDWARE works
properly
ACPI: ARM/ARM64: ensure the ACPI FACS global_lock is never used in HW
reduced mode
arch/arm/include/asm/acpi.h | 3 ++-
arch/arm64/include/asm/acpi.h | 3 ++-
drivers/acpi/Kconfig | 8 ++++++++
drivers/acpi/acpica/utxface.c | 3 ++-
drivers/acpi/bus.c | 9 +++++----
drivers/acpi/osl.c | 28 ++++++++++++++++++++--------
drivers/acpi/pci_link.c | 14 ++++++++------
drivers/acpi/plat/arm/boot.c | 2 ++
drivers/acpi/processor_idle.c | 29 ++++++++++++++++++++++++-----
drivers/acpi/processor_throttling.c | 8 ++++++++
drivers/acpi/sleep.c | 2 +-
include/acpi/acconfig.h | 2 +-
include/acpi/platform/aclinux.h | 6 ++++++
13 files changed, 89 insertions(+), 28 deletions(-)
--
1.8.3.1
On 29 October 2013 09:30, Lv Zheng <lv.zheng(a)intel.com> wrote:
> From: Bob Moore <robert.moore(a)intel.com>
>
> Surround definition of this with a #ifndef so that the kernel
> can define it elsewhere if desired.
>
> Signed-off-by: Bob Moore <robert.moore(a)intel.com>
> Signed-off-by: Lv Zheng <lv.zheng(a)intel.com>
>
Reviewed-by: Hanjun Guo <hanjun.guo(a)linaro.org>
> ---
> include/acpi/acconfig.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
> index 1c16f82..d98c670 100644
> --- a/include/acpi/acconfig.h
> +++ b/include/acpi/acconfig.h
> @@ -100,7 +100,9 @@
> * ACPI PM timer
> * FACS table (Waking vectors and Global Lock)
> */
> +#ifndef ACPI_REDUCED_HARDWARE
> #define ACPI_REDUCED_HARDWARE FALSE
> +#endif
>
>
> /******************************************************************************
> *
> --
> 1.7.10
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo(a)vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
From: Brandon Anderson <brandon.anderson(a)amd.com>
This is a proposal for ACPI driver probing of the ARM AMBA devices currently listed under ‘iofpga’ in the RTSM dts file. The main addition is drivers/amba/acpi.c which fits the role of an AMBA bus ‘connector resource’ for ACPI using struct amba_device.
I have not yet figured out the implementation details regarding clocks (handled in the dts file with clock-names). However, I have included a proposed ASL format for clock information in the DSDT example below. With the last patch that hacks the clock info, this prototype will run on the Foundation and RTSM models.
These patches require Hanjun’s fixed-clock patches to be applied first on top of a Linaro ACPI kernel: https://git.linaro.org/gitweb?p=arm/acpi/leg-kernel.git;a=summary
Please comment on both the concept and the implementation.
Brandon Anderson (3):
Remove UART and KMI entries from DTS file
Prototype of AMBA bus 'connector resource' for ACPI
Hack clock names to get prototype running
arch/arm64/boot/dts/foundation-v8-acpi.dts | 10 +-
arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts | 4 +
arch/arm64/boot/dts/rtsm_ve-motherboard-acpi.dtsi | 4 +
drivers/acpi/acpi_platform.c | 2 +
drivers/amba/Makefile | 2 +-
drivers/amba/acpi.c | 172 +++++++++++++++++++++
drivers/clk/clk-fixed-rate.c | 15 +-
7 files changed, 203 insertions(+), 6 deletions(-)
create mode 100644 drivers/amba/acpi.c
--
1.7.9.5
---
Device (AMBA) {
Name (_HID, "AMBA0000") /* the parallel to "arm,primecell" in DTS */
Name (_UID, 0)
/* Define 'apb_pclk' as a default clock source since it is
common with devices below */
Method(_DSM, 4, NotSerialized) {
Store (Package (3)
{
"clock-name", "apb_pclk", "\\_SB_.CLK0",
}, Local0)
Return (Local0)
}
Device (KMI0) {
Name (_ADR,0x1c060000)
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c060000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {44}
})
Return (RBUF)
}
}
Device (KMI1) {
Name (_ADR,0x1c070000)
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c070000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {45}
})
Return (RBUF)
}
}
Device (SER0) {
Name (_ADR,0x1c090000) // UART0
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c090000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {37}
})
Return (RBUF)
}
}
Device (SER1) {
Name (_ADR,0x1c0a0000) // UART1
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c0a0000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {38}
})
Return (RBUF)
}
}
Device (SER2) {
Name (_ADR,0x1c0b0000) // UART2
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c0b0000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {39}
})
Return (RBUF)
}
}
Device (SER3) {
Name (_ADR,0x1c0c0000) // UART3
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Memory32Fixed (ReadWrite, 0x1c0c0000, 0x00010000)
Interrupt (ResourceConsumer, Edge, ActiveBoth,
Exclusive, , , ) {40}
})
Return (RBUF)
}
}
}
From: Al Stone <ahs3(a)redhat.com>
This function was not defined as a pointer to a function but as a function.
This resulted in a "test is always true" warning in drivers/acpi/sleep.c where
it tested for the existence of the function.
Signed-off-by: Al Stone <al.stone(a)linaro.org>
---
arch/arm/include/asm/acpi.h | 2 +-
arch/arm64/include/asm/acpi.h | 2 +-
drivers/acpi/plat/arm/sleep.c | 11 +++++++++--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/arch/arm/include/asm/acpi.h b/arch/arm/include/asm/acpi.h
index ca7efaa..31f21fd 100644
--- a/arch/arm/include/asm/acpi.h
+++ b/arch/arm/include/asm/acpi.h
@@ -115,7 +115,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);
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index a19b73f..aee7190 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -93,7 +93,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);
diff --git a/drivers/acpi/plat/arm/sleep.c b/drivers/acpi/plat/arm/sleep.c
index 9129c7e..ac5e343 100644
--- a/drivers/acpi/plat/arm/sleep.c
+++ b/drivers/acpi/plat/arm/sleep.c
@@ -1,15 +1,22 @@
/*
- * sleep.c - x86-specific ACPI sleep support.
+ * sleep.c - ARM-specific ACPI sleep support.
*
* Copyright (C) 2001-2003 Patrick Mochel
* Copyright (C) 2001-2003 Pavel Machek <pavel(a)ucw.cz>
*/
+#ifdef CONFIG_ACPI_SLEEP
int acpi_suspend_lowlevel(void)
{
- /* BOZO: dummy routine; see below for actual */
+ /*
+ * TODO: connect this function to PSCI when it becomes available,
+ * and if actually needed.
+ */
return 0;
}
+#else
+int acpi_suspend_lowlevel(void);
+#endif
#ifdef CONFIG_X86
/* BOZO: disable everything for now... */
--
1.8.3.1