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

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [platform/] [pb11mpcore/] [uart.c] - Blame information for rev 6

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

Line No. Rev Author Line
1 2 drasko
/*
2
 * Ties up platform's uart driver functions with generic API
3
 *
4
 * Copyright (C) 2007 Bahadir Balban
5
 */
6
#include <l4/generic/platform.h>
7
#include INC_PLAT(platform.h)
8
 
9
#include <l4/drivers/uart/pl011/pl011_uart.h>
10
 
11
extern struct pl011_uart uart;
12
 
13
void uart_init()
14
{
15
        /* We are using UART0 for kernel */
16
        uart.base = PLATFORM_CONSOLE0_BASE;
17
        pl011_initialise_device(&uart);
18
}
19
 
20
/* Generic uart function that lib/putchar.c expects to see implemented */
21
void uart_putc(char c)
22
{
23
        int res;
24
        /* Platform specific uart implementation */
25
        do {
26
                res = pl011_tx_char(uart.base, c);
27
        } while (res < 0);
28
}
29
 

powered by: WebSVN 2.1.0

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