All of lore.kernel.org
 help / color / mirror / Atom feed
From: xf liu <7inchpalace@gmail.com>
To: Thomas Abraham <thomas.abraham@linaro.org>
Cc: linux-samsung-soc@vger.kernel.org
Subject: Re: kgdb on S5PV210
Date: Tue, 30 Aug 2011 14:46:49 +0800	[thread overview]
Message-ID: <CAK6dbMT0H9p3qpFhmUkRNeZXreuBFuW-86ar9aVqvQ-DAHTCFw@mail.gmail.com> (raw)
In-Reply-To: <CAJuYYwTrQdLYAPa1Uf9aFWHyNHfufff35-_unRNJ3mVmYdZ3BA@mail.gmail.com>

Hi Thomas,

Thanks for your reply.
I tried this patch, but the result is the same. :(
I use minicom in host PC as console terminal to display the kernel trace.
Is there still anything wrong?
Thanks.

Regards,
Ryan

2011/8/30 Thomas Abraham <thomas.abraham@linaro.org>:
> Hi Ryan,
>
> On 29 August 2011 12:33, xf liu <7inchpalace@gmail.com> wrote:
>>
>> Hi list,
>>
>>
>> I try to enable kgdb on S5PV210 using the same serial port (UART 0)
>> with the console, but after adding "kgdboc=ttySAC0,115200 kgdbwait" I
>> found tty_find_polling_driver returns NULL.
>> The cause is that the poll_get_char and poll_put_char handlers are not
>> set in static struct uart_ops s3c24xx_serial_ops.
>>
>> I tried google but do net found any patch for this, but maybe I lost
>> something.
>> Is there any patch I can get from anywhere or should I implement the
>> functions by myself?
>
> This has not been supported in the mainline yet. Following diff can be used
> for this but please note that this is not been compile and run tested.
>
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index ae7a302..5664ec0 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -66,6 +66,9 @@
>  /* flag to ignore all characters coming in */
>  #define RXSTAT_DUMMY_READ (0x10000000)
>
> +static char s3c24xx_serial_console_putchar(struct uart_port *port);
> +static char s3c24xx_serial_console_getchar(struct uart_port *port);
> +
>  static inline struct s3c24xx_uart_port *to_ourport(struct uart_port *port)
>  {
>      return container_of(port, struct s3c24xx_uart_port, port);
> @@ -957,6 +960,10 @@ static struct uart_ops s3c24xx_serial_ops = {
>      .request_port    = s3c24xx_serial_request_port,
>      .config_port    = s3c24xx_serial_config_port,
>      .verify_port    = s3c24xx_serial_verify_port,
> +#ifdef CONFIG_CONSOLE_POLL
> +    .poll_put_char    = s3c24xx_serial_console_putchar,
> +    .poll_get_char    = s3c24xx_serial_console_getchar,
> +#endif
>  };
>
>  static struct uart_driver s3c24xx_uart_drv = {
> @@ -1382,6 +1389,25 @@ s3c24xx_serial_console_txrdy(struct uart_port *port,
> unsigned int ufcon)
>      return (utrstat & S3C2410_UTRSTAT_TXE) ? 1 : 0;
>  }
>
> +static int
> +s3c24xx_serial_console_rxrdy(struct uart_port *port, unsigned int ufcon)
> +{
> +    struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
> +    unsigned long ufstat, utrstat;
> +
> +    if (ufcon & S3C2410_UFCON_FIFOMODE) {
> +        /* fifo mode - check amount of data in fifo registers... */
> +
> +        ufstat = rd_regl(port, S3C2410_UFSTAT);
> +        return (ufstat & info->rx_fifofull) ? 1 : 0;
> +    }
> +
> +    /* in non-fifo mode, we go and use the rx buffer full */
> +
> +    utrstat = rd_regl(port, S3C2410_UTRSTAT);
> +    return (utrstat & S3C2410_UTRSTAT_RXDR) ? 1 : 0;
> +}
> +
>  static void
>  s3c24xx_serial_console_putchar(struct uart_port *port, int ch)
>  {
> @@ -1391,6 +1417,15 @@ s3c24xx_serial_console_putchar(struct uart_port
> *port, int ch)
>      wr_regb(cons_uart, S3C2410_UTXH, ch);
>  }
>
> +static char
> +s3c24xx_serial_console_getchar(struct uart_port *port)
> +{
> +    unsigned int ufcon = rd_regl(cons_uart, S3C2410_UFCON);
> +    while (!s3c24xx_serial_console_rxrdy(port, ufcon))
> +        barrier();
> +    rd_regb(cons_uart, S3C2410_URXH);
> +}
> +
>  static void
>  s3c24xx_serial_console_write(struct console *co, const char *s,
>                   unsigned int count)
>
> Regards,
> Thomas.
>
>
>>
>> Thanks in advance.
>>
>> Regards,
>> Ryan
>> --
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-samsung-soc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

  parent reply	other threads:[~2011-08-30  6:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29  7:03 kgdb on S5PV210 xf liu
2011-08-29  7:13 ` xf liu
     [not found] ` <CAJuYYwTrQdLYAPa1Uf9aFWHyNHfufff35-_unRNJ3mVmYdZ3BA@mail.gmail.com>
2011-08-30  6:46   ` xf liu [this message]
2011-08-31  0:59     ` xf liu
2011-08-31  3:27       ` xf liu

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=CAK6dbMT0H9p3qpFhmUkRNeZXreuBFuW-86ar9aVqvQ-DAHTCFw@mail.gmail.com \
    --to=7inchpalace@gmail.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=thomas.abraham@linaro.org \
    /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.