From patchwork Mon Aug 4 15:28:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 4671181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A6FD99F375 for ; Mon, 4 Aug 2014 15:34:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3BB42012F for ; Mon, 4 Aug 2014 15:34:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DB83320127 for ; Mon, 4 Aug 2014 15:34:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEKFm-0003kp-15; Mon, 04 Aug 2014 15:32:50 +0000 Received: from mail-pd0-f171.google.com ([209.85.192.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEKEu-0001kp-Ge for linux-arm-kernel@lists.infradead.org; Mon, 04 Aug 2014 15:31:57 +0000 Received: by mail-pd0-f171.google.com with SMTP id z10so9812574pdj.16 for ; Mon, 04 Aug 2014 08:31:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=J57F+9Fqqq70zbqzT/KGT+nOJfoN3I4U9VLG2v3A1RE=; b=Q1g8Jne+upd56Zvl5pNEbrO2kmTe1yuX7skJTMABUNBQz6iDO46wNA3cMe6oekQ8zu 0bewikoWPCbJwDnE+kQEZlHIXfnIpxssC3A8f/dp7UalXYYblxPxJ9Qpc1nU8MQaDd7g l4GDpZm2PnyaBZ22jH+YRWJZ93GGYFdey85qZfJPxlsj1gxI3PlnIIBaq5UKA8agmIyC pO/VmrrrG/wwPMnZt0mBqbj31/VQhgh3CLqOsXrWg3D1QDYozOHwQXLR3c5gr+LslQKi 8/od32Wfd+1b93IEMuRjjIzD7/Y0OsKui2bxOtd+GEEWdhWqMdp5+hcpjTDWO9ZWqUgx tUdw== X-Gm-Message-State: ALoCoQn9ZGJU5vjmtF7LryBKviBnf80YYqBN34ZxVSdmKztxfLMOAwtELsPc1Bj8/W04VGyOYKHy X-Received: by 10.66.219.104 with SMTP id pn8mr3002639pac.133.1407166295299; Mon, 04 Aug 2014 08:31:35 -0700 (PDT) Received: from localhost ([39.182.20.233]) by mx.google.com with ESMTPSA id os4sm27215762pdb.67.2014.08.04.08.31.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Aug 2014 08:31:34 -0700 (PDT) From: Hanjun Guo To: Catalin Marinas , "Rafael J. Wysocki" , Mark Rutland Subject: [PATCH v2 15/18] ARM64 / ACPI: Introduce early_param for "acpi" and set ACPI default off Date: Mon, 4 Aug 2014 23:28:22 +0800 Message-Id: <1407166105-17675-16-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1407166105-17675-1-git-send-email-hanjun.guo@linaro.org> References: <1407166105-17675-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140804_083156_574420_97582F68 X-CRM114-Status: GOOD ( 16.78 ) X-Spam-Score: -1.4 (-) Cc: linaro-acpi@lists.linaro.org, Liviu Dudau , Lv Zheng , Rob Herring , Lorenzo Pieralisi , Al Stone , Daniel Lezcano , Robert Moore , linux-acpi@vger.kernel.org, Grant Likely , Charles.Garcia-Tobin@arm.com, Robert Richter , Jason Cooper , Arnd Bergmann , Marc Zyngier , Will Deacon , Mark Brown , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, Graeme Gregory , Randy Dunlap , linux-kernel@vger.kernel.org, Hanjun Guo , Sudeep Holla , Olof Johansson X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Al Stone Introduce one early parameters "on" for "acpi" to enable ACPI on ARM64. Disable ACPI before early parameters parsed, and enable it to pass "acpi=on" if people want use ACPI on ARM64. Signed-off-by: Al Stone Signed-off-by: Graeme Gregory Signed-off-by: Hanjun Guo --- Documentation/kernel-parameters.txt | 5 +++-- arch/arm64/include/asm/acpi.h | 9 +++++++++ arch/arm64/kernel/acpi.c | 17 +++++++++++++++++ arch/arm64/kernel/setup.c | 3 +++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index b7fa2f5..1f63156 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -165,9 +165,9 @@ multipliers 'Kilo', 'Mega', and 'Giga', equalling 2^10, 2^20, and 2^30 bytes respectively. Such letter suffixes can also be entirely omitted. - acpi= [HW,ACPI,X86] + acpi= [HW,ACPI,X86,ARM] Advanced Configuration and Power Interface - Format: { force | off | strict | noirq | rsdt } + Format: { force | off | strict | noirq | rsdt | on} force -- enable ACPI if default was off off -- disable ACPI if default was on noirq -- do not use ACPI for IRQ routing @@ -175,6 +175,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. strictly ACPI specification compliant. rsdt -- prefer RSDT over (default) XSDT copy_dsdt -- copy DSDT to memory + "acpi=on" is ONLY available for ARM64. See also Documentation/power/runtime_pm.txt, pci=noacpi diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 009303d..0f2c51a 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -61,6 +61,13 @@ static inline void disable_acpi(void) acpi_noirq = 1; } +static inline void enable_acpi(void) +{ + acpi_disabled = 0; + acpi_pci_disabled = 0; + acpi_noirq = 0; +} + u32 pack_mpidr_into_32_bits(u64 mpidr); /* @@ -99,6 +106,8 @@ static inline void arch_fix_phys_package_id(int num, u32 slot) { } extern int (*acpi_suspend_lowlevel)(void); #define acpi_wakeup_address 0 +#else +static inline void disable_acpi(void) {} #endif /* CONFIG_ACPI */ #endif /*_ASM_ACPI_H*/ diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index 988fea2..585d08c 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -361,3 +361,20 @@ u32 pack_mpidr_into_32_bits(u64 mpidr) * TBD when ARM/ARM64 starts to support suspend... */ int (*acpi_suspend_lowlevel)(void) = NULL; + +static int __init parse_acpi(char *arg) +{ + if (!arg) + return -EINVAL; + + /* "acpi=on" enables both ACPI table parsing and interpreter */ + if (strcmp(arg, "on") == 0) { + enable_acpi(); + } else { + /* Core will printk when we return error */ + return -EINVAL; + } + + return 0; +} +early_param("acpi", parse_acpi); diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index dfc4e4f3..056e2e1 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -59,6 +59,7 @@ #include #include #include +#include unsigned int processor_id; EXPORT_SYMBOL(processor_id); @@ -380,6 +381,8 @@ void __init setup_arch(char **cmdline_p) *cmdline_p = boot_command_line; early_ioremap_init(); + + disable_acpi(); parse_early_param();