/* Read a single byte from the serial port. Returns 1 on success, 0 otherwise. When the function is succesfull, the character read is written into its argument c.  */
int pxa_getc_dev(unsigned int uart_index)
/* Read a single byte from the serial port. Returns 1 on success, 0 otherwise. When the function is succesfull, the character read is written into its argument c.  */
int pxa_getc_dev(unsigned int uart_index)
{
	struct pxa_uart_regs *uart_regs;
	uart_regs = pxa_uart_index_to_regs(uart_index);
	if (!uart_regs)
		return -1;
	while (!(readl(&uart_regs->lsr) & LSR_DR))
		WATCHDOG_RESET();
	return readl(&uart_regs->rbr) & 0xff;
}