From patchwork Thu Mar 31 13:40:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 8713411 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2D8D39F39A for ; Thu, 31 Mar 2016 13:46:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6301B20221 for ; Thu, 31 Mar 2016 13:46:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A88D202B8 for ; Thu, 31 Mar 2016 13:46:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757240AbcCaNp6 (ORCPT ); Thu, 31 Mar 2016 09:45:58 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:35957 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756917AbcCaNnK (ORCPT ); Thu, 31 Mar 2016 09:43:10 -0400 Received: by mail-lb0-f176.google.com with SMTP id qe11so52750696lbc.3 for ; Thu, 31 Mar 2016 06:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7xZoOoNcEx4y7v1ia4xPtXCkRPZCpLL3hXB0l2rnR00=; b=kwJDAmcnrudQl39gC4MJxYcV1QHKU0FylGZyyG24QcCtTbIUGo83KYqNgdbB4mEcP9 9Dvv155DuzdMoSmZOTUqfVQyLHO8B8DclOYPFdIDU//k0toGtSJsPOryQGYMC93X7YdN JkvnDDHCNMtn0dS1ycEwgaJnc64RPMoiwPSM0= 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=7xZoOoNcEx4y7v1ia4xPtXCkRPZCpLL3hXB0l2rnR00=; b=RDaw/js/B+bs0zJByzwETucQUbvU4bV7PwrXwM1+Bb17x4Ik19ZFHD9d++n0W7PZ27 0wrbbbgjAP45P6645ZqoJEQnBmLtxGU+xGv3N7xlP7W0PMwmTkZX4g4Xeqq3ppr4kGf1 VLl8fvK21t7lhyfQ+z1NAxqEsegzkpLfDXsyRx8aOd9f4uZJjdJvqavrcInM/dxjawEe Oz6TzsavV/hIl7AQ6VReeRtQJ3m/rNEfHhxqZmeTX+S7pwZUFWl+25YjX9x8WscdKuR6 40fViiD98t33iffQYUv7/NqNJyFcmLhZDbk+aX7cDx0BC/JmQBBKrW5mdUqPFE+DeRxq eK2w== X-Gm-Message-State: AD7BkJIXjMdtiR9Xz6vh4iC61XUW3zxVxC0bSZe2V0nag5gZXLPDJPgaFfDjCcyt7bvuFvK6 X-Received: by 10.112.38.104 with SMTP id f8mr415974lbk.115.1459431789096; Thu, 31 Mar 2016 06:43:09 -0700 (PDT) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id mi9sm1285984lbc.27.2016.03.31.06.43.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 06:43:08 -0700 (PDT) From: Aleksey Makarov To: Russell King , Greg Kroah-Hartman Cc: linux-serial@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aleksey Makarov , "Rafael J . Wysocki" , Len Brown , Leif Lindholm , Graeme Gregory , Al Stone , Christopher Covington , Yury Norov , Peter Hurley , Andy Shevchenko , "Zheng, Lv" , Catalin Marinas , Will Deacon Subject: [PATCH v7 4/5] ARM64: ACPI: enable ACPI_SPCR_TABLE Date: Thu, 31 Mar 2016 16:40:26 +0300 Message-Id: <1459431629-27934-5-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1459431629-27934-1-git-send-email-aleksey.makarov@linaro.org> References: <1459431629-27934-1-git-send-email-aleksey.makarov@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 SBBR mentions SPCR as a mandatory ACPI table. So enable it for ARM64 Earlycon should be set up as early as possible. ACPI boot tables are mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that is called from setup_arch() and that's where we parse SPCR. So it has to be opted-in per-arch. When ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the DT/ACPI decision is done. Initialize DT earlycon if ACPI is disabled. Signed-off-by: Aleksey Makarov --- arch/arm64/Kconfig | 1 + arch/arm64/kernel/acpi.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 07b6a16..c77b4b2 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -3,6 +3,7 @@ config ARM64 select ACPI_CCA_REQUIRED if ACPI select ACPI_GENERIC_GSI if ACPI select ACPI_REDUCED_HARDWARE_ONLY if ACPI + select ACPI_SPCR_TABLE if ACPI select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE select ARCH_HAS_ELF_RANDOMIZE diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index d1ce8e2..f331ebb 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -189,7 +190,7 @@ void __init acpi_boot_table_init(void) */ if (param_acpi_off || (!param_acpi_force && of_scan_flat_dt(dt_scan_depth1_nodes, NULL))) - return; + goto done; /* * ACPI is disabled at this point. Enable it in order to parse @@ -209,6 +210,14 @@ void __init acpi_boot_table_init(void) if (!param_acpi_force) disable_acpi(); } + +done: + if (acpi_disabled) { + if (earlycon_init_is_deferred) + early_init_dt_scan_chosen_stdout(); + } else { + parse_spcr(earlycon_init_is_deferred); + } } #ifdef CONFIG_ACPI_APEI