1139735Simp/*- 2135669Scognet * Copyright (c) 2003 Marcel Moolenaar 3135669Scognet * All rights reserved. 4135669Scognet * 5135669Scognet * Redistribution and use in source and binary forms, with or without 6135669Scognet * modification, are permitted provided that the following conditions 7135669Scognet * are met: 8135669Scognet * 9135669Scognet * 1. Redistributions of source code must retain the above copyright 10135669Scognet * notice, this list of conditions and the following disclaimer. 11135669Scognet * 2. Redistributions in binary form must reproduce the above copyright 12135669Scognet * notice, this list of conditions and the following disclaimer in the 13135669Scognet * documentation and/or other materials provided with the distribution. 14135669Scognet * 15135669Scognet * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16135669Scognet * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17135669Scognet * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18135669Scognet * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19135669Scognet * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20135669Scognet * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21135669Scognet * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22135669Scognet * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23135669Scognet * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24135669Scognet * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25135669Scognet */ 26135669Scognet 27135669Scognet#include <sys/cdefs.h> 28135669Scognet__FBSDID("$FreeBSD$"); 29135669Scognet 30135669Scognet#include <sys/param.h> 31135669Scognet#include <sys/systm.h> 32135669Scognet#include <sys/bus.h> 33135669Scognet#include <sys/cons.h> 34135669Scognet#include <machine/bus.h> 35135669Scognet 36135669Scognet#include <dev/uart/uart.h> 37135669Scognet#include <dev/uart/uart_cpu.h> 38135669Scognet 39135669Scognet#include <arm/xscale/i80321/i80321var.h> 40135669Scognet#include <arm/xscale/i80321/obiovar.h> 41135669Scognet 42135669Scognetbus_space_tag_t uart_bus_space_io; 43135669Scognetbus_space_tag_t uart_bus_space_mem; 44135669Scognet 45135669Scognetint 46135669Scognetuart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) 47135669Scognet{ 48135669Scognet return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0); 49135669Scognet} 50135669Scognet 51135669Scognetint 52135669Scognetuart_cpu_getdev(int devtype, struct uart_devinfo *di) 53135669Scognet{ 54168281Smarcel di->ops = uart_getops(&uart_ns8250_class); 55135669Scognet di->bas.chan = 0; 56278727Sian di->bas.bst = obio_bs_tag; 57135669Scognet di->bas.regshft = 0; 58135669Scognet di->bas.rclk = 0; 59135669Scognet di->baudrate = 115200; 60135669Scognet di->databits = 8; 61135669Scognet di->stopbits = 1; 62135669Scognet di->parity = UART_PARITY_NONE; 63278727Sian uart_bus_space_io = obio_bs_tag; 64135669Scognet uart_bus_space_mem = NULL; 65135669Scognet di->bas.bsh = 0xfe800000; 66135669Scognet return (0); 67135669Scognet} 68