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: 77071 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp84701qgf; Tue, 27 Sep 2016 14:00:16 -0700 (PDT) X-Received: by 10.67.7.170 with SMTP id dd10mr51606267pad.152.1475010016068; Tue, 27 Sep 2016 14:00:16 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yi8si4317387pac.65.2016.09.27.14.00.15; Tue, 27 Sep 2016 14:00:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964950AbcI0U77 (ORCPT + 2 others); Tue, 27 Sep 2016 16:59:59 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:33032 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935925AbcI0U7t (ORCPT ); Tue, 27 Sep 2016 16:59:49 -0400 Received: by mail-lf0-f49.google.com with SMTP id b71so35390094lfg.0 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=fa72VDC+2h8UhKZlkkYto43embSLyiYgBwUyyn9o+jFCjnCwWMBqcrJUcTQV0sGmMa sMjhbfrs8/Exhys+WsqNeprJ020Z/E2BB4WxGJgt5cFDOUYYFqGpcG61vhAxMIDeamin Zx6a4HwI7uS2PovKh3FpNeua1hbEb0MXHnNnk9qzBASGDrNr1XhFxPJX3Fyt97MmPKt7 nymylrye897xf6F8iVS26yuKNpmENjk84/SAi09Vf2zjLtYeMPzyvamvXYZL/4zhbAKj PyFbutA0IgkMe/ovVcxrBYLc4KFiNJjJLVVSeCG+rizIuCsy0wpEgCnZqz9cx+z4UImv Y5iw== X-Gm-Message-State: AE9vXwMGwBFiwzOXsItigXTHpj7NNu2zWsgSEWtp/J/EHuRYpvO3wNGPeImWTtvVYKYN7g3b 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-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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(-) -- 2.10.0 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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