Exemplo n.º 1
0
void imx_lowlevel_putc(virtual_addr_t base, u8 ch)
{
	/* Wait until there is space in the FIFO */
	while (!imx_lowlevel_can_putc(base)) ;

	/* Send the character */
	vmm_writel(ch, (void *)(base + URTX0));
}
Exemplo n.º 2
0
static int imx_defterm_putc(u8 ch)
{
	if (!imx_lowlevel_can_putc(imx_defterm_base)) {
		return VMM_EFAIL;
	}
	imx_lowlevel_putc(imx_defterm_base, ch);
	return VMM_OK;
}
Exemplo n.º 3
0
static void imx_putc_sleepable(struct imx_port *port, u8 ch)
{
	/* Wait until there is space in the FIFO */
	if (!imx_lowlevel_can_putc(port->base)) {
		/* Enable the RX interrupt */
		port->mask |= UCR1_TRDYEN;
		vmm_writel(port->mask, (void *)port->base + UCR1);
		/* Wait for completion */
		vmm_completion_wait(&port->write_possible);
	}

	/* Write data to FIFO */
	imx_lowlevel_putc(port->base, ch);
}
Exemplo n.º 4
0
static u32 imx_tx(struct serial *p, u8 *src, size_t len)
{
	u32 i;
	struct imx_port *port = serial_tx_priv(p);

	for (i = 0; i < len; i++) {
		if (!imx_lowlevel_can_putc(port->base)) {
			break;
		}
		imx_lowlevel_putc(port->base, src[i]);
	}

	return i;
}