Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1680595

[PATCH v2 2/2] ACPI: SPCR: Workaround for APM X-Gene 8250 UART 32-alignment errata

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Loc Ho <lho@apm.com>
Newsgroups linux.kernel
Subject [PATCH v2 2/2] ACPI: SPCR: Workaround for APM X-Gene 8250 UART 32-alignment errata
Date Mon, 03 Jul 2017 23:40:01 +0200
Message-ID <tZhex-7h6-3@gated-at.bofh.it> (permalink)
References <tZhex-7h6-5@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6uJMrC4LeJkgn1C8Q5zRnvP+Q3Yl5D0gpjZwjGutrh8=; b=LK94OCO0vLtl8d3Wk54hy+pJLRT9vyaFFAMcZAliUpGmfsI6ohrh7WqLMRD4JVLTqW L0M/sKPxC6HpyFk6TwRdwGxOzUqoZJlOL/9qCSqjBYnjqbSPdzYD6j3qF0PLk4Mz53Qc fXBQ+oVeJos4Dw6xq0VkE5RxB3dkynU//89ko=
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=6uJMrC4LeJkgn1C8Q5zRnvP+Q3Yl5D0gpjZwjGutrh8=; b=Kszm3FdHMcKf3CIk6n7+y6bMVR3onkQP2iDOVhVzycvbuRr0QIq4aoktJd/NiRBtzZ kcSI4gfaPiX3nU0xO8mvo/OcL7wT78Fh2Z/pkF1muNfjhUSGB5MoA0jbzhXDoymNtkNo N2VZ3iso9hop7QFIKjNLBD3DRbPtm+ITzqLp77k9xDTxmbxXWu6WAuPcd/7XfCwTI2XR 9iTFVmduGLHnu3tLvONBV5jvPcIGlVcHLnAzUzo1JEkfkO9EiQGtDkNm2EIDEzo0CJQj Ft1HyY3AZXgjsc1EV1Z+SurBdSBe9aaS3T6y3tJwyJPKuOVl3L3o1b4lyMMv8gVu33Bs ZCqg==
X-Gm-Message-State AIVw113+ZG38VbMzk19wXpsSZCbIVE0pUWeivkIAlG9TBFYiAm2cFopd hvW72YBjmOgKv7D0
X-Received by 10.84.231.139 with SMTP id g11mr12347168plk.71.1499117594202; Mon, 03 Jul 2017 14:33:14 -0700 (PDT)
X-Mailer git-send-email 1.8.3.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 54
Organization linux.* mail to news gateway
X-Original-Cc jcm@redhat.com, rjw@rjwysocki.net, lenb@kernel.org, robert.moore@intel.com, lv.zheng@intel.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, devel@acpica.org, bcm-kernel-feedback-list@broadcom.com, aleksey.makarov@linaro.org, gregkh@linuxfoundation.org, patches@apm.com, Loc Ho <lho@apm.com>
X-Original-Date Mon, 3 Jul 2017 14:33:09 -0700
X-Original-Message-ID <1499117589-4829-3-git-send-email-lho@apm.com>
X-Original-References <1499117589-4829-1-git-send-email-lho@apm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1680595

Show key headers only | View raw


APM X-Gene verion 1 and 2 have an 8250 UART with its register
aligned to 32-bit. In addition, the latest released BIOS
encodes the access field as 8-bit access instead 32-bit access.
This causes no console with ACPI boot as the console
will not match X-Gene UART port due to the lack of mmio32
option.

Signed-off-by: Loc Ho <lho@apm.com>
---
 drivers/acpi/spcr.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
index 2905063..4ac3e06 100644
--- a/drivers/acpi/spcr.c
+++ b/drivers/acpi/spcr.c
@@ -36,6 +36,26 @@ static bool qdf2400_erratum_44_present(struct acpi_table_header *h)
 	return false;
 }
 
+/*
+ * APM X-Gene v1 and v2 UART hardware is an 16550 like device but has its
+ * register aligned to 32-bit. In addition, the BIOS also encoded the
+ * access width to be 8 bits. This function detects this errata condition.
+ */
+static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb)
+{
+	if (tb->interface_type != ACPI_DBG2_16550_COMPATIBLE)
+		return false;
+
+	if (memcmp(tb->header.oem_id, "APMC0D", ACPI_OEM_ID_SIZE))
+		return false;
+
+	if (!memcmp(tb->header.oem_table_id, "XGENESPC",
+	    ACPI_OEM_TABLE_ID_SIZE) && tb->header.oem_revision == 0)
+		return true;
+
+	return false;
+}
+
 /**
  * parse_spcr() - parse ACPI SPCR table and add preferred console
  *
@@ -129,6 +149,8 @@ int __init parse_spcr(bool earlycon)
 
 	if (qdf2400_erratum_44_present(&table->header))
 		uart = "qdf2400_e44";
+	if (xgene_8250_erratum_present(table))
+		iotype = "mmio32";
 
 	snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
 		 table->serial_port.address, baud_rate);
-- 
1.8.3.1

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 2/2] ACPI: SPCR: Workaround for APM X-Gene 8250 UART 32-alignment errata Loc Ho <lho@apm.com> - 2017-07-03 23:40 +0200
  Re: [PATCH v2 2/2] ACPI: SPCR: Workaround for APM X-Gene 8250 UART  32-alignment errata "Rafael J. Wysocki" <rafael@kernel.org> - 2017-07-03 23:50 +0200

csiph-web