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