From patchwork Fri May 20 13:03:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 9129449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7637560467 for ; Fri, 20 May 2016 13:06:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6931027BF1 for ; Fri, 20 May 2016 13:06:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E08027BFE; Fri, 20 May 2016 13:06:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A0FF27BF1 for ; Fri, 20 May 2016 13:06:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932701AbcETNGK (ORCPT ); Fri, 20 May 2016 09:06:10 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:32794 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756027AbcETNFJ (ORCPT ); Fri, 20 May 2016 09:05:09 -0400 Received: by mail-lb0-f169.google.com with SMTP id k7so14344613lbm.0 for ; Fri, 20 May 2016 06:05:08 -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=bccinytf//mcrOTUatZcohgfFVa60n1Gt3iatch3M9I=; b=BNhrJIj1+oblOpnaBd7CYIV9P/IfPXysMJnB4xammdRsOH/wZ4GOVrO+YbyOGwvJAL LzQnBE6sUl5YaiVyRLwcgizUbnXVyIK9L8RQqN2onpe8fIuoAMg/Iaa6H8B/f7196386 GDbl4BwZYzFN6mcTWXUYXo1eUNYDGr3+mOPO0= 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=bccinytf//mcrOTUatZcohgfFVa60n1Gt3iatch3M9I=; b=hI1SB6x6EQmekyIXMA3fdEwmySpWYlKzFi6RVgLhCzSwJ8sYQXU9QCrAovCvqlKmkr SaBg5SDK+Bd7nZwRrnyab/flk8atAK7RckzOc3s9WpRuaXokBUA/vZtsSnFnPhfWt2Hb A3SPGqKLIQgPezTw4ypKqpdjPeIlWKC2JyFo5CHseIO7+0ukKp66HQmo7PJKD5FDZ6sz T7VpWPWrZgaWVkoObd6+mzEKPzoMRq6xb5fQd4K77e0RVakczIdK9Cu4/LmRwWNOMWWK 8tBaxQgK0yl2+65X9DW+uzyIAiXtbywTzBHiFhSUGIugHxra/nyb16Mbk8/4Nq491MFk d6mw== X-Gm-Message-State: AOPr4FUfoZBScqkuAmlUVjhuLqICF+Uc5wSLBDYSeDpqE6lvrdcT6oU5lN7IV08FPE6TpCG0 X-Received: by 10.112.137.137 with SMTP id qi9mr1097754lbb.36.1463749506822; Fri, 20 May 2016 06:05:06 -0700 (PDT) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id i3sm3334100lbd.44.2016.05.20.06.05.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 May 2016 06:05:06 -0700 (PDT) From: Aleksey Makarov To: "Rafael J . Wysocki" , 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 , Russell King , Len Brown , Leif Lindholm , Graeme Gregory , Al Stone , Christopher Covington , Yury Norov , Peter Hurley , Andy Shevchenko , "Zheng, Lv" , Mark Salter , Kefeng Wang , Catalin Marinas , Will Deacon Subject: [PATCH v8 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE Date: Fri, 20 May 2016 16:03:22 +0300 Message-Id: <1463749405-11640-4-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1463749405-11640-1-git-send-email-aleksey.makarov@linaro.org> References: <1463749405-11640-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-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 Tested-by: Kefeng Wang --- 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 5d30abf..80c0816 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -4,6 +4,7 @@ config ARM64 select ACPI_GENERIC_GSI if ACPI select ACPI_PCI_HOST_GENERIC 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 3e4f1a4..252a6d9 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -206,7 +207,7 @@ void __init acpi_boot_table_init(void) if (param_acpi_off || (!param_acpi_on && !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 @@ -226,6 +227,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