uart_cpu_ixp425.c revision 164426
1164426Ssam/*- 2164426Ssam * Copyright (c) 2003 Marcel Moolenaar 3164426Ssam * All rights reserved. 4164426Ssam * 5164426Ssam * Redistribution and use in source and binary forms, with or without 6164426Ssam * modification, are permitted provided that the following conditions 7164426Ssam * are met: 8164426Ssam * 9164426Ssam * 1. Redistributions of source code must retain the above copyright 10164426Ssam * notice, this list of conditions and the following disclaimer. 11164426Ssam * 2. Redistributions in binary form must reproduce the above copyright 12164426Ssam * notice, this list of conditions and the following disclaimer in the 13164426Ssam * documentation and/or other materials provided with the distribution. 14164426Ssam * 15164426Ssam * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16164426Ssam * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17164426Ssam * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18164426Ssam * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19164426Ssam * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20164426Ssam * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21164426Ssam * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22164426Ssam * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23164426Ssam * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24164426Ssam * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25164426Ssam */ 26164426Ssam 27164426Ssam#include <sys/cdefs.h> 28164426Ssam__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/uart_cpu_ixp425.c 164426 2006-11-19 23:55:23Z sam $"); 29164426Ssam 30164426Ssam#include <sys/param.h> 31164426Ssam#include <sys/systm.h> 32164426Ssam#include <sys/bus.h> 33164426Ssam#include <sys/cons.h> 34164426Ssam#include <machine/bus.h> 35164426Ssam 36164426Ssam#include <dev/uart/uart.h> 37164426Ssam#include <dev/uart/uart_cpu.h> 38164426Ssam 39164426Ssam#include <arm/xscale/ixp425/ixp425reg.h> 40164426Ssam#include <arm/xscale/ixp425/ixp425var.h> 41164426Ssam 42164426Ssambus_space_tag_t uart_bus_space_io; 43164426Ssambus_space_tag_t uart_bus_space_mem; 44164426Ssam 45164426Ssamint 46164426Ssamuart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) 47164426Ssam{ 48164426Ssam return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0); 49164426Ssam} 50164426Ssam 51164426Ssamint 52164426Ssamuart_cpu_getdev(int devtype, struct uart_devinfo *di) 53164426Ssam{ 54164426Ssam di->ops = uart_ns8250_ops; 55164426Ssam di->bas.chan = 0; 56164426Ssam di->bas.bst = &ixp425_a4x_bs_tag; 57164426Ssam di->bas.regshft = 0; 58164426Ssam di->bas.rclk = IXP425_UART_FREQ; 59164426Ssam di->baudrate = 115200; 60164426Ssam di->databits = 8; 61164426Ssam di->stopbits = 1; 62164426Ssam di->parity = UART_PARITY_NONE; 63164426Ssam uart_bus_space_io = &ixp425_a4x_bs_tag; 64164426Ssam uart_bus_space_mem = NULL; 65164426Ssam di->bas.bsh = IXP425_UART0_VBASE; 66164426Ssam return (0); 67164426Ssam} 68