OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [platform/] [pb11mpcore/] [uart.c] - Rev 7

Go to most recent revision | Compare with Previous | Blame | View Log

/*
 * Ties up platform's uart driver functions with generic API
 *
 * Copyright (C) 2007 Bahadir Balban
 */
#include <l4/generic/platform.h>
#include INC_PLAT(platform.h)
 
#include <l4/drivers/uart/pl011/pl011_uart.h>
 
extern struct pl011_uart uart;
 
void uart_init()
{
	/* We are using UART0 for kernel */
	uart.base = PLATFORM_CONSOLE0_BASE;
	pl011_initialise_device(&uart);
}
 
/* Generic uart function that lib/putchar.c expects to see implemented */
void uart_putc(char c)
{
	int res;
	/* Platform specific uart implementation */
	do {
		res = pl011_tx_char(uart.base, c);
	} while (res < 0);
}
 
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.