From: Sergey Temerkhanov <s.temerkhanov@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RESEND PATCH v2 1/2] arm: serial: Add debug UART capability to the pl01x driver
Date: Wed, 14 Oct 2015 09:54:23 -0700 [thread overview]
Message-ID: <1444841664-27773-2-git-send-email-s.temerkhanov@gmail.com> (raw)
In-Reply-To: <1444841664-27773-1-git-send-email-s.temerkhanov@gmail.com>
This patch adds an ability to use pl01x as a debug UART. It must
be configured like other types of debug UARTs
Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
Acked-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Broke down into 2 patches
- Minor changes to accomodate Kconfig options
drivers/serial/serial_pl01x.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 3a5c1d0..18c02ab 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -367,3 +367,31 @@ U_BOOT_DRIVER(serial_pl01x) = {
};
#endif
+
+#if defined(CONFIG_DEBUG_UART_PL010) || defined(CONFIG_DEBUG_UART_PL011)
+
+#include <debug_uart.h>
+
+void debug_uart_init(void)
+{
+#ifndef CONFIG_DEBUG_UART_SKIP_INIT
+ struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
+ enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
+ TYPE_PL011 : TYPE_PL010;
+
+ pl01x_generic_serial_init(regs, type);
+ pl01x_generic_setbrg(regs, type,
+ CONFIG_DEBUG_UART_CLOCK, CONFIG_BAUDRATE);
+#endif
+}
+
+static inline void _debug_uart_putc(int ch)
+{
+ struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
+
+ pl01x_putc(regs, ch);
+}
+
+DEBUG_UART_FUNCS
+
+#endif
--
2.1.4
next prev parent reply other threads:[~2015-10-14 16:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 16:54 [U-Boot] [RESEND PATCH v2 0/2] This series adds an ability to use pl01x for early debug output Sergey Temerkhanov
2015-10-14 16:54 ` Sergey Temerkhanov [this message]
2016-01-19 22:33 ` [U-Boot] [U-Boot, RESEND, v2, 1/2] arm: serial: Add debug UART capability to the pl01x driver Tom Rini
2015-10-14 16:54 ` [U-Boot] [RESEND PATCH v2 2/2] arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output Sergey Temerkhanov
2016-01-19 22:33 ` [U-Boot] [U-Boot, RESEND, v2, " Tom Rini
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=1444841664-27773-2-git-send-email-s.temerkhanov@gmail.com \
--to=s.temerkhanov@gmail.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.