[PATCH] arm64: acpi: add a Kconfig option to prefer ACPI boot over DT

Ard Biesheuvel ard.biesheuvel at linaro.org
Mon Apr 11 04:19:28 PDT 2016


If both ACPI and DT platform descriptions are available, and the
kernel was configured at build time to support both flavours, the
default policy in absence of a acpi=[off|force] kernel command line
parameter is to prefer DT over ACPI.

This adds an option to invert that default policy, and prefer ACPI
over DT instead. Note that this policy is still superseded by the
value of the acpi= command line parameter.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
---
 arch/arm64/Kconfig       | 13 +++++++++++++
 arch/arm64/kernel/acpi.c |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 4f436220384f..f3aef40ad0ac 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -918,6 +918,19 @@ config DMI
 	  However, even with this option, the resultant kernel should
 	  continue to boot on existing non-UEFI platforms.
 
+config PREFER_ACPI_OVER_DT
+	bool "Prefer booting via ACPI if both ACPI and DT are available"
+	depends on ACPI
+	help
+	  If both ACPI and DT platform descriptions are available, and the
+	  kernel was configured at build time to support both flavours, the
+	  default policy in absence of a acpi=[off|force] kernel command line
+	  parameter is to prefer DT over ACPI.
+
+	  This option inverts that default policy, by preferring ACPI over DT
+	  instead. Note that this default policy is still superseded by the
+	  value of the acpi= command line parameter.
+
 endmenu
 
 menu "Userspace binary formats"
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index d1ce8e2f98b9..50ac056fb1fd 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -188,7 +188,8 @@ void __init acpi_boot_table_init(void)
 	 *   and ACPI has not been force enabled (acpi=force)
 	 */
 	if (param_acpi_off ||
-	    (!param_acpi_force && of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
+	    (!IS_ENABLED(CONFIG_PREFER_ACPI_OVER_DT) &&
+	     !param_acpi_force && of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
 		return;
 
 	/*
-- 
2.5.0




More information about the linux-arm-kernel mailing list