From patchwork Wed Apr 4 10:20:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 10322391 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 7CA7360318 for ; Wed, 4 Apr 2018 10:21:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A69B28E33 for ; Wed, 4 Apr 2018 10:21:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F01028E2E; Wed, 4 Apr 2018 10:21:11 +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 [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 DB1DA28C26 for ; Wed, 4 Apr 2018 10:21:10 +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=pXVL+PumU34ePUVvZ08MgLjon+hbbuG1t3WGSIuqO08=; b=K8i dMjZPwykRXFGWAs4/2lRGqr5eUAomnxeqzNLEaJ4Ic2Zkokhpk8QmYqxiaVxhQff5B3tkgm/c3CIV MhoUfKNFbzqG+D5v6qJhmWxFKRBo9Xl5W85Pcrdo5jn5zg69A3T8QtyENF9GI/0Qv4zGb22xpUqat CFxwVyEBzJvMp5clS2kqeFd2g2BVm+FPiX9rPmn3cEY50UiYUXcfe6bDCLqPvIq4ALB9qA+liOXk7 N5+/Xy1h+Z4/KPSlrNC9vGQzmu50trnfgbeta/0nzScQ+U5CdrEWnQkQitoL5+bRKcDUczZqzZR4n GByJdNQos9OKCNdrXXFSDdGGj4dVjIg==; 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 1f3fXO-0004oO-Br; Wed, 04 Apr 2018 10:21:06 +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 1f3fXL-0004lx-18 for linux-arm-kernel@lists.infradead.org; Wed, 04 Apr 2018 10:21:04 +0000 Received: by mail-wr0-x244.google.com with SMTP id n2so18399419wrj.7 for ; Wed, 04 Apr 2018 03:20:51 -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=SjTHGmte3K/texYYpsRe+3VfjRtkvh+yXS6DkFWEWDQ=; b=Xxit5vLe118PjmUcv5u0m5DtEXiLSeegOb0LYT42JQkZ3aq/83yF+MF1tYdMXdMy1+ G35SoS90Nm8NrnNF+1ncGZIOwWaoIiZLA9gAIXZr6Vm8cJwmXkWOQ7jYmOyh3m0ACKUI OYmKa6WcYg0wTO5yVBrMisqG1xIzImAKtAHw+PR8ZHPd+rF3nYcwiDq1ZESIiJMk5FHn cV5rCNHv43Jtk/6ESHZQLVsJS9cB/M2J2S2BAxb2aGxH5DgoS2gfCzgwcG4pFjGJ3+pL 9uiKacP6mW9QR8Od64eWbb5JjxGzxnsxUFjs01cIhaDpS/cdYNKuZPOb2PQ7knar7fAW x3eQ== 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=SjTHGmte3K/texYYpsRe+3VfjRtkvh+yXS6DkFWEWDQ=; b=lseml9cOURtsmVtAmStgT2lk0jZP4zqaEyk7mkyZL+2CIP87jad9lMJvQ9Q95VjBRS W9ldABAo5cN1Tnr2uGpbd+IDqrxaqQ/JWe9OL0CkNwRGWjgNME2S8tAZf2ddwvM5FvLK uvCYqrDeIKZXQTZ0uzGkje+iJoaCpGUqpysH4VVjrZ5lbrTDTJRbaE0AdxjTDqOBoufl Y5sdW++ZquMI46YuS/LUWWHWrA0CuvuiAATxuizYUardQEKvOMeaUalyd8UU2dqIjVBM 6ttzaJWgDG8yjzDhC6dBur601GgRifhl+Xww3h1f6YHMr18lHSP9JaEE9iRt5x7PNoCK 4Q1A== X-Gm-Message-State: AElRT7HKvq/Pa5LiLv3SVv32ivkRDvnompGBjqwSvgQUd1MQRX70A8+M 9HFSTw4fjJehfb7j0ymHjOLO4Q== X-Google-Smtp-Source: AIpwx4/YQHFoAA/IEvT3pY4SwoWqiLOasfA8XW3Qimwp+ydFJfUPsmJgwDWUfNzbEQilOf2NzBc/bg== X-Received: by 10.223.133.6 with SMTP id 6mr13167971wrh.53.1522837250485; Wed, 04 Apr 2018 03:20:50 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id k14sm5617988wrc.62.2018.04.04.03.20.49 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 04 Apr 2018 03:20:49 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, agraf@suse.de Subject: [PATCH] serial: xuartps: Fix the early_console junk character issue Date: Wed, 4 Apr 2018 12:20:47 +0200 Message-Id: <6698032e594f5f921f25c4a7e235e0cee5521087.1522837245.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-20180404_032103_077744_42C45371 X-CRM114-Status: GOOD ( 14.33 ) 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: linux-arm-kernel@lists.infradead.org, Nava kishore Manne , Greg Kroah-Hartman , 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 From: Nava kishore Manne In the early_console_setup is trying to access the unregister clock value, so we are receiving some garbage clk value because of this wrong clk value the early_console_setup is fail to set the required console baud rate. This path fix this issue. Signed-off-by: Nava kishore Manne Signed-off-by: Michal Simek --- drivers/tty/serial/xilinx_uartps.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 19d370779767..4176c3a0b4e8 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1130,34 +1130,9 @@ static void cdns_early_write(struct console *con, const char *s, static int __init cdns_early_console_setup(struct earlycon_device *device, const char *opt) { - struct uart_port *port = &device->port; - - if (!port->membase) + if (!device->port.membase) return -ENODEV; - /* initialise control register */ - writel(CDNS_UART_CR_TX_EN|CDNS_UART_CR_TXRST|CDNS_UART_CR_RXRST, - port->membase + CDNS_UART_CR); - - /* only set baud if specified on command line - otherwise - * assume it has been initialized by a boot loader. - */ - if (device->baud) { - u32 cd = 0, bdiv = 0; - u32 mr; - int div8; - - cdns_uart_calc_baud_divs(port->uartclk, device->baud, - &bdiv, &cd, &div8); - mr = CDNS_UART_MR_PARITY_NONE; - if (div8) - mr |= CDNS_UART_MR_CLKSEL; - - writel(mr, port->membase + CDNS_UART_MR); - writel(cd, port->membase + CDNS_UART_BAUDGEN); - writel(bdiv, port->membase + CDNS_UART_BAUDDIV); - } - device->con->write = cdns_early_write; return 0;