From patchwork Thu Apr 13 13:55:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 9679459 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 778BA60381 for ; Thu, 13 Apr 2017 13:55:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6964628615 for ; Thu, 13 Apr 2017 13:55:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E7C228664; Thu, 13 Apr 2017 13:55:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6860328615 for ; Thu, 13 Apr 2017 13:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=G7Y0Mx0gdVlxe2wnon2MhbUkvoXSVIfaGWCh1yjKx6A=; b=gt00e9gmAs7r1Y 3xxbSxbOp+ABi2midgth9Td8orAcyDS4cLeCQl1iT0iRY4mMPmf3EgSUpaLUC94A0VRCCyw1Eqt/R IDBy9rtGnTjn9n34mXOWL5hvNf4EshETj0kb+xX4eiBIwGYOtnaMUth6Cw3YbJ7G0FCc0fLLevVNR +FKGvXfNusPVBajVAcj6DDL1ph1h1yY9AT0djCz40ZQFCE0rk9JSrvJ++i1APDM1GJI3sBcoZrl5r ZX2t5dV7VjVRtxEu29Our22YabZ4VJJ1ZNuY7V4MdPXhXZ/wVeYVi+RR+wjd+zQr5KcqQCPsOaRmq Q6fnYglN0JQqqgCaxncQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cyfDl-00060f-US; Thu, 13 Apr 2017 13:55:37 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cyfDh-0005we-Fy for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2017 13:55:36 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E69A160D60; Thu, 13 Apr 2017 13:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1492091712; bh=Xlmto5DpRwDs5WJvL2mvp0Owo8Aanz24TVvqFPGzwDw=; h=From:To:Subject:Date:From; b=gRl38vjKKd5wdq7/dRA5v9CAjZ3bluqinFiaG41Ssk3NUb+ejEZN/UB3pPrBsY8ZH lu8K7YQctMAZz6Ze8Xo7nOd0WMV/JSz2rNZthqUGIBFzjH9+e7051St+GA5BqP+aG+ mDzflX4wQ7S4M9akZWLiD1MJkT8jfB9vZh+dkuUY= Received: from timur-ubuntu.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: timur@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id CDF2B60D61; Thu, 13 Apr 2017 13:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1492091712; bh=Xlmto5DpRwDs5WJvL2mvp0Owo8Aanz24TVvqFPGzwDw=; h=From:To:Subject:Date:From; b=gRl38vjKKd5wdq7/dRA5v9CAjZ3bluqinFiaG41Ssk3NUb+ejEZN/UB3pPrBsY8ZH lu8K7YQctMAZz6Ze8Xo7nOd0WMV/JSz2rNZthqUGIBFzjH9+e7051St+GA5BqP+aG+ mDzflX4wQ7S4M9akZWLiD1MJkT8jfB9vZh+dkuUY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org CDF2B60D61 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=timur@codeaurora.org From: Timur Tabi To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Shanker Donthineni , linux-arm-kernel@lists.infradead.org Subject: [PATCH] tty: pl011: use "qdf2400_e44" as the earlycon name for QDF2400 E44 Date: Thu, 13 Apr 2017 08:55:08 -0500 Message-Id: <1492091708-30593-1-git-send-email-timur@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170413_065534_663150_B19C05C1 X-CRM114-Status: GOOD ( 12.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Define a new early console name for Qualcomm Datacenter Technologies QDF2400 SOCs affected by erratum 44, instead of piggy-backing on "pl011". Previously, to enable traditional (non-SPCR) earlycon, the documentation said to specify "earlycon=pl011,
,qdf2400_e44", but the code was broken and this didn't actually work. So instead, the method for specifying the E44 work-around with traditional earlycon is "earlycon=qdf2400_e44,
". Both methods of earlycon are now enabled with the same function. Fixes: e53e597fd4c4 ("tty: pl011: fix earlycon work-around for QDF2400 erratum 44") Signed-off-by: Timur Tabi Tested-by: Shanker Donthineni --- drivers/tty/serial/amba-pl011.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 2783539..0875f7d 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2470,19 +2470,34 @@ static int __init pl011_early_console_setup(struct earlycon_device *device, if (!device->port.membase) return -ENODEV; - /* On QDF2400 SOCs affected by Erratum 44, the "qdf2400_e44" must - * also be specified, e.g. "earlycon=pl011,
,qdf2400_e44". - */ - if (!strcmp(device->options, "qdf2400_e44")) - device->con->write = qdf2400_e44_early_write; - else - device->con->write = pl011_early_write; + device->con->write = pl011_early_write; return 0; } OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup); OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup); -EARLYCON_DECLARE(qdf2400_e44, pl011_early_console_setup); + +/* + * On Qualcomm Datacenter Technologies QDF2400 SOCs affected by + * Erratum 44, traditional earlycon can be enabled by specifying + * "earlycon=qdf2400_e44,
". Any options are ignored. + * + * Alternatively, you can just specify "earlycon", and the early console + * will be enabled with the information from the SPCR table. In this + * case, the SPCR code will detect the need for the E44 work-around, + * and set the console name to "qdf2400_e44". + */ +static int __init +qdf2400_e44_early_console_setup(struct earlycon_device *device, + const char *opt) +{ + if (!device->port.membase) + return -ENODEV; + + device->con->write = qdf2400_e44_early_write; + return 0; +} +EARLYCON_DECLARE(qdf2400_e44, qdf2400_e44_early_console_setup); #else #define AMBA_CONSOLE NULL