On Fri, Dec 06, 2013 at 08:26:58AM -0700, Al Stone wrote:
On 12/06/2013 08:22 AM, Graeme Gregory wrote:
Instead of littering platform with multiple functions more them into the arm-core.c file.
Stub them out in the !CONFIG_ACPI case.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org
arch/arm64/include/asm/acpi.h | 6 ++++++ arch/arm64/kernel/setup.c | 13 +------------ drivers/acpi/plat/arm-core.c | 9 +++++++++ 3 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 9095a7f..2611769 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -80,7 +80,13 @@ struct acpi_arm_root { }; extern struct acpi_arm_root acpi_arm_rsdp_info;
+#ifdef CONFIG_ACPI void arm_acpi_reserve_memory(void); +void arm_acpi_init(void); +#else +inline void arm_acpi_reserve_memory(void) {return;} +inline void arm_acpi_init(void) {return;} +#endif
/* Low-level suspend routine. */ extern int (*acpi_suspend_lowlevel)(void); diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 7e2a71c..707b857 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -263,22 +263,11 @@ void __init setup_arch(char **cmdline_p)
arm64_memblock_init();
-#ifdef CONFIG_ACPI arm_acpi_reserve_memory(); -#endif
efi_init();
-#ifdef CONFIG_ACPI
- /*
* Parse the ACPI tables for possible boot-time configuration
*/
- acpi_boot_table_init();
- early_acpi_boot_init();
- boot_cpu_apic_id = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
- acpi_boot_init();
- prefill_possible_map();
-#endif
arm_acpi_init();
paging_init(); request_standard_resources();
diff --git a/drivers/acpi/plat/arm-core.c b/drivers/acpi/plat/arm-core.c index bb37efe..f8798fc 100644 --- a/drivers/acpi/plat/arm-core.c +++ b/drivers/acpi/plat/arm-core.c @@ -42,6 +42,7 @@ #include <asm/io.h> #include <asm/smp.h> #include <asm/acpi.h> +#include <asm/cputype.h>
/*
- We never plan to use RSDT on arm/arm64 as its deprecated in spec but this
@@ -621,6 +622,14 @@ void __init arm_acpi_reserve_memory() memblock_remove(addr - section_offset, num_sections * SECTION_SIZE); }
+void arm_acpi_init(void) {
- acpi_boot_table_init();
- early_acpi_boot_init();
- boot_cpu_apic_id = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
- acpi_boot_init();
- prefill_possible_map();
+}
static int __init parse_acpi(char *arg) { if (!arg)
Oh, very nice. I like this a lot, personally. Much, much cleaner.
Acked-by: Al Stone al.stone@linaro.org
Obviously its not a final patch yet as it doesn't support armv7, I just wanted to get the teams feelings before doing it all.
Graeme