From patchwork Tue Apr 10 13:33:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 10333195 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 25B4860365 for ; Tue, 10 Apr 2018 13:33:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 159C428A80 for ; Tue, 10 Apr 2018 13:33:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A3AB28D42; Tue, 10 Apr 2018 13:33:54 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 977FE28A80 for ; Tue, 10 Apr 2018 13:33:53 +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:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=jCjg63RKxaOMzjV4MxALl3IDO7bnieKsaZ0jsux1bp4=; b=H3Q xUcUs4jsNbqeEbqckawDBAtNZVSkfaOV4is5Mqjh4a55aTZgEJqZlaJe6BZBLJxMM/WGKIBkzLQy1 fbP5BlRwzshQoV7L0D7887F9hERXkiSgPyRO7XW1zKgUmMK29Cx8R9Cm5fxDwEU13eI7gdo0h5dnY PrpzuYYGuoj5escfvfPAEh1jpPIFT2oigxMNE3jkb1T2V7cQbiB7AudngexDRia5lMW33XRuismZZ 97sQUDv7QGcrtWO7/Aj2c5RPKyhrjjAWBFXAnREG8wfYt81NKF4XVReSyM2spE+F4bniSvnyCpOeQ cS/c7Y8juZSvxmIEI/IqJs0az5BPwRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f5tPA-0001FF-FN; Tue, 10 Apr 2018 13:33:48 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f5tP6-0001Dc-Hm for linux-arm-kernel@lists.infradead.org; Tue, 10 Apr 2018 13:33:46 +0000 Received: by mail-wr0-x244.google.com with SMTP id y55so12844374wry.3 for ; Tue, 10 Apr 2018 06:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=Jm/Bgx3uPrh5QWpCac5UH9qqTA77jKi2RVPcX3gxJDk=; b=a54fHt+G0J8ZsZHWF5vd77QLM0IV6M5IZdRaoENEU4RsqZ5APUP1kBE29UGrvY+xJK ztLcl0mLDlLS4toVbTe3ZJnwktxzYklzAPjlTaXDjJ6F7hN+u4Lato98u8qj096RRH3Z 7VNxXPJYNq2F+amg1To56RDIKlZ7ezY2CBtog66CX26XnP3WBNSbpWxVhZwUmbD8X9Gx SN1Z21ovMNryWS9uh4iCQej4BIAscStdciNrWfrn73oTj1e6qLuoAFhOSLiHI0AnEXDb 1+jrSp4FRe86fP7dn7NqId7G74dJcHne1Ss1q2PX0L/x/oeZlwC0hY7j4X4wXIJILfaH N9Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=Jm/Bgx3uPrh5QWpCac5UH9qqTA77jKi2RVPcX3gxJDk=; b=qyPpeuER/TWevgmhJrTOqmEIsqa9NNIyuwLClcdGiRNHbgxSMz+itaf84KbA0LhhjV 6iJPqUgV/qp8xznpqPHfyjasFMDZVdw9puJQsHCLbg97PfaucanIszFUdkw22JxlpRvh A8O1xSZu/SYKUIYRctLrlwhJgbzUO18hmWTk4gZ20KfF6iESokfZQBJU2cnIXPtBeHy8 +VEQfuezQzz6hv6FDn2JBQC7KelMGWpQyrelWo5m94FtNcmoMIu7TQI+5y7L58p6aQkG nY96LCMaS9wTA2Q/Gb4UQkwdnFr/s8AxuBF9+ZAEDYbPe8KBXOsxlux4wRyhJE0hKduR 9R0Q== X-Gm-Message-State: ALQs6tCWn4gxGp/p8Y5nnHznCCfvgIUELleUuDPdgLcDRVkoW+pBmupv JZoxWAJYQvqJ838z57vA1/XjFA== X-Google-Smtp-Source: AIpwx487VA6KeqMcExzd7UAlpLLrSU7cB9+7u+6m9Pbw8mUi1Im3w9ySrEkyXnfCT/XdahtQSMHQ7Q== X-Received: by 10.223.184.35 with SMTP id h32mr347393wrf.209.1523367212104; Tue, 10 Apr 2018 06:33:32 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id a63sm4047907wrc.22.2018.04.10.06.33.31 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 10 Apr 2018 06:33:31 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Subject: [PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed Date: Tue, 10 Apr 2018 15:33:30 +0200 Message-Id: <2ef5ac478f8d32bc807ead758eb5d60744a44515.1523367208.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180410_063344_585801_47D27693 X-CRM114-Status: GOOD ( 14.54 ) 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: , Cc: Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby 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 Baudrate calculation depends on requested baudrate and uart clock. This patch is checking that uartclk is also passed. The same logic is used 8250_early.c/init_port function. Signed-off-by: Michal Simek --- drivers/tty/serial/xilinx_uartps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index b9b2bc76bcac..a654cda203c7 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1181,7 +1181,7 @@ static int __init cdns_early_console_setup(struct earlycon_device *device, /* only set baud if specified on command line - otherwise * assume it has been initialized by a boot loader. */ - if (device->baud) { + if (port->uartclk && device->baud) { u32 cd = 0, bdiv = 0; u32 mr; int div8;