Received: by 10.213.65.68 with SMTP id h4csp1366441imn; Wed, 14 Mar 2018 19:06:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELtq0w5OZs8Y3OViKLvVleaP3AOfexZ4QrfpilSdRhXOAfLSAx8WkMO/scasYUHP6MDjO46W X-Received: by 2002:a17:902:a610:: with SMTP id u16-v6mr6055258plq.293.1521079589257; Wed, 14 Mar 2018 19:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521079589; cv=none; d=google.com; s=arc-20160816; b=l4/7IEJNuMDnm7dqIfKHdTD3xueAD8i0SvVv9wf4g0ozDQRa3Pq2JMPFyv+Ket4NiV BE7M6dcr2sIQ+vKsmBqLK2EmEMoebP4LTuWvYbJbyV08b7BTH5d2AKnfdY6zjufMbtW1 +ooiWkDRsxwpS0OBGuRA10sxINZ5aeHO5rMKhwqKlBJaxS8XTRGP/8/tQ1EfAg+r/tOH jtPQLoIwYv/6GxbLVFVPPsEaOfQ35osv+7C944Pge50uXjXyRl8P+nMMkY500QkoV+fe v3wUfRvIRXTU5avKJPywQ0i6/5kOGumwC4mkueiWdkDvJXZhhZBMYwzKKl31gKRTtjOc IIsQ== 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=uDdZm8yuXcFomq9kTBbYweUNrIni6McZopibnPCFFeA=; b=wJn1+i2X9JrDcQLZFXuDuomKUqXCqhmDluLKdqoYbB+CUz+9KhtIuZqROt/MBpVoYx vxSUmNtHuw31f7JAczfDDUj7qmCcptpfCk4VeHrEnn4wlEOh+M6mF+03w5/4g0WiwOH/ i5OYsTSzncmVjBnatu8gM3P9rBg8quOPufLHcsHoBnzhBRmaheaZZdZIJxCgUY+M/dAb in9aOAo2iWRcougXr+zncJZsH9F/zVx7Bo6UYg4tnj/xXuDSLHV9E0KODsdqbr2kbKIf V7jcSbhRwSwR2NQ6nPUfuQaT4nYREfvzPLituh4tEsQyy4LswpxkchVc+PYLkfXl9GO4 5dMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hmylWZFp; 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 a33-v6si2974379pld.653.2018.03.14.19.06.14; Wed, 14 Mar 2018 19:06:29 -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=hmylWZFp; 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 S1751886AbeCOCE4 (ORCPT + 99 others); Wed, 14 Mar 2018 22:04:56 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:37688 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751731AbeCOCEw (ORCPT ); Wed, 14 Mar 2018 22:04:52 -0400 Received: by mail-ot0-f196.google.com with SMTP id t2-v6so5357943otj.4 for ; Wed, 14 Mar 2018 19:04:52 -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=uDdZm8yuXcFomq9kTBbYweUNrIni6McZopibnPCFFeA=; b=hmylWZFpQKAACzHZXAZLzvB/q2iuryOPjC6YI4Ap4wv/ASCBWHRlRyBqEwbe9T/Aj1 D+D1k5rpGXjgRaJj3QPsEvbAAdSU0yfs0X+tE+FhMOjFpzcq3qjH0LjUpes/LDtfdqtl 5dQj2fXqjDV/zj01oYv4XvGjq8S6ENn5OJR+U= 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=uDdZm8yuXcFomq9kTBbYweUNrIni6McZopibnPCFFeA=; b=d2ZyimKoKP4Aa1lr6M6rHocPBp/H80KczuUL7vWLyKo6VaLswRCZOdrK+t2XU8BgBb JW+frrTmG1pYR4atAitbQA6iDrj/M4yJFWEIf7jtDsiMmfr1GE+fwamws2cDvwB2i3uk 0SPCbFrHl6+/5ABo/ZOJ0M+WbkNM3e+VZsmS1Tz6GZ6IQZGA38BMko1I8itocP7Szqsw h5fosWMyuhQaUaa1DpotN0BhI3Hp90tEjWhi9dS+Skf0gShS75hLX0z4eTbc3CXFw7mx P963IZEdkW4KDmwAuqQoQWuYWafykiIM0jO/nB5rotzZMFNw4Xw6pQvrSR+VVci4SMoe FBcQ== X-Gm-Message-State: AElRT7FynZnnemC9eBbhaeHD5e5oxIydbESPzLvMISLd5BkxwI5j+nqP m3pS+S4QTC0isInh1XnNzaMJpQ== X-Received: by 10.157.22.131 with SMTP id c3mr4296754ote.268.1521079491904; Wed, 14 Mar 2018 19:04:51 -0700 (PDT) Received: from djkurtz2.bld.corp.google.com ([2620:15c:183:0:1cfd:61a5:7215:5f9c]) by smtp.gmail.com with ESMTPSA id j142sm1642773oih.7.2018.03.14.19.04.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 19:04:51 -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 v3 2/3] ACPI: SPCR: Add support for AMD CT/SZ Date: Wed, 14 Mar 2018 20:04:44 -0600 Message-Id: <20180315020445.150604-3-djkurtz@chromium.org> X-Mailer: git-send-email 2.16.2.804.g6dcf76e118-goog In-Reply-To: <20180315020445.150604-1-djkurtz@chromium.org> References: <20180315020445.150604-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 --- Changes since v1: * added Reviewed-by 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