From patchwork Thu Jul 9 16:12:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1326046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.a=rsa-sha256 header.s=dec2015msa header.b=rAZoWrS+; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B2h676cVxz9s1x for ; Fri, 10 Jul 2020 02:12:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E418982240; Thu, 9 Jul 2020 18:12:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="rAZoWrS+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C919882247; Thu, 9 Jul 2020 18:12:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 398BA80199 for ; Thu, 9 Jul 2020 18:12:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=yamada.masahiro@socionext.com Received: from oscar.flets-west.jp (softbank126090202047.bbtec.net [126.90.202.47]) (authenticated) by conuserg-07.nifty.com with ESMTP id 069GCH2Q029258; Fri, 10 Jul 2020 01:12:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com 069GCH2Q029258 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1594311138; bh=fBubDrsjOzF4kgyDNHQUmG9fI4U0fkQRSXnB2UkXW4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rAZoWrS+0VBn1HLw0tE/kVqsPfAXxGZanEB8FmlXS/yrrB11fecdgjJhlIka7D7sn Z8p4hPe4qFR+AowZtUFiSkXylUG/1t81fPJzcMfiP0b4iuNa9IqyQ5Li1bxnf9QKca U/dIu9LIiUkgC2HaZ+lU2s9CZpUAflpPYyOEA/vo8Xq4zmlwgwjJSdEgmjFfxwehqz zyhC+dlRJ4lXV+Yx8wG4YJVphI5PAGbnjjBYlphVLtKIbSHsf8oMHDhNXTY492lx7z l/7/EPPjfrCc9Z5aVmlDgaGp267HaFZuaJoTOHjiTDCztCgomya9Jfh721V/rYR5C3 aoR1Olswek1qw== X-Nifty-SrcIP: [126.90.202.47] From: Masahiro Yamada To: u-boot@lists.denx.de Cc: Masahiro Yamada Subject: [PATCH 3/3] serial: uniphier: enable FIFO Date: Fri, 10 Jul 2020 01:12:08 +0900 Message-Id: <20200709161208.223814-3-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200709161208.223814-1-yamada.masahiro@socionext.com> References: <20200709161208.223814-1-yamada.masahiro@socionext.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This UART controller is integrated with a FIFO. Enable it. You can put the next character into the FIFO while the transmitter is sending out the current character. This works slightly faster. Signed-off-by: Masahiro Yamada --- drivers/serial/serial_uniphier.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/serial/serial_uniphier.c b/drivers/serial/serial_uniphier.c index aaf8657ee1..ad691b66da 100644 --- a/drivers/serial/serial_uniphier.c +++ b/drivers/serial/serial_uniphier.c @@ -23,6 +23,7 @@ #define UNIPHIER_UART_TX UNIPHIER_UART_RX /* bit[15:8] = CHAR, bit[7:0] = FCR */ #define UNIPHIER_UART_CHAR_FCR (3 << (UNIPHIER_UART_REGSHIFT)) +#define UNIPHIER_UART_FCR_MASK GENMASK(7, 0) /* bit[15:8] = LCR, bit[7:0] = MCR */ #define UNIPHIER_UART_LCR_MCR (4 << (UNIPHIER_UART_REGSHIFT)) #define UNIPHIER_UART_LCR_MASK GENMASK(15, 8) @@ -140,6 +141,12 @@ static int uniphier_serial_probe(struct udevice *dev) while (!(readl(priv->membase + UNIPHIER_UART_LSR) & UART_LSR_TEMT)) ; + /* enable FIFO */ + tmp = readl(priv->membase + UNIPHIER_UART_CHAR_FCR); + tmp &= ~UNIPHIER_UART_FCR_MASK; + tmp |= FIELD_PREP(UNIPHIER_UART_FCR_MASK, UART_FCR_ENABLE_FIFO); + writel(tmp, priv->membase + UNIPHIER_UART_CHAR_FCR); + tmp = readl(priv->membase + UNIPHIER_UART_LCR_MCR); tmp &= ~UNIPHIER_UART_LCR_MASK; tmp |= FIELD_PREP(UNIPHIER_UART_LCR_MASK, UART_LCR_WLEN8);