xref: /optee_os/core/include/drivers/pl011.h (revision f182814baed166c2b359f350b325b073bf4675c8)
1db886a7fSJerome Forissier /*
2db886a7fSJerome Forissier  * Copyright (c) 2014, Linaro Limited
3db886a7fSJerome Forissier  * All rights reserved.
4db886a7fSJerome Forissier  *
5db886a7fSJerome Forissier  * Redistribution and use in source and binary forms, with or without
6db886a7fSJerome Forissier  * modification, are permitted provided that the following conditions are met:
7db886a7fSJerome Forissier  *
8db886a7fSJerome Forissier  * 1. Redistributions of source code must retain the above copyright notice,
9db886a7fSJerome Forissier  * this list of conditions and the following disclaimer.
10db886a7fSJerome Forissier  *
11db886a7fSJerome Forissier  * 2. Redistributions in binary form must reproduce the above copyright notice,
12db886a7fSJerome Forissier  * this list of conditions and the following disclaimer in the documentation
13db886a7fSJerome Forissier  * and/or other materials provided with the distribution.
14db886a7fSJerome Forissier  *
15db886a7fSJerome Forissier  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16db886a7fSJerome Forissier  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17db886a7fSJerome Forissier  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18db886a7fSJerome Forissier  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19db886a7fSJerome Forissier  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20db886a7fSJerome Forissier  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21db886a7fSJerome Forissier  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22db886a7fSJerome Forissier  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23db886a7fSJerome Forissier  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24db886a7fSJerome Forissier  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25db886a7fSJerome Forissier  * POSSIBILITY OF SUCH DAMAGE.
26db886a7fSJerome Forissier  */
27db886a7fSJerome Forissier #ifndef PL011_H
28db886a7fSJerome Forissier #define PL011_H
29db886a7fSJerome Forissier 
30db886a7fSJerome Forissier #include <types_ext.h>
31*f182814bSJerome Forissier #include <drivers/serial.h>
32db886a7fSJerome Forissier 
338d31bf67SJens Wiklander #define PL011_REG_SIZE	0x1000
348d31bf67SJens Wiklander 
35*f182814bSJerome Forissier struct pl011_data {
36*f182814bSJerome Forissier 	struct io_pa_va base;
37*f182814bSJerome Forissier 	struct serial_chip chip;
38*f182814bSJerome Forissier };
39db886a7fSJerome Forissier 
40*f182814bSJerome Forissier void pl011_init(struct pl011_data *pd, paddr_t base, uint32_t uart_clk,
41*f182814bSJerome Forissier 		uint32_t baud_rate);
42db886a7fSJerome Forissier 
43db886a7fSJerome Forissier #endif /* PL011_H */
44