2 * Copyright (c) 2007, 2008, ETH Zurich.
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
13 #include <barrelfish_kpi/types.h>
17 * We can handle up to 6 UARTS; should be enough for anyone...
19 #define LPUART_MAX_PORTS 6
22 * \briefConfigure a port.
24 * This happens at system startup, and before the MMU is turned on.
25 * The hardware is not initialized by this call.
26 * After this, the UART is (hopefully) usable, but after the MMU is
27 * enabled the OS should then call pl011_init below.
29 extern void lpuart_configure(unsigned port, lpaddr_t addr);
32 * \brief Initialize a UART, and a number to refer to it in the
35 * \param port : Physical address of the UART.
36 * \param hwinit : Also init the hardware itself if True
38 extern void lpuart_init(unsigned port, lvaddr_t base, bool hwinit);
41 * \brief Put a character to the port
43 extern void lpuart_putchar(unsigned port, char c);
46 * \brief Read a character from a port
48 extern char lpuart_getchar(unsigned port);
50 #endif // __LPUART_H__