All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Agner <stefan.agner@toradex.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] serial: mxc: support DTE mode
Date: Fri, 19 Jan 2018 13:23:14 +0100	[thread overview]
Message-ID: <f00a5b3b-ab98-a92b-604e-e19b25537fe1@toradex.com> (raw)
In-Reply-To: <1516355628-21784-2-git-send-email-ryan.harkin@linaro.org>

Hi Ryan,


On 19.01.2018 10:53, Ryan Harkin wrote:
> Add DTE mode support via Kconfig on the MXC uart.

Make use of the driver model, there DTE is supported already today:
https://lists.denx.de/pipermail/u-boot/2016-July/259573.html

--
Stefan

>
> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  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)

  reply	other threads:[~2018-01-19 12:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19  9:53 [U-Boot] [PATCH 0/2] warp7: add UART6 support Ryan Harkin
2018-01-19  9:53 ` [U-Boot] [PATCH 1/2] serial: mxc: support DTE mode Ryan Harkin
2018-01-19 12:23   ` Stefan Agner [this message]
2018-01-19 13:21     ` Ryan Harkin
2018-01-22  0:29       ` Simon Glass
2018-01-22  9:12         ` Ryan Harkin
2018-01-19  9:53 ` [U-Boot] [PATCH 2/2] warp7: add support for console on UART6 and mikroBus Ryan Harkin
2018-01-19 11:18 ` [U-Boot] [PATCH 0/2] warp7: add UART6 support Bryan O'Donoghue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f00a5b3b-ab98-a92b-604e-e19b25537fe1@toradex.com \
    --to=stefan.agner@toradex.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.