From patchwork Tue Sep 27 20:54:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 9352923 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 981206077A for ; Tue, 27 Sep 2016 21:00:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85F79291EF for ; Tue, 27 Sep 2016 21:00:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7656429200; Tue, 27 Sep 2016 21:00:06 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 078D9291EF for ; Tue, 27 Sep 2016 21:00:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964963AbcI0VAA (ORCPT ); Tue, 27 Sep 2016 17:00:00 -0400 Received: from mail-lf0-f42.google.com ([209.85.215.42]:35533 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935946AbcI0U7t (ORCPT ); Tue, 27 Sep 2016 16:59:49 -0400 Received: by mail-lf0-f42.google.com with SMTP id l131so34790717lfl.2 for ; Tue, 27 Sep 2016 13:59:48 -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=y3N0BWarAnh4/8Ky9lhlJt3ErZJvkltDx0iXatmjsY4=; b=e6brZB5rFPAj+KLUuvJeRNmVLt7b+RUyyh1lj//YGhcDWLf8UTAZoP3nwCJ2JRGR4O F/+iUaeqehvRnUTCwguIHRaNwHkJCZ6T/6N95pNjbGOx7aEldQ+3i9llr9Q/HxvBTgzC FnMr4nj1WYak+VyRO78zjUlVdxejV6/VcRvF8= 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=y3N0BWarAnh4/8Ky9lhlJt3ErZJvkltDx0iXatmjsY4=; b=N8YYux+BqgZkp2EVa+p/NWMVvq9gUirT40fgdZSk5Mf6aEM+AxooNu9Hj+N99tbu8t pHfLAtTJk1VKu1DZ+nc2wnRN5kenwWPVwTa7stTRTbar8zE6Xqn3ONiTCAAuTWZsZrz5 +naJ4ZGFn/ctCD/kZZAWW2b3UyVE485xUYJFEHDBQm0FMjxlteyahvqpO/faDKIZBid1 I8k4FFcnq8RTherhPdNLik9shDJoo2d3uFd+41MA8Ajz3fWIcAPdDREcUqfmMvbpqQ3H d5sfXrmp6HlGSfhZn5Ng+Iz0BXbYqGJfw1DEcQoHO3DZWQkaTjQCTvLQcmDD1hQHvwpp ZGaw== X-Gm-Message-State: AE9vXwPuLtRPY7GW2IFdZReERuvFmxH3pLcH/C2xSYUG4zB5Zu7G4OYjy9Gw9ehIrmsr+dmQ X-Received: by 10.25.127.7 with SMTP id a7mr10838383lfd.173.1475009987474; Tue, 27 Sep 2016 13:59:47 -0700 (PDT) Received: from localhost.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id b4sm693212lfg.41.2016.09.27.13.59.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Sep 2016 13:59:46 -0700 (PDT) From: Aleksey Makarov To: Greg Kroah-Hartman Cc: "Rafael J . Wysocki" , 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 v11 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE Date: Tue, 27 Sep 2016 23:54:14 +0300 Message-Id: <20160927205418.31529-3-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20160927205418.31529-1-aleksey.makarov@linaro.org> References: <20160927151953.GB4371@kroah.com> <20160927205418.31529-1-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. Acked-by: Will Deacon Acked-by: Hanjun Guo Signed-off-by: Aleksey Makarov Tested-by: Kefeng Wang Tested-by: Christopher Covington --- 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 bc3f00f..11a2d36 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -4,6 +4,7 @@ config ARM64 select ACPI_GENERIC_GSI if ACPI select ACPI_REDUCED_HARDWARE_ONLY if ACPI select ACPI_MCFG if ACPI + select ACPI_SPCR_TABLE if ACPI select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 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