From patchwork Tue May 12 19:25:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 48401 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6CED9214A1 for ; Tue, 12 May 2015 19:30:05 +0000 (UTC) Received: by wgiv13 with SMTP id v13sf4053613wgi.3 for ; Tue, 12 May 2015 12:30:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=apjDL7oEM1ZoVAw2aJpUaEoKcfy+9xWTMav7IrxD4GA=; b=NJQ5gNdxxAVeVIRu4jF/WYd8Ma6dyqLMPjhGrHnWO6ZOdbJGKO55X1rPx5cz5N5x11 jsqn4q+hiJnYqULPGUKlYePkfTc7+UJVjnIwAQ7Cpm68PsiChJaXd+4LxXA8bgImf6Hv hUEJllvxRzUo1XU2V2UJ8jPTKIngON3NYgymJwWGNZLmV0AcMk9gM2jObR9/gszM+m1w RaJfKdsLe1iFLBZio8Q2Mia+WSQHEDI+IxQCPZNTVDrp66YoZevXBdX2uAmEGXgmKFJB dNhmKyXLv//EjBOUPZnFkuNZZtUd/A8VP82qggsZsyHfH7OMPU87wz//wt96QB/nahHX 0nPw== X-Gm-Message-State: ALoCoQm/MuR8QzseVoaE2ytVvv8IlvNaqoobGq4kkEEnHGugmL4EhvWRWJZQavFBd2qnADYl5z/U X-Received: by 10.112.130.71 with SMTP id oc7mr11605597lbb.23.1431459004615; Tue, 12 May 2015 12:30:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.41 with SMTP id p9ls80203lap.37.gmail; Tue, 12 May 2015 12:30:04 -0700 (PDT) X-Received: by 10.152.26.130 with SMTP id l2mr13316355lag.20.1431459004306; Tue, 12 May 2015 12:30:04 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id wd2si8882515lbb.123.2015.05.12.12.30.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 12:30:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lagv1 with SMTP id v1so13646249lag.3 for ; Tue, 12 May 2015 12:30:04 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr13012370lac.41.1431459004101; Tue, 12 May 2015 12:30:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp109628lbb; Tue, 12 May 2015 12:30:03 -0700 (PDT) X-Received: by 10.181.11.193 with SMTP id ek1mr7902521wid.15.1431459003589; Tue, 12 May 2015 12:30:03 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id ez10si29037914wjd.4.2015.05.12.12.30.02; Tue, 12 May 2015 12:30:03 -0700 (PDT) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 040724B635; Tue, 12 May 2015 21:29:58 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s0sQ3qAe2KPD; Tue, 12 May 2015 21:29:57 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5A3BF4B639; Tue, 12 May 2015 21:29:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 61E704B617 for ; Tue, 12 May 2015 21:25:40 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VskDyOyB_V2r for ; Tue, 12 May 2015 21:25:40 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by theia.denx.de (Postfix) with ESMTPS id 2A7304B616 for ; Tue, 12 May 2015 21:25:37 +0200 (CEST) Received: by wicnf17 with SMTP id nf17so28765082wic.1 for ; Tue, 12 May 2015 12:25:37 -0700 (PDT) X-Received: by 10.195.11.202 with SMTP id ek10mr32345921wjd.12.1431458737005; Tue, 12 May 2015 12:25:37 -0700 (PDT) Received: from scallop.lan (cpc4-aztw19-0-0-cust71.18-1.cable.virginm.net. [82.33.25.72]) by mx.google.com with ESMTPSA id mc20sm4280879wic.15.2015.05.12.12.25.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 12:25:35 -0700 (PDT) From: Daniel Thompson To: u-boot@lists.denx.de Date: Tue, 12 May 2015 20:25:26 +0100 Message-Id: <1431458726-2615-1-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.1.0 X-Mailman-Approved-At: Tue, 12 May 2015 21:29:49 +0200 Cc: Kamil Lulko , Daniel Thompson Subject: [U-Boot] [PATCH] serial: stm32: Automatically generate CR when LF is observed X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Currently the u-boot output looks rather odd when running the minicom terminal emulator in its default mode (just a string of "random" looking text down the right hand side of the screen). This is caused by a combination of minicom not automatically wrapping lines and the stm32 serial driver never sending a carriage return. Issue is trivially solved by automatically generating a CR whenever a LF is transmitted, Several other serial drivers implement this behaviour. Signed-off-by: Daniel Thompson Cc: Kamil Lulko --- drivers/serial/serial_stm32.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c index 3c80096..8c613db 100644 --- a/drivers/serial/serial_stm32.c +++ b/drivers/serial/serial_stm32.c @@ -81,6 +81,10 @@ static int stm32_serial_getc(void) static void stm32_serial_putc(const char c) { struct stm32_serial *usart = (struct stm32_serial *)USART_BASE; + + if (c == '\n') + stm32_serial_putc('\r'); + while ((readl(&usart->sr) & USART_SR_FLAG_TXE) == 0) ; writel(c, &usart->dr);