1171626Scognet/*-
2171626Scognet * Copyright (c) 2003 Marcel Moolenaar
3171626Scognet * All rights reserved.
4171626Scognet *
5171626Scognet * Redistribution and use in source and binary forms, with or without
6171626Scognet * modification, are permitted provided that the following conditions
7171626Scognet * are met:
8171626Scognet *
9171626Scognet * 1. Redistributions of source code must retain the above copyright
10171626Scognet *    notice, this list of conditions and the following disclaimer.
11171626Scognet * 2. Redistributions in binary form must reproduce the above copyright
12171626Scognet *    notice, this list of conditions and the following disclaimer in the
13171626Scognet *    documentation and/or other materials provided with the distribution.
14171626Scognet *
15171626Scognet * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16171626Scognet * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17171626Scognet * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18171626Scognet * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19171626Scognet * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20171626Scognet * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21171626Scognet * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22171626Scognet * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23171626Scognet * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24171626Scognet * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25171626Scognet */
26171626Scognet
27171626Scognet#include <sys/cdefs.h>
28171626Scognet__FBSDID("$FreeBSD$");
29171626Scognet
30171626Scognet#include <sys/param.h>
31171626Scognet#include <sys/systm.h>
32171626Scognet#include <sys/bus.h>
33171626Scognet#include <sys/cons.h>
34171626Scognet#include <machine/bus.h>
35171626Scognet
36171626Scognet#include <dev/uart/uart.h>
37171626Scognet#include <dev/uart/uart_cpu.h>
38171626Scognet
39171626Scognet#include <arm/xscale/i8134x/i81342reg.h>
40171626Scognet#include <arm/xscale/i8134x/obiovar.h>
41171626Scognet
42171626Scognetbus_space_tag_t uart_bus_space_io;
43171626Scognetbus_space_tag_t uart_bus_space_mem;
44171626Scognet
45171626Scognetint
46171626Scognetuart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)
47171626Scognet{
48171626Scognet	return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0);
49171626Scognet}
50171626Scognet
51171626Scognetint
52171626Scognetuart_cpu_getdev(int devtype, struct uart_devinfo *di)
53171626Scognet{
54171626Scognet
55171626Scognet	di->ops = uart_getops(&uart_ns8250_class);
56171626Scognet	di->bas.chan = 0;
57171626Scognet	di->bas.bst = &obio_bs_tag;
58171626Scognet	di->bas.regshft = 2;
59171626Scognet	di->bas.rclk = 33334000;
60171626Scognet	di->baudrate = 115200;
61171626Scognet	di->databits = 8;
62171626Scognet	di->stopbits = 1;
63171626Scognet	di->parity = UART_PARITY_NONE;
64171626Scognet	uart_bus_space_io = &obio_bs_tag;
65171626Scognet	uart_bus_space_mem = NULL;
66171626Scognet	di->bas.bsh = IOP34X_UART0_VADDR;
67171626Scognet	return (0);
68171626Scognet}
69