From patchwork Mon Sep 5 12:36: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: 75382 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp53856qgf; Mon, 5 Sep 2016 05:39:47 -0700 (PDT) X-Received: by 10.66.182.167 with SMTP id ef7mr25970001pac.128.1473079187350; Mon, 05 Sep 2016 05:39:47 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id os6si29167118pac.42.2016.09.05.05.39.47; Mon, 05 Sep 2016 05:39:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 S1755594AbcIEMjp (ORCPT + 6 others); Mon, 5 Sep 2016 08:39:45 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:36284 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755614AbcIEMjl (ORCPT ); Mon, 5 Sep 2016 08:39:41 -0400 Received: by mail-lf0-f41.google.com with SMTP id g62so125864686lfe.3 for ; Mon, 05 Sep 2016 05:39:40 -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=+yCEd23GehNtkx4rI4nXy0Rvm/dkCA5aiXbTaHBM8Is=; b=FmyIX0DBQ222TEO/njOhByuM+UIMigTWytmMZ22fKVqsbXQerSF+5g3EiIhp2fkZY3 GDqyJ7WOAsEKEsAcxyYAMqv6eUztgb58O9RgYP64m+STvsMwrtE/VaZV1/kxP69dsJ/W V9rWJ7bi/xroePP4WRhujxo+gs7kCaBQyLBFw= 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=+yCEd23GehNtkx4rI4nXy0Rvm/dkCA5aiXbTaHBM8Is=; b=ZXkJDoFDIBn1QYwQEjViNxVmawnlwHiWUgG+8XABXJ+zscb9oy1ktNyzU/gI02Jd7Q 3RT4m/4wr52exPchNFuRt934VTMUdatsO/IlWUz0D02NLrtD18wSQgB7basn0XRtuId9 aJ0h1gPboQ1aF3ieSaV+eXrxNUFqPKXL1dmii0ufW6j+sIhCAzxs+ppYFI3s2L7drtjN sggd+4Gq/zF6d+lz/OBgQQHaFwV8iIJN9fVgnucFfZaOZc3qZf15yPXW0tV/Nhn4EQfS OeNIrmSmObAgbMC4lHoY47BUXvWrbUoahoweSjrf32BzWUrBgTMuvUe1M050OwcZpTIH aFRw== X-Gm-Message-State: AE9vXwPj2WGMiHf/O45OmsJBQizVbix4IFVGZ+XvBz6bZ3d0OTwRyoh7pEVjLNcCmlO45nhf X-Received: by 10.25.83.85 with SMTP id h82mr8641347lfb.97.1473079179445; Mon, 05 Sep 2016 05:39:39 -0700 (PDT) Received: from localhost.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id v82sm3134160lfi.30.2016.09.05.05.39.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Sep 2016 05:39:38 -0700 (PDT) From: Aleksey Makarov To: "Rafael J . Wysocki" 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 , Greg Kroah-Hartman , 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 v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE Date: Mon, 5 Sep 2016 15:36:14 +0300 Message-Id: <20160905123617.18775-4-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160905123617.18775-1-aleksey.makarov@linaro.org> References: <20160905123617.18775-1-aleksey.makarov@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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 Tested-by: Christopher Covington --- arch/arm64/Kconfig | 1 + arch/arm64/kernel/acpi.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Hanjun Guo 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