uart_cpu_i81342.c revision 331890
1298674Sgonzo/*-
2298674Sgonzo * Copyright (c) 2003 Marcel Moolenaar
3298674Sgonzo * All rights reserved.
4298674Sgonzo *
5298674Sgonzo * Redistribution and use in source and binary forms, with or without
6298674Sgonzo * modification, are permitted provided that the following conditions
7298674Sgonzo * are met:
8298674Sgonzo *
9298674Sgonzo * 1. Redistributions of source code must retain the above copyright
10298674Sgonzo *    notice, this list of conditions and the following disclaimer.
11298674Sgonzo * 2. Redistributions in binary form must reproduce the above copyright
12298674Sgonzo *    notice, this list of conditions and the following disclaimer in the
13298674Sgonzo *    documentation and/or other materials provided with the distribution.
14298674Sgonzo *
15298674Sgonzo * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16298674Sgonzo * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17298674Sgonzo * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18298674Sgonzo * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19298674Sgonzo * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20298674Sgonzo * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21298674Sgonzo * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22298674Sgonzo * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23298674Sgonzo * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24298674Sgonzo * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25298674Sgonzo */
26298674Sgonzo
27298674Sgonzo#include <sys/cdefs.h>
28298674Sgonzo__FBSDID("$FreeBSD: stable/11/sys/arm/xscale/i8134x/uart_cpu_i81342.c 331890 2018-04-02 22:02:49Z gonzo $");
29298674Sgonzo
30298674Sgonzo#include <sys/param.h>
31298674Sgonzo#include <sys/systm.h>
32298674Sgonzo#include <sys/bus.h>
33298674Sgonzo#include <sys/cons.h>
34298674Sgonzo#include <machine/bus.h>
35298674Sgonzo
36298674Sgonzo#include <dev/uart/uart.h>
37298674Sgonzo#include <dev/uart/uart_cpu.h>
38298674Sgonzo
39298674Sgonzo#include <arm/xscale/i8134x/i81342reg.h>
40298674Sgonzo#include <arm/xscale/i8134x/obiovar.h>
41298674Sgonzo
42298674Sgonzobus_space_tag_t uart_bus_space_io;
43298674Sgonzobus_space_tag_t uart_bus_space_mem;
44298674Sgonzo
45298674Sgonzoint
46298674Sgonzouart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)
47298674Sgonzo{
48298674Sgonzo	return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0);
49298674Sgonzo}
50298674Sgonzo
51298674Sgonzoint
52298674Sgonzouart_cpu_getdev(int devtype, struct uart_devinfo *di)
53298674Sgonzo{
54298674Sgonzo
55298674Sgonzo	di->ops = uart_getops(&uart_ns8250_class);
56298674Sgonzo	di->bas.chan = 0;
57298674Sgonzo	di->bas.bst = arm_base_bs_tag;
58298674Sgonzo	di->bas.regshft = 2;
59298674Sgonzo	di->bas.rclk = 33334000;
60298674Sgonzo	di->baudrate = 115200;
61298674Sgonzo	di->databits = 8;
62298674Sgonzo	di->stopbits = 1;
63298674Sgonzo	di->parity = UART_PARITY_NONE;
64298674Sgonzo	uart_bus_space_io = arm_base_bs_tag;
65298674Sgonzo	uart_bus_space_mem = NULL;
66298674Sgonzo	di->bas.bsh = IOP34X_UART0_VADDR;
67298674Sgonzo	return (0);
68298674Sgonzo}
69298674Sgonzo