All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Chou <thomas@wytron.com.tw>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] serial: uartlite: Add support for debug console
Date: Tue, 15 Dec 2015 12:01:07 +0800	[thread overview]
Message-ID: <566F9083.7090007@wytron.com.tw> (raw)
In-Reply-To: <566EE533.4070708@xilinx.com>

Hi Michal,

On 2015?12?14? 23:50, Michal Simek wrote:
> Hi,
>
> On 14.12.2015 14:14, Thomas Chou wrote:
>> Hi Michal,
>>
>> On 2015?12?11? 19:54, Michal Simek wrote:
>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>> ---
>>>
>>>    drivers/serial/Kconfig            |  7 +++++++
>>>    drivers/serial/serial_xuartlite.c | 23 +++++++++++++++++++++++
>>>    2 files changed, 30 insertions(+)
>>>
>>> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
>>> index 1fc287ee98ec..f1e221799b81 100644
>>> --- a/drivers/serial/Kconfig
>>> +++ b/drivers/serial/Kconfig
>>> @@ -92,6 +92,13 @@ config DEBUG_UART_S5P
>>>          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_UARTLITE
>>> +    bool "Xilinx Uartlite"
>>> +    help
>>> +      Select this to enable a debug UART using the serial_uartlite
>>> 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_ZYNQ
>>>        bool "Xilinx Zynq"
>>>        help
>>> diff --git a/drivers/serial/serial_xuartlite.c
>>> b/drivers/serial/serial_xuartlite.c
>>> index 10089f5a34b5..fe87b515d902 100644
>>> --- a/drivers/serial/serial_xuartlite.c
>>> +++ b/drivers/serial/serial_xuartlite.c
>>> @@ -120,3 +120,26 @@ U_BOOT_DRIVER(serial_uartlite) = {
>>>        .ops    = &uartlite_serial_ops,
>>>        .flags = DM_FLAG_PRE_RELOC,
>>>    };
>>> +
>>> +#ifdef CONFIG_DEBUG_UART_UARTLITE
>>
>> Better move the "#include <debug_uart.h>" here.
>
> This is the patch I sent some days ago about removing it from this
> location and it was Reviewed twice.
> http://lists.denx.de/pipermail/u-boot/2015-December/236341.html
>
>>

This is because commit 42800ffa7997 ("arm: zynq: Move serial driver to 
driver model") added the extra #include <debug_uart.h>. It is this one 
should be removed. The original one in commit c54c0a4c1c74 ("arm: zynq: 
Support the debug UART") is good. The wrong one was removed.


>>> +void _debug_uart_init(void)
>>
>> Please add "static inline" to void _debug_uart_init(void).
>
> Ok. Will fix this for uartlite and zynq uart in follow up patch.
>
>
>>> +{
>>> +    struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
>>> +
>>> +    out_be32(&regs->control, 0);
>>> +    out_be32(&regs->control, ULITE_CONTROL_RST_RX |
>>> ULITE_CONTROL_RST_TX);
>>> +    in_be32(&regs->control);
>>> +}
>>> +
>>> +static inline void _debug_uart_putc(int ch)
>>> +{
>>> +    struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
>>> +
>>> +    while (in_be32(&regs->status) & SR_TX_FIFO_FULL)
>>> +        WATCHDOG_RESET();
>>
>> WATCHDOG_RESET() is not really needed for debug serial output.
>
> TBH I don't think so. There could be watchdog running from early
> bootloader and needs to be service even for debugging purpose.
>

Unless the serial input clock is dead, the serial shift out in UART 
won't take so long to trigger watchdog.

Best regards,
Thomas

  reply	other threads:[~2015-12-15  4:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 11:54 [U-Boot] [PATCH 0/3] Moving Uartlite to DM Michal Simek
2015-12-11 11:54 ` [U-Boot] [PATCH 1/3] serial: uartlite: Move driver " Michal Simek
2015-12-14 14:47   ` Thomas Chou
2015-12-14 16:03     ` Michal Simek
2015-12-11 11:54 ` [U-Boot] [PATCH 2/3] serial: uartlite: Add support for debug console Michal Simek
2015-12-14 13:14   ` Thomas Chou
2015-12-14 15:50     ` Michal Simek
2015-12-15  4:01       ` Thomas Chou [this message]
2015-12-15 15:38         ` Michal Simek
2015-12-16  0:25           ` Thomas Chou
2015-12-11 11:54 ` [U-Boot] [PATCH 3/3] serial: uartlite: Add uartlite to Kconfig Michal Simek
2015-12-14 14:35   ` Thomas Chou
2015-12-14 15:42     ` Michal Simek
2015-12-15  4:02       ` Thomas Chou
2015-12-15 15:39         ` Michal Simek
2015-12-16  0:23           ` Thomas Chou

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=566F9083.7090007@wytron.com.tw \
    --to=thomas@wytron.com.tw \
    --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.