From patchwork Fri Jan 19 09:53:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Harkin X-Patchwork-Id: 125138 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp214967ljf; Fri, 19 Jan 2018 01:54:53 -0800 (PST) X-Google-Smtp-Source: ACJfBotml7N7HX99ZYt3sYgMw7U4QYioQ2V/h7lT4ECXSXLKJS1gPp1Nv9nBc0SzESbNbGPR/XM+ X-Received: by 10.80.225.3 with SMTP id h3mr12016810edl.194.1516355693698; Fri, 19 Jan 2018 01:54:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516355693; cv=none; d=google.com; s=arc-20160816; b=k0TUdu/UwgT0q6ksmnu7BWBGfCfgIw+K2kGcXBDDAzUZnayPjUTlEyGM1WTTvl5Kar oIrMSvZ7ln/y83Xb31r6h8sFK2mkpFZJwL2/D1zHynA1YeKBCm0DFhq23gnVclZtfowe OfFxkEQiBgsfKlK7Fx8GBJkpwRDT8yRvSIzf58GS6cyX13Sl3PUcUzFmNwq0iO8BbN31 37JM8BEF0Nf1gqVtoBphRH8Az9bPPpaMYmN+OWIyeu3NxbFhIbTnXrrwGty5Lw9v3rUC YbQX8QmyGS3Qvix3wvGL4kSNOg3RFSw7FDNyy3YiLBP2AFfudScZSJitzPlTYTOdCTJ+ UD5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=GYCOW5Gfb+EPQC7XyeDi9wqlBXebTVAeolUIYXoJp/4=; b=hgtjiZc9jaAwLZZVTy/Z1FOTmHDSwRU84vfJVYmFe/f/iLYi0sDpPbIdJG3g5rh445 6YOZemeCZnw5P9BDCkkMATZK1Ce/T3cz3RsHwKMMz3HUr90e3XVN/FCQIe/pM5PEWdr+ WKKdHWlEDvTN3FskYvVw2Ead/k3FSo2RLwOLWcUx1B9rf8iY85G6RkfnsoNqXMl2I3qk wOL4nhBQL7qhzUp/fhQ9Sxo485MDAJ/V8j2ZjeevkfaIh7fJ/aelcl3BCGRZZR76v+0M vAHP5LTBdJCTtIzsHtresY/YdXTdLlny/lkoofhHA2PpWg0P3lof3KN+9GF4KZZEDpiQ j1Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YqHNGG5g; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id n18si8199411edf.451.2018.01.19.01.54.53; Fri, 19 Jan 2018 01:54:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YqHNGG5g; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 43550C21F33; Fri, 19 Jan 2018 09:54:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 56684C21F14; Fri, 19 Jan 2018 09:54:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0945CC21DD9; Fri, 19 Jan 2018 09:53:58 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by lists.denx.de (Postfix) with ESMTPS id 9F6A4C21C41 for ; Fri, 19 Jan 2018 09:53:58 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id b21so2284153wme.4 for ; Fri, 19 Jan 2018 01:53:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MHQAQ5FJOgXtnhPlXU10TGndwvCx2sXuzyilzCiEye0=; b=YqHNGG5g9lLTeI5K2B0Aaj4id9TCsbjSILLBNnJgR5ZM4tk66Itq2+7FNmWC6XDFbH t/VJWNktJeLZoyuOAbewLKSbLJQypWjAfX8bZZ8XBfU3FqFHrp0J45vrbGYFr5elNpOF R+Ais8D4qEAyekPQy1M4EtfOXl4+F+jVGTXi0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MHQAQ5FJOgXtnhPlXU10TGndwvCx2sXuzyilzCiEye0=; b=ZRUf8kA+PPSL6teOcJzlxB9giIefm8JZpZZYTSS/0IBw0zKYd0xtDWYQImYvVhzaHG No0iYfa+T98pj/IjklsbWuNLpN+Mn0X6MW8WRYBrWd/vBJ1g8FgrbpS7ZgHH7sqeH7BN 9lbs7hgoJPZuaJHosZz7AuoqBcSb127EI+D4eNKshKoI72/ZqGo1ydIFXQW5CgmEkx7W Ng3LigONXewU50o015kbyGqNqkXpn9iT/wrAcx+5sFU6ZF8EEVeEdeE2n1sxQ7aBb00l RRfzq6wcoTCHBJ05/kcZ7qoXjx+7J4Mz3G1vx5N/T0WvhhJwCROvhJSXnCDvMmf60MoW Tc/w== X-Gm-Message-State: AKwxytfbIgfYq6X+gJoX6SnL5WltACSQTSXfTvjlLMmF+8m7OH8uZ407 aMCThNd6jVUVbTsIbAuvO4r9HR3lV0s= X-Received: by 10.28.28.198 with SMTP id c189mr7615612wmc.104.1516355638063; Fri, 19 Jan 2018 01:53:58 -0800 (PST) Received: from localhost.localdomain (82-69-54-187.dsl.in-addr.zen.co.uk. [82.69.54.187]) by smtp.gmail.com with ESMTPSA id a62sm493090wmh.3.2018.01.19.01.53.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Jan 2018 01:53:57 -0800 (PST) From: Ryan Harkin To: u-boot@lists.denx.de, Simon Glass Date: Fri, 19 Jan 2018 09:53:47 +0000 Message-Id: <1516355628-21784-2-git-send-email-ryan.harkin@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516355628-21784-1-git-send-email-ryan.harkin@linaro.org> References: <1516355628-21784-1-git-send-email-ryan.harkin@linaro.org> Cc: Breno Lima , Eric Nelson , Stefan Agner Subject: [U-Boot] [PATCH 1/2] serial: mxc: support DTE mode X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion 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" Add DTE mode support via Kconfig on the MXC uart. Signed-off-by: Ryan Harkin Reviewed-by: Bryan O'Donoghue --- drivers/serial/Kconfig | 7 +++++++ drivers/serial/serial_mxc.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 122b8e7..0df57c0 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -597,4 +597,11 @@ config SYS_SDMR depends on MPC8XX_CONS default 0 +config SERIAL_MXC_DTE_MODE + bool "Use DTE mode for the MXC UART" + default n + help + This is used to set DTE mode on the serial console controlled by + serial_mxc.c. + endmenu diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c index cce80a8..e7ea30c 100644 --- a/drivers/serial/serial_mxc.c +++ b/drivers/serial/serial_mxc.c @@ -111,6 +111,12 @@ #define TXTL 2 /* reset default */ #define RXTL 1 /* reset default */ +#ifdef CONFIG_SERIAL_MXC_DTE_MODE +#define MXC_DTE_MODE true +#else +#define MXC_DTE_MODE false +#endif + DECLARE_GLOBAL_DATA_PTR; struct mxc_uart { @@ -189,7 +195,7 @@ static void mxc_serial_setbrg(void) if (!gd->baudrate) gd->baudrate = CONFIG_BAUDRATE; - _mxc_serial_setbrg(mxc_base, clk, gd->baudrate, false); + _mxc_serial_setbrg(mxc_base, clk, gd->baudrate, MXC_DTE_MODE); } static int mxc_serial_getc(void) @@ -367,7 +373,7 @@ static inline void _debug_uart_init(void) _mxc_serial_init(base); _mxc_serial_setbrg(base, CONFIG_DEBUG_UART_CLOCK, - CONFIG_BAUDRATE, false); + CONFIG_BAUDRATE, MXC_DTE_MODE); } static inline void _debug_uart_putc(int ch)