uart_bus_isa.c revision 134312
1100966Siwasaki/* 2100966Siwasaki * Copyright (c) 2001 M. Warner Losh. All rights reserved. 3100966Siwasaki * 4126372Snjl * Redistribution and use in source and binary forms, with or without 5100966Siwasaki * modification, are permitted provided that the following conditions 6100966Siwasaki * are met: 7100966Siwasaki * 1. Redistributions of source code must retain the above copyright 8100966Siwasaki * notice, this list of conditions and the following disclaimer. 9100966Siwasaki * 2. Redistributions in binary form must reproduce the above copyright 10100966Siwasaki * notice, this list of conditions and the following disclaimer in the 11100966Siwasaki * documentation and/or other materials provided with the distribution. 12126372Snjl * 13100966Siwasaki * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14100966Siwasaki * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15100966Siwasaki * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16100966Siwasaki * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17100966Siwasaki * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18100966Siwasaki * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19100966Siwasaki * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20100966Siwasaki * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21100966Siwasaki * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22100966Siwasaki * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23100966Siwasaki */ 24100966Siwasaki 25100966Siwasaki#include <sys/cdefs.h> 26100966Siwasaki__FBSDID("$FreeBSD: head/sys/dev/uart/uart_bus_isa.c 134312 2004-08-25 22:15:33Z marius $"); 27100966Siwasaki 28100966Siwasaki#include <sys/param.h> 29100966Siwasaki#include <sys/systm.h> 30100966Siwasaki#include <sys/bus.h> 31100966Siwasaki#include <sys/conf.h> 32100966Siwasaki#include <sys/kernel.h> 33100966Siwasaki#include <sys/module.h> 34100966Siwasaki#include <machine/bus.h> 35100966Siwasaki#include <sys/rman.h> 36100966Siwasaki#include <machine/resource.h> 37100966Siwasaki 38100966Siwasaki#include <isa/isavar.h> 39100966Siwasaki 40100966Siwasaki#include <dev/uart/uart.h> 41100966Siwasaki#include <dev/uart/uart_bus.h> 42100966Siwasaki#include <dev/uart/uart_cpu.h> 43100966Siwasaki 44100966Siwasakistatic int uart_isa_probe(device_t dev); 45100966Siwasaki 46100966Siwasakistatic device_method_t uart_isa_methods[] = { 47100966Siwasaki /* Device interface */ 48100966Siwasaki DEVMETHOD(device_identify, uart_cpu_identify), 49100966Siwasaki DEVMETHOD(device_probe, uart_isa_probe), 50100966Siwasaki DEVMETHOD(device_attach, uart_bus_attach), 51100966Siwasaki DEVMETHOD(device_detach, uart_bus_detach), 52100966Siwasaki { 0, 0 } 53100966Siwasaki}; 54100966Siwasaki 55100966Siwasakistatic driver_t uart_isa_driver = { 56100966Siwasaki uart_driver_name, 57100966Siwasaki uart_isa_methods, 58100966Siwasaki sizeof(struct uart_softc), 59100966Siwasaki}; 60100966Siwasaki 61100966Siwasakistatic struct isa_pnp_id isa_ns8250_ids[] = { 62100966Siwasaki {0x0005d041, "Standard PC COM port"}, /* PNP0500 */ 63100966Siwasaki {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */ 64100966Siwasaki {0x0205d041, "Multiport serial device (non-intelligent 16550)"}, /* PNP0502 */ 65100966Siwasaki {0x1005d041, "Generic IRDA-compatible device"}, /* PNP0510 */ 66100966Siwasaki {0x1105d041, "Generic IRDA-compatible device"}, /* PNP0511 */ 67100966Siwasaki /* Devices that do not have a compatid */ 68100966Siwasaki {0x12206804, NULL}, /* ACH2012 - 5634BTS 56K Video Ready Modem */ 69100966Siwasaki {0x7602a904, NULL}, /* AEI0276 - 56K v.90 Fax Modem (LKT) */ 70100966Siwasaki {0x00007905, NULL}, /* AKY0000 - 56K Plug&Play Modem */ 71100966Siwasaki {0x21107905, NULL}, /* AKY1021 - 56K Plug&Play Modem */ 72100966Siwasaki {0x01405407, NULL}, /* AZT4001 - AZT3000 PnP SOUND DEVICE, MODEM */ 73100966Siwasaki {0x56039008, NULL}, /* BDP0356 - Best Data 56x2 */ 74100966Siwasaki {0x56159008, NULL}, /* BDP1556 - B.D. Smart One 56SPS,Voice Modem*/ 75100966Siwasaki {0x36339008, NULL}, /* BDP3336 - Best Data Prods. 336F */ 76100966Siwasaki {0x0014490a, NULL}, /* BRI1400 - Boca 33.6 PnP */ 77100966Siwasaki {0x0015490a, NULL}, /* BRI1500 - Internal Fax Data */ 78100966Siwasaki {0x0034490a, NULL}, /* BRI3400 - Internal ACF Modem */ 79100966Siwasaki {0x0094490a, NULL}, /* BRI9400 - Boca K56Flex PnP */ 80100966Siwasaki {0x00b4490a, NULL}, /* BRIB400 - Boca 56k PnP */ 81100966Siwasaki {0x0030320d, NULL}, /* CIR3000 - Cirrus Logic V43 */ 82100966Siwasaki {0x0100440e, NULL}, /* CRD0001 - Cardinal MVP288IV ? */ 83100966Siwasaki {0x01308c0e, NULL}, /* CTL3001 - Creative Labs Phoneblaster */ 84100966Siwasaki {0x36033610, NULL}, /* DAV0336 - DAVICOM 336PNP MODEM */ 85100966Siwasaki {0x01009416, NULL}, /* ETT0001 - E-Tech Bullet 33k6 PnP */ 86100966Siwasaki {0x0000aa1a, NULL}, /* FUJ0000 - FUJITSU Modem 33600 PNP/I2 */ 87100966Siwasaki {0x1200c31e, NULL}, /* GVC0012 - VF1128HV-R9 (win modem?) */ 88100966Siwasaki {0x0303c31e, NULL}, /* GVC0303 - MaxTech 33.6 PnP D/F/V */ 89100966Siwasaki {0x0505c31e, NULL}, /* GVC0505 - GVC 56k Faxmodem */ 90100966Siwasaki {0x0116c31e, NULL}, /* GVC1601 - Rockwell V.34 Plug & Play Modem */ 91100966Siwasaki {0x0050c31e, NULL}, /* GVC5000 - some GVC modem */ 92100966Siwasaki {0x3800f91e, NULL}, /* GWY0038 - Telepath with v.90 */ 93100966Siwasaki {0x9062f91e, NULL}, /* GWY6290 - Telepath with x2 Technology */ 94100966Siwasaki {0x8100e425, NULL}, /* IOD0081 - I-O DATA DEVICE,INC. IFML-560 */ 95100966Siwasaki {0x71004d24, NULL}, /* IBM0071 - IBM ThinkPad 240 IrDA controller*/ 96100966Siwasaki {0x21002534, NULL}, /* MAE0021 - Jetstream Int V.90 56k Voice Series 2*/ 97100966Siwasaki {0x0000f435, NULL}, /* MOT0000 - Motorola ModemSURFR 33.6 Intern */ 98100966Siwasaki {0x5015f435, NULL}, /* MOT1550 - Motorola ModemSURFR 56K Modem */ 99100966Siwasaki {0xf015f435, NULL}, /* MOT15F0 - Motorola VoiceSURFR 56K Modem */ 100100966Siwasaki {0x6045f435, NULL}, /* MOT4560 - Motorola ? */ 101100966Siwasaki {0x61e7a338, NULL}, /* NECE761 - 33.6Modem */ 102100966Siwasaki {0x0160633a, NULL}, /* NSC6001 - National Semi's IrDA Controller*/ 103100966Siwasaki {0x08804f3f, NULL}, /* OZO8008 - Zoom (33.6k Modem) */ 104100966Siwasaki {0x0f804f3f, NULL}, /* OZO800f - Zoom 2812 (56k Modem) */ 105100966Siwasaki {0x39804f3f, NULL}, /* OZO8039 - Zoom 56k flex */ 106100966Siwasaki {0x00914f3f, NULL}, /* OZO9100 - Zoom 2919 (K56 Faxmodem) */ 107100966Siwasaki {0x3024a341, NULL}, /* PMC2430 - Pace 56 Voice Internal Modem */ 108100966Siwasaki {0x1000eb49, NULL}, /* ROK0010 - Rockwell ? */ 109100966Siwasaki {0x1200b23d, NULL}, /* RSS0012 - OMRON ME5614ISA */ 110100966Siwasaki {0x5002734a, NULL}, /* RSS0250 - 5614Jx3(G) Internal Modem */ 111100966Siwasaki {0x6202734a, NULL}, /* RSS0262 - 5614Jx3[G] V90+K56Flex Modem */ 112100966Siwasaki {0x1010104d, NULL}, /* SHP1010 - Rockwell 33600bps Modem */ 113100966Siwasaki {0x10f0a34d, NULL}, /* SMCF010 - SMC IrCC*/ 114100966Siwasaki {0xc100ad4d, NULL}, /* SMM00C1 - Leopard 56k PnP */ 115100966Siwasaki {0x9012b04e, NULL}, /* SUP1290 - Supra ? */ 116100966Siwasaki {0x1013b04e, NULL}, /* SUP1310 - SupraExpress 336i PnP */ 117100966Siwasaki {0x8013b04e, NULL}, /* SUP1380 - SupraExpress 288i PnP Voice */ 118100966Siwasaki {0x8113b04e, NULL}, /* SUP1381 - SupraExpress 336i PnP Voice */ 119100966Siwasaki {0x5016b04e, NULL}, /* SUP1650 - Supra 336i Sp Intl */ 120100966Siwasaki {0x7016b04e, NULL}, /* SUP1670 - Supra 336i V+ Intl */ 121100966Siwasaki {0x7420b04e, NULL}, /* SUP2070 - Supra ? */ 122100966Siwasaki {0x8020b04e, NULL}, /* SUP2080 - Supra ? */ 123100966Siwasaki {0x8420b04e, NULL}, /* SUP2084 - SupraExpress 56i PnP */ 124100966Siwasaki {0x7121b04e, NULL}, /* SUP2171 - SupraExpress 56i Sp? */ 125102550Siwasaki {0x8024b04e, NULL}, /* SUP2480 - Supra ? */ 126100966Siwasaki {0x01007256, NULL}, /* USR0001 - U.S. Robotics Inc., Sportster W */ 127100966Siwasaki {0x02007256, NULL}, /* USR0002 - U.S. Robotics Inc. Sportster 33. */ 128100966Siwasaki {0x04007256, NULL}, /* USR0004 - USR Sportster 14.4k */ 129100966Siwasaki {0x06007256, NULL}, /* USR0006 - USR Sportster 33.6k */ 130100966Siwasaki {0x11007256, NULL}, /* USR0011 - USR ? */ 131114237Snjl {0x01017256, NULL}, /* USR0101 - USR ? */ 132100966Siwasaki {0x30207256, NULL}, /* USR2030 - U.S.Robotics Inc. Sportster 560 */ 133100966Siwasaki {0x50207256, NULL}, /* USR2050 - U.S.Robotics Inc. Sportster 33. */ 134100966Siwasaki {0x70207256, NULL}, /* USR2070 - U.S.Robotics Inc. Sportster 560 */ 135100966Siwasaki {0x30307256, NULL}, /* USR3030 - U.S. Robotics 56K FAX INT */ 136100966Siwasaki {0x31307256, NULL}, /* USR3031 - U.S. Robotics 56K FAX INT */ 137100966Siwasaki {0x50307256, NULL}, /* USR3050 - U.S. Robotics 56K FAX INT */ 138100966Siwasaki {0x70307256, NULL}, /* USR3070 - U.S. Robotics 56K Voice INT */ 139114237Snjl {0x90307256, NULL}, /* USR3090 - USR ? */ 140100966Siwasaki {0x70917256, NULL}, /* USR9170 - U.S. Robotics 56K FAX INT */ 141100966Siwasaki {0x90917256, NULL}, /* USR9190 - USR 56k Voice INT */ 142100966Siwasaki {0x04f0235c, NULL}, /* WACF004 - Wacom Tablet PC Screen*/ 143100966Siwasaki {0x0300695c, NULL}, /* WCI0003 - Fax/Voice/Modem/Speakphone/Asvd */ 144100966Siwasaki {0x01a0896a, NULL}, /* ZTIA001 - Zoom Internal V90 Faxmodem */ 145100966Siwasaki {0x61f7896a, NULL}, /* ZTIF761 - Zoom ComStar 33.6 */ 146100966Siwasaki {0} 147100966Siwasaki}; 148100966Siwasaki 149100966Siwasakistatic int 150100966Siwasakiuart_isa_probe(device_t dev) 151100966Siwasaki{ 152114237Snjl struct uart_softc *sc; 153100966Siwasaki device_t parent; 154100966Siwasaki 155100966Siwasaki parent = device_get_parent(dev); 156100966Siwasaki sc = device_get_softc(dev); 157100966Siwasaki 158100966Siwasaki /* Probe PnP _and_ non-PnP ns8250 here. */ 159100966Siwasaki if (ISA_PNP_PROBE(parent, dev, isa_ns8250_ids) != ENXIO) { 160100966Siwasaki sc->sc_class = &uart_ns8250_class; 161100966Siwasaki return (uart_bus_probe(dev, 0, 0, 0, 0)); 162100966Siwasaki } 163100966Siwasaki 164100966Siwasaki /* Add checks for non-ns8250 IDs here. */ 165114237Snjl return (ENXIO); 166100966Siwasaki} 167100966Siwasaki 168100966SiwasakiDRIVER_MODULE(uart, isa, uart_isa_driver, uart_devclass, 0, 0); 169100966Siwasaki