Exemple #1
0
static void hi16xx_uart_flush(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	while (!(read32(base + UART_USR) & UART_USR_TFE_BIT))
		;
}
Exemple #2
0
static bool cdns_uart_have_rx_data(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	return !(read32(base + CDNS_UART_CHANNEL_STATUS) &
			CDNS_UART_CHANNEL_STATUS_REMPTY);
}
Exemple #3
0
static void atmel_uart_flush(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	while (!(io_read32(base + ATMEL_UART_SR) & ATMEL_SR_TXEMPTY))
		;
}
Exemple #4
0
static int cdns_uart_getchar(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	while (!cdns_uart_have_rx_data(chip))
		;
	return read32(base + CDNS_UART_FIFO) & 0xff;
}
Exemple #5
0
static void cdns_uart_flush(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	while (!(read32(base + CDNS_UART_CHANNEL_STATUS) &
		 CDNS_UART_CHANNEL_STATUS_TEMPTY))
		;
}
Exemple #6
0
static int pl011_getchar(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	while (!pl011_have_rx_data(chip))
		;
	return io_read32(base + UART_DR) & 0xff;
}
Exemple #7
0
static int hi16xx_uart_getchar(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	while (!hi16xx_uart_have_rx_data(chip))
		;
	return read32(base + UART_RBR) & 0xFF;
}
Exemple #8
0
static void atmel_uart_putc(struct serial_chip *chip, int ch)
{
	vaddr_t base = chip_to_base(chip);

	while (!(io_read32(base + ATMEL_UART_SR) & ATMEL_SR_TXRDY))
		;

	io_write32(base + ATMEL_UART_THR, ch);
}
Exemple #9
0
static int atmel_uart_getchar(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	while (io_read32(base + ATMEL_UART_SR) & ATMEL_SR_RXRDY)
		;

	return io_read32(base + ATMEL_UART_RHR);
}
Exemple #10
0
static void pl011_putc(struct serial_chip *chip, int ch)
{
	vaddr_t base = chip_to_base(chip);

	/* Wait until there is space in the FIFO or device is disabled */
	while (io_read32(base + UART_FR) & UART_FR_TXFF)
		;

	/* Send the character */
	io_write32(base + UART_DR, ch);
}
Exemple #11
0
static void hi16xx_uart_putc(struct serial_chip *chip, int ch)
{
	vaddr_t base = chip_to_base(chip);

	/* Wait until TX FIFO is empty */
	while (!(read32(base + UART_USR) & UART_USR_TFE_BIT))
		;

	/* Put character into TX FIFO */
	write32(ch & 0xFF, base + UART_THR);
}
Exemple #12
0
static void cdns_uart_putc(struct serial_chip *chip, int ch)
{
	vaddr_t base = chip_to_base(chip);

	/* Wait until there is space in the FIFO */
	while (read32(base + CDNS_UART_CHANNEL_STATUS) &
			CDNS_UART_CHANNEL_STATUS_TFUL)
		;

	/* Send the character */
	write32(ch, base + CDNS_UART_FIFO);
}
Exemple #13
0
static void pl011_flush(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	/*
	 * Wait for the transmit FIFO to be empty.
	 * It can happen that Linux initializes the OP-TEE driver with the
	 * console UART disabled; avoid an infinite loop by checking the UART
	 * enabled flag. Checking it in the loop makes the code safe against
	 * asynchronous disable.
	 */
	while ((io_read32(base + UART_CR) & UART_CR_UARTEN) &&
	       !(io_read32(base + UART_FR) & UART_FR_TXFE))
		;
}
Exemple #14
0
static bool pl011_have_rx_data(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	return !(io_read32(base + UART_FR) & UART_FR_RXFE);
}
Exemple #15
0
static bool hi16xx_uart_have_rx_data(struct serial_chip *chip)
{
	vaddr_t base = chip_to_base(chip);

	return (read32(base + UART_USR) & UART_USR_RFNE_BIT);
}