From: Al Stone al.stone@linaro.org
Since this is really only a option to be used during kernel development, add the kernel config item ACPI_USE_CHOSEN_NODE to allow a developer access to this when working on a non-UEFI system or if needed to experiment with ACPI table content during driver development.
Signed-off-by: Al Stone al.stone@linaro.org --- arch/arm/Kconfig.debug | 11 +++++++++++ arch/arm64/Kconfig.debug | 11 +++++++++++ drivers/acpi/osl.c | 10 ++++++---- 3 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 0e23bb6..6ef3d7c 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1132,4 +1132,15 @@ config PID_IN_CONTEXTIDR additional instructions during context switch. Say Y here only if you are planning to use hardware trace tools with this kernel.
+config ACPI_USE_CHOSEN_NODE + bool "Pass ACPI blob address through /chosen node" + depends on ARM || ARM64 + help + Enabling this allows one to experiment with ACPI tables during + development on non-UEFI systems. If this is enabled, ACPI will + expect to find /chosen/linux,acpi-start in an FDT passed into + the kernel and use the contents of that node as the physical + address of the RSDP in an ACPI table blob. + + endmenu diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug index 835c559..483dcce 100644 --- a/arch/arm64/Kconfig.debug +++ b/arch/arm64/Kconfig.debug @@ -23,4 +23,15 @@ config PID_IN_CONTEXTIDR instructions during context switch. Say Y here only if you are planning to use hardware trace tools with this kernel.
+config ACPI_USE_CHOSEN_NODE + bool "Pass ACPI blob address through /chosen node" + depends on ARM || ARM64 + help + Enabling this allows one to experiment with ACPI tables during + development on non-UEFI systems. If this is enabled, ACPI will + expect to find /chosen/linux,acpi-start in an FDT passed into + the kernel and use the contents of that node as the physical + address of the RSDP in an ACPI table blob. + + endmenu diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 0912066..a9b5b11 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -251,13 +251,15 @@ static int __init setup_acpi_rsdp(char *arg) early_param("acpi_rsdp", setup_acpi_rsdp); #endif
-#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) +#ifdef CONFIG_ACPI_USE_CHOSEN_NODE #include <asm/acpi.h> #include <acpi/actbl.h>
void acpi_find_arm_root_pointer(acpi_physical_address *pa) { - /* BOZO: temporarily clunky. + /* This function is for development use only, or in extreme + * cases where UEFI is not yet available for the platform. + * * What we do is, while using u-boot still, is use the values * that have already been retrieved from the FDT node * (/chosen/linux,acpi-start and /chosen/linux,acpi-len) which @@ -307,7 +309,7 @@ void acpi_find_arm_root_pointer(acpi_physical_address *pa)
return; } -#endif +#endif /* CONFIG_ACPI_USE_CHOSEN_NODE */
acpi_physical_address __init acpi_os_get_root_pointer(void) { @@ -329,7 +331,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void) } else { acpi_physical_address pa = 0;
-#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) +#ifdef CONFIG_ACPI_USE_CHOSEN_NODE acpi_find_arm_root_pointer(&pa); #else acpi_find_root_pointer(&pa);