Re: [PATCH] serial: imx: add console polling routines for kgdboc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 13, 2008 at 3:27 AM, Atsuo Igarashi
<atsuo_igarashi@xxxxxxxxxxxxxx> wrote:
> Add console polling routines for the imx uart with kgdboc.
>
> Signed-off-by Atsuo Igarashi <atsuo_igarashi@xxxxxxxxxxxxxx>
>

In imx_get_poll_char() the code returns the result of reading the urxd
register.  That register has the 8 bits of receive data in it, but in
the next byte up also has 4 bits of error flags (overrun, frame,
break, parity) and an error summary bit which are being ignored.
Maybe something like this?

static int imx_get_poll_char(struct uart_port *port)
{
	struct imx_port *sport = (struct imx_port *)port;
	int ch;

	while (1) {
                while (!(readl(sport->port.membase + USR2) & USR2_RDR));

	        ch = readl(sport->port.membase + URXD0);

                if (!(ch & URXD_ERR))
                        return(ch & 0xff);
                /* else throw away the char with the error and try
again (or return an error value?) */
        }
}


-- 
Hardware, n.:
 The parts of a computer system that can be kicked.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux