From patchwork Tue Aug 15 17:21:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eugeniy Paltsev X-Patchwork-Id: 801693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lkka/Z8i"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xWzn50n0lz9t32 for ; Wed, 16 Aug 2017 03:22:17 +1000 (AEST) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=i8S/Rwdm3gMb3pDzyitpoWVYKktv7u1wpYqdsh6SuHg=; b=lkka/Z8imdMTF1 RBUvOp/9G7sOotrAqg/L6OGV/8x/m4uc9XNfPGp0TwEYxHrKEaU7sMELhNrBjYtJ1GBv9PndNyhfN lB08n2dGkYCat24zunBlmMfUPP8p2iKbr5b3/dyvYGP62PHZxugV0MINZR5cHGcM9bnKCYZKXAGLZ ZtMXEWDEhe9aVZOv4dgyWvMWAxNCjPB9bAS2iM5An9q/MNvgJ42JJsW35o+9MBJAi+C/7UTPsecFz g5M5bGETL4aNQjgQ/AJMqjXyzfsnE3syM3MdbwIr4IypKOqIiA1kKdp773GEE+8Zd1zvfI871MRIc QPH2a39tSiJ+THgjzKdw==; 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 1dhfXj-0007Zz-Os; Tue, 15 Aug 2017 17:22:15 +0000 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dhfXe-0007WJ-Ua for linux-snps-arc@lists.infradead.org; Tue, 15 Aug 2017 17:22:14 +0000 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 699DD24E0BF2; Tue, 15 Aug 2017 10:21:46 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 5386915D; Tue, 15 Aug 2017 10:21:46 -0700 (PDT) Received: from localhost.internal.synopsys.com (unknown [10.121.8.106]) by mailhost.synopsys.com (Postfix) with ESMTP id A2E0211B; Tue, 15 Aug 2017 10:21:44 -0700 (PDT) From: Eugeniy Paltsev To: linux-serial@vger.kernel.org Subject: [PATCH] earlycon: initialise baud field of earlycon device structure Date: Tue, 15 Aug 2017 20:21:41 +0300 Message-Id: <20170815172141.29115-1-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170815_102211_285079_FBD6ECFE X-CRM114-Status: UNSURE ( 7.42 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [198.182.47.9 listed in wl.mailspike.net] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , linux-snps-arc@lists.infradead.org, Eugeniy Paltsev , linux-kernel@vger.kernel.org, Jiri Slaby Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org For now baud field of earlycon structure device is't initialised at all in of_setup_earlycon (in oppositŠµ to register_earlycon). So when I use stdout-path to point earlycon device (like stdout-path = &serial or stdout-path = "serial:115200n8") baud field of earlycon device structure remains uninitialised and earlycon initialization is not performed correctly as of_setup_earlycon is used. When pass all arguments via bootargs (like bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8") initialization is performed correctly as register_earlycon is used. So initialise baud field of earlycon device structure by baud value from device tree or from options (if they exist) when we use of_setup_earlycon Signed-off-by: Eugeniy Paltsev --- drivers/tty/serial/earlycon.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index c365154..6c2e2b6 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -240,6 +240,7 @@ int __init of_setup_earlycon(const struct earlycon_id *match, { int err; struct uart_port *port = &early_console_dev.port; + unsigned long baud; const __be32 *val; bool big_endian; u64 addr; @@ -282,7 +283,15 @@ int __init of_setup_earlycon(const struct earlycon_id *match, } } + val = of_get_flat_dt_prop(node, "baud", NULL); + if (val) + early_console_dev.baud = be32_to_cpu(*val); + if (options) { + err = kstrtoul(options, 10, &baud); + if (!err) + early_console_dev.baud = baud; + strlcpy(early_console_dev.options, options, sizeof(early_console_dev.options)); }