Received: by 10.213.65.68 with SMTP id h4csp1261849imn; Wed, 14 Mar 2018 14:47:24 -0700 (PDT) X-Google-Smtp-Source: AG47ELv5qdF3R35Bjk6tx6M+5GyPwhgAcs5vIZHpSSKMtUVKejxK2y2mXWt794ujAohBRAxR9F/5 X-Received: by 10.101.100.144 with SMTP id e16mr5022589pgv.315.1521064044686; Wed, 14 Mar 2018 14:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521064044; cv=none; d=google.com; s=arc-20160816; b=S3Cfcshff3t+rmlkz7xVsNIQgBnpF8HvngNcEhQ6gLbBrfvqG9tBCP/rWLA1rQnUN9 m2++D1KA4JeasGSB2u6oUuYYSZoaoZFxWZBoYQoOnoGrGe8PHBBac3nvqrzFOQx2twiE YYQaz6jwTF1LlH6VNZ/AXD0PwtPEYfO2kYJE120H9pxsRCeaGjFbn5mP8jOC6FTZHk4H yE41oGcSnb8mWUZtfwSNn4j6lZUz29zXhTBfMbJiI124X8rvVg0XNeDqlBmbmPLpVvfP Auv7DT+fbZKfUzrNprbA8ohxoVDU/yN5GHz6RyQN/uTIoeHUCQPMpAwCZiUMvcMdznFV zEWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Tdtjq/qkd4bjtfRl96x5sol1oqCrkwUTzGSG+0MBqWA=; b=amlVsWbnxxKT31MSu1x3+2va/G2sqdXQWwH3SbxrNA8/ZXTOfYM5rVNi6CoLzwwO3I ZUvDhGRjFxvuimp8zmbDCGNwuyZBkNrAFIf75fYc3g8zOG795JDx4pLj93ZGZiLBAAo5 j8vq1dG7K7sK2iXmRMLCDXnjyXL631NJw9P7jsIvD86wkxbMu5oUSAMX8bZgGIluZgym EC6Bo9TeQA/sB0qI9c8D7KXuf3QtQvx/DyTNK3uk23tnaYqxDgs2nRSYX7A4oLKrBYlm Gj8hUsSNZAvLtrvBxzvWIzmkWBFyiLttZtpY04n/hEtCpEMPgk2lxH/+/lLP9zTacZSh UNKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=i3jrIxI+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x11-v6si2576673pll.681.2018.03.14.14.47.10; Wed, 14 Mar 2018 14:47:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=i3jrIxI+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752163AbeCNVpm (ORCPT + 99 others); Wed, 14 Mar 2018 17:45:42 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:45618 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751719AbeCNVoz (ORCPT ); Wed, 14 Mar 2018 17:44:55 -0400 Received: by mail-oi0-f66.google.com with SMTP id j79so3983545oib.12 for ; Wed, 14 Mar 2018 14:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Tdtjq/qkd4bjtfRl96x5sol1oqCrkwUTzGSG+0MBqWA=; b=i3jrIxI+/AhH9N18yM39JycnnfKCywDFnj5AJ1SEgn2aNEDJng0ZZ2yWkE7doGXfb8 +XC9xgYKZksjs9DktcbB8awHLJrS9eL6hKrf9dqe9QY3iHnPl0w0sKszlMljjecF7VX4 wHc1upU+0FOmIq6Fra0OuPngdI6JeSlHfVEzE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Tdtjq/qkd4bjtfRl96x5sol1oqCrkwUTzGSG+0MBqWA=; b=Py0UcvNglyV6B1whDgkNibimME9JrLzdq8b1o5JC6adH2wBjvqsYYGbOhsrZBFfsLq xJEpEJtWKRmSDLjJtVp8JQPVApD57DBoMhYX4FUraQsZf1JaC9lnFNETCQi2oB/Sf2fk QCb722Ssc0rRdxaqkK467xybTpQJIvbDss0uuevWos+uZ2ZxaC2uBbF+DEOJes2X9TQL /i5LidaXqG7veyNpqJwK1uqwFVccqP/0PBRnWaQiRSU4yxLKzChoKee9j/Gq1RPIoR9J yRcEdrt1Mv9MoZ9XYascxKHA/0NTnUFqjitkUBhI6unvhXJnPVBXAyP/Gfd4EbkWNKjq HSdQ== X-Gm-Message-State: AElRT7GClUefScouyADDLkpDWFBdSdxo+Cvh5vfsKUAd+xlLiDtgVwhs +iaBPfWyu6vnIfuqLZ8nKtoR7Q== X-Received: by 10.202.86.199 with SMTP id k190mr3860117oib.87.1521063894776; Wed, 14 Mar 2018 14:44:54 -0700 (PDT) Received: from djkurtz2.bld.corp.google.com ([2620:15c:183:0:1cfd:61a5:7215:5f9c]) by smtp.gmail.com with ESMTPSA id p200sm1974922oic.0.2018.03.14.14.44.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 14:44:54 -0700 (PDT) From: Daniel Kurtz To: Greg Kroah-Hartman Cc: adurbin@chromium.org, linux-kernel@vger.kernel.org, Daniel Kurtz , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org (open list:ACPI) Subject: [PATCH v2 2/3] ACPI: SPCR: Add support for AMD CT/SZ Date: Wed, 14 Mar 2018 15:44:37 -0600 Message-Id: <20180314214439.27806-3-djkurtz@chromium.org> X-Mailer: git-send-email 2.16.2.804.g6dcf76e118-goog In-Reply-To: <20180314214439.27806-1-djkurtz@chromium.org> References: <20180314214439.27806-1-djkurtz@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org AMD Carrizo / Stoneyridge use a DesignWare 8250 UART that uses a special earlycon setup handler to configure its input clock in order to compute baud rate divisor registers. Detect them by examining the OEMID field in the SPCR header, and pass then pass uart type amdcz to earlycon. Signed-off-by: Daniel Kurtz Reviewed-by: Andy Shevchenko --- drivers/acpi/spcr.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index 9d52743080a4..52d840d0e05b 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c @@ -73,6 +73,24 @@ static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb) return xgene_8250; } +/* + * AMD Carrizo / Stoneyridge use a DesignWare 8250 UART that uses a special + * earlycon setup handler to configure its input clock in order to compute + * baud rate divisor registers. + * Detect them by examining the OEM fields in the SPCR header. + */ +static bool amdcz_present(struct acpi_table_spcr *tb) +{ + if (memcmp(tb->header.oem_id, "AMDCZ ", ACPI_OEM_ID_SIZE)) + return false; + + if (memcmp(tb->header.oem_table_id, "AMDCZ ", + ACPI_OEM_TABLE_ID_SIZE)) + return false; + + return true; +} + /** * acpi_parse_spcr() - parse ACPI SPCR table and add preferred console * @@ -189,6 +207,11 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) uart = "qdf2400_e44"; } + if (amdcz_present(table)) { + if (enable_earlycon) + uart = "amdcz"; + } + if (xgene_8250_erratum_present(table)) { iotype = "mmio32"; -- 2.16.2.804.g6dcf76e118-goog