From patchwork Thu Aug 11 15:31:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 73771 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp169484qga; Thu, 11 Aug 2016 08:34:20 -0700 (PDT) X-Received: by 10.66.43.234 with SMTP id z10mr18056961pal.137.1470929660197; Thu, 11 Aug 2016 08:34:20 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si3663757pas.217.2016.08.11.08.34.20; Thu, 11 Aug 2016 08:34:20 -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 S932629AbcHKPeM (ORCPT + 2 others); Thu, 11 Aug 2016 11:34:12 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:33266 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932508AbcHKPds (ORCPT ); Thu, 11 Aug 2016 11:33:48 -0400 Received: by mail-qk0-f181.google.com with SMTP id t7so8028264qkh.0 for ; Thu, 11 Aug 2016 08:33:47 -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=WXE8CifUqL7oMUEqrKhrEI3nABE21I7sTHR7NIIn8Js=; b=M3YpK65RtZ7qIt2ESV04fvqKQCJyc9BOWVJKdJToX0KQW3e09yeuk1OdafCQhjjt7x VAkwDL0mRm1S2iA089dWZjhKby2UAd2IbeBpCzVHrxLBHXgBP110gpebb+wgtylzbrXR 6DOcuzzt52dQXZPHlZrbahNBU9SmSPZ6CL6gc= 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=WXE8CifUqL7oMUEqrKhrEI3nABE21I7sTHR7NIIn8Js=; b=MqavLiJTc1Z2Oe0pw5+vLsKF7cGYIJ1mUWeucI4bN2KZx9p/OJ8MBA2aYttKrxnsvW nCDJQ8P02mBMI3t7GpYFP6OUcqjTxM71NroAPnB/r9FtEm+UcJT2Pr7eNKQZpI9Vo5MZ hSWppfZWsRtvU+NA2pPtAwIJvuyJ+jAm1baI9kOe1HrrXiCW4COihoejeWZCO+BMG+7N CJQMi8z0Qlbz29OC3maIPMV+h+eSTBNLu3wYdV0J4THcbOoiN0HxzPFdjitE36XDgSCg 9EMatoXg0lqxDO8Hr+x+ewt7sKDMt89wDO6NuXNYsCtKYQJkF5ncvDMpUjbr3XkjBoaz SrRA== X-Gm-Message-State: AEkooutF3fvcLqI2r6OVEDkZtyAqXGjwIhZmxRjCFwx/A5OW9swGDVuFy5LzUziHKtKpub13 X-Received: by 10.46.33.217 with SMTP id h86mr1750636lji.39.1470929627023; Thu, 11 Aug 2016 08:33:47 -0700 (PDT) Received: from localhost.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id 78sm192097lfv.39.2016.08.11.08.33.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 08:33:46 -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 v9 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE Date: Thu, 11 Aug 2016 18:31:40 +0300 Message-Id: <20160811153152.755-4-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160811153152.755-1-aleksey.makarov@linaro.org> References: <20160811153152.755-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. 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(-) -- 2.9.2 -- 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 69c8787..a54dfc0 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