imx31_uart.c revision 1.1
11.1Sbsh/* 21.1Sbsh * Copyright (c) 2009, 2010 Genetec Corporation. All rights reserved. 31.1Sbsh * Written by Hiroyuki Bessho for Genetec Corporation. 41.1Sbsh * 51.1Sbsh * Redistribution and use in source and binary forms, with or without 61.1Sbsh * modification, are permitted provided that the following conditions 71.1Sbsh * are met: 81.1Sbsh * 1. Redistributions of source code must retain the above copyright 91.1Sbsh * notice, this list of conditions and the following disclaimer. 101.1Sbsh * 2. Redistributions in binary form must reproduce the above copyright 111.1Sbsh * notice, this list of conditions and the following disclaimer in the 121.1Sbsh * documentation and/or other materials provided with the distribution. 131.1Sbsh * 141.1Sbsh * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND 151.1Sbsh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 161.1Sbsh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 171.1Sbsh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION 181.1Sbsh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 191.1Sbsh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 201.1Sbsh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 211.1Sbsh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 221.1Sbsh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 231.1Sbsh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 241.1Sbsh * POSSIBILITY OF SUCH DAMAGE. 251.1Sbsh * 261.1Sbsh */ 271.1Sbsh 281.1Sbsh#include "opt_imxuart.h" 291.1Sbsh#include <sys/param.h> 301.1Sbsh#include <sys/bus.h> 311.1Sbsh#include <sys/device.h> 321.1Sbsh#include <arm/imx/imx31reg.h> 331.1Sbsh#include <arm/imx/imx31var.h> 341.1Sbsh#include <arm/imx/imxuartreg.h> 351.1Sbsh#include <arm/imx/imxuartvar.h> 361.1Sbsh 371.1Sbsh 381.1Sbshint 391.1Sbshimxuart_match(struct device *parent, struct cfdata *cf, void *aux) 401.1Sbsh{ 411.1Sbsh struct aips_attach_args * const aipsa = aux; 421.1Sbsh 431.1Sbsh switch (aipsa->aipsa_addr) { 441.1Sbsh case UART1_BASE: 451.1Sbsh case UART2_BASE: 461.1Sbsh case UART3_BASE: 471.1Sbsh case UART4_BASE: 481.1Sbsh case UART5_BASE: 491.1Sbsh return 1; 501.1Sbsh } 511.1Sbsh 521.1Sbsh return 0; 531.1Sbsh} 541.1Sbsh 551.1Sbshvoid 561.1Sbshimxuart_attach(struct device *parent, struct device *self, void *aux) 571.1Sbsh{ 581.1Sbsh struct aips_attach_args * aa = aux; 591.1Sbsh 601.1Sbsh imxuart_attach_common(parent, self, 611.1Sbsh aa->aipsa_memt, aa->aipsa_addr, aa->aipsa_size, aa->aipsa_intr, 0); 621.1Sbsh} 631.1Sbsh 64