All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1 0/2] serial: atmel_usart: Support to enable an early debug UART
@ 2016-08-30  8:43 Wenyou Yang
  2016-08-30  8:43 ` [U-Boot] [PATCH v1 1/2] serial: Kconfig: Add ATMEL_USART option Wenyou Yang
  2016-08-30  8:43 ` [U-Boot] [PATCH v1 2/2] serial: atmel_usart: Support enable an early debug UART Wenyou Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Wenyou Yang @ 2016-08-30  8:43 UTC (permalink / raw)
  To: u-boot

The patch set is to add support to enable an early debug UART
for debugging. And add ATMEL_USART option to enable the Atmel
usartdriver from Kconfig.


Wenyou Yang (2):
  serial: Kconfig: Add ATMEL_USART option
  serial: atmel_usart: Support enable an early debug UART

 drivers/serial/Kconfig       | 14 ++++++++++++++
 drivers/serial/atmel_usart.c | 22 ++++++++++++++++++++++
 2 files changed, 36 insertions(+)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v1 1/2] serial: Kconfig: Add ATMEL_USART option
  2016-08-30  8:43 [U-Boot] [PATCH v1 0/2] serial: atmel_usart: Support to enable an early debug UART Wenyou Yang
@ 2016-08-30  8:43 ` Wenyou Yang
  2016-08-30  8:43 ` [U-Boot] [PATCH v1 2/2] serial: atmel_usart: Support enable an early debug UART Wenyou Yang
  1 sibling, 0 replies; 4+ messages in thread
From: Wenyou Yang @ 2016-08-30  8:43 UTC (permalink / raw)
  To: u-boot

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---

 drivers/serial/Kconfig | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index ab5df70..a6035dc 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -289,6 +289,13 @@ config AR933X_UART
 	  tree binding to operate, please refer to the document at
 	  doc/device-tree-bindings/serial/qca,ar9330-uart.txt.
 
+config ATMEL_USART
+	bool "Atmel USART support"
+	help
+	  Select this to enable USART support for Atmel SoCs. It can be
+	  configured in the device tree, and input clock frequency can
+	  be got from the clk node.
+
 config FSL_LPUART
 	bool "Freescale LPUART support"
 	help
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v1 2/2] serial: atmel_usart: Support enable an early debug UART
  2016-08-30  8:43 [U-Boot] [PATCH v1 0/2] serial: atmel_usart: Support to enable an early debug UART Wenyou Yang
  2016-08-30  8:43 ` [U-Boot] [PATCH v1 1/2] serial: Kconfig: Add ATMEL_USART option Wenyou Yang
@ 2016-08-30  8:43 ` Wenyou Yang
  2016-09-06  1:04   ` Simon Glass
  1 sibling, 1 reply; 4+ messages in thread
From: Wenyou Yang @ 2016-08-30  8:43 UTC (permalink / raw)
  To: u-boot

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---

 drivers/serial/Kconfig       |  7 +++++++
 drivers/serial/atmel_usart.c | 22 ++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index a6035dc..b8ecd80 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -98,6 +98,13 @@ config DEBUG_UART_AR933X
 	  driver will be available until the real driver model serial is
 	  running.
 
+config DEBUG_UART_ATMEL
+	bool "Atmel USART"
+	help
+	  Select this to enable a debug UART using the atmel usart driver. You
+	  will need to provide parameters to make this work. The driver will
+	  be available until the real driver-model serial is running.
+
 config DEBUG_UART_NS16550
 	bool "ns16550"
 	help
diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
index e450135..7674f97 100644
--- a/drivers/serial/atmel_usart.c
+++ b/drivers/serial/atmel_usart.c
@@ -11,6 +11,7 @@
 #include <errno.h>
 #include <watchdog.h>
 #include <serial.h>
+#include <debug_uart.h>
 #include <linux/compiler.h>
 
 #include <asm/io.h>
@@ -226,3 +227,24 @@ U_BOOT_DRIVER(serial_atmel) = {
 	.priv_auto_alloc_size	= sizeof(struct atmel_serial_priv),
 };
 #endif
+
+#ifdef CONFIG_DEBUG_UART_ATMEL
+static inline void _debug_uart_init(void)
+{
+	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_DEBUG_UART_BASE;
+
+	atmel_serial_setbrg_internal(usart, 0, CONFIG_BAUDRATE);
+}
+
+static inline void _debug_uart_putc(int ch)
+{
+	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_DEBUG_UART_BASE;
+
+	while (!(readl(&usart->csr) & USART3_BIT(TXRDY)))
+		;
+
+	writel(ch, &usart->thr);
+}
+
+DEBUG_UART_FUNCS
+#endif
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v1 2/2] serial: atmel_usart: Support enable an early debug UART
  2016-08-30  8:43 ` [U-Boot] [PATCH v1 2/2] serial: atmel_usart: Support enable an early debug UART Wenyou Yang
@ 2016-09-06  1:04   ` Simon Glass
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2016-09-06  1:04 UTC (permalink / raw)
  To: u-boot

On 30 August 2016 at 02:43, Wenyou Yang <wenyou.yang@atmel.com> wrote:
> Add support to enable an early debug UART for debugging.
>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> ---
>
>  drivers/serial/Kconfig       |  7 +++++++
>  drivers/serial/atmel_usart.c | 22 ++++++++++++++++++++++
>  2 files changed, 29 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-06  1:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-30  8:43 [U-Boot] [PATCH v1 0/2] serial: atmel_usart: Support to enable an early debug UART Wenyou Yang
2016-08-30  8:43 ` [U-Boot] [PATCH v1 1/2] serial: Kconfig: Add ATMEL_USART option Wenyou Yang
2016-08-30  8:43 ` [U-Boot] [PATCH v1 2/2] serial: atmel_usart: Support enable an early debug UART Wenyou Yang
2016-09-06  1:04   ` Simon Glass

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.