1a3be63b3SDoug Rabson /*- 2a3be63b3SDoug Rabson * Copyright (c) 1999 Doug Rabson 3a3be63b3SDoug Rabson * All rights reserved. 4a3be63b3SDoug Rabson * 5a3be63b3SDoug Rabson * Redistribution and use in source and binary forms, with or without 6a3be63b3SDoug Rabson * modification, are permitted provided that the following conditions 7a3be63b3SDoug Rabson * are met: 8a3be63b3SDoug Rabson * 1. Redistributions of source code must retain the above copyright 9a3be63b3SDoug Rabson * notice, this list of conditions and the following disclaimer. 10a3be63b3SDoug Rabson * 2. Redistributions in binary form must reproduce the above copyright 11a3be63b3SDoug Rabson * notice, this list of conditions and the following disclaimer in the 12a3be63b3SDoug Rabson * documentation and/or other materials provided with the distribution. 13a3be63b3SDoug Rabson * 14a3be63b3SDoug Rabson * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15a3be63b3SDoug Rabson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16a3be63b3SDoug Rabson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17a3be63b3SDoug Rabson * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18a3be63b3SDoug Rabson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19a3be63b3SDoug Rabson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20a3be63b3SDoug Rabson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21a3be63b3SDoug Rabson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22a3be63b3SDoug Rabson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23a3be63b3SDoug Rabson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24a3be63b3SDoug Rabson * SUCH DAMAGE. 25a3be63b3SDoug Rabson * 26a3be63b3SDoug Rabson * $Id$ 27a3be63b3SDoug Rabson */ 28a3be63b3SDoug Rabson /* 29a3be63b3SDoug Rabson * Modifications for Intel architecture by Garrett A. Wollman. 30a3be63b3SDoug Rabson * Copyright 1998 Massachusetts Institute of Technology 31a3be63b3SDoug Rabson * 32a3be63b3SDoug Rabson * Permission to use, copy, modify, and distribute this software and 33a3be63b3SDoug Rabson * its documentation for any purpose and without fee is hereby 34a3be63b3SDoug Rabson * granted, provided that both the above copyright notice and this 35a3be63b3SDoug Rabson * permission notice appear in all copies, that both the above 36a3be63b3SDoug Rabson * copyright notice and this permission notice appear in all 37a3be63b3SDoug Rabson * supporting documentation, and that the name of M.I.T. not be used 38a3be63b3SDoug Rabson * in advertising or publicity pertaining to distribution of the 39a3be63b3SDoug Rabson * software without specific, written prior permission. M.I.T. makes 40a3be63b3SDoug Rabson * no representations about the suitability of this software for any 41a3be63b3SDoug Rabson * purpose. It is provided "as is" without express or implied 42a3be63b3SDoug Rabson * warranty. 43a3be63b3SDoug Rabson * 44a3be63b3SDoug Rabson * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS 45a3be63b3SDoug Rabson * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, 46a3be63b3SDoug Rabson * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 47a3be63b3SDoug Rabson * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT 48a3be63b3SDoug Rabson * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 49a3be63b3SDoug Rabson * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 50a3be63b3SDoug Rabson * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 51a3be63b3SDoug Rabson * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 52a3be63b3SDoug Rabson * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 53a3be63b3SDoug Rabson * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 54a3be63b3SDoug Rabson * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 55a3be63b3SDoug Rabson * SUCH DAMAGE. 56a3be63b3SDoug Rabson */ 57a3be63b3SDoug Rabson 58a3be63b3SDoug Rabson /* 59a3be63b3SDoug Rabson * Parts of the ISA bus implementation common to all architectures. 60a3be63b3SDoug Rabson */ 61a3be63b3SDoug Rabson 62a3be63b3SDoug Rabson #include <sys/param.h> 63a3be63b3SDoug Rabson #include <sys/systm.h> 64a3be63b3SDoug Rabson #include <sys/kernel.h> 65a3be63b3SDoug Rabson #include <sys/bus.h> 66a3be63b3SDoug Rabson #include <sys/malloc.h> 67a3be63b3SDoug Rabson #include <sys/module.h> 68a3be63b3SDoug Rabson #include <machine/bus.h> 69a3be63b3SDoug Rabson #include <sys/rman.h> 70a3be63b3SDoug Rabson 71a3be63b3SDoug Rabson #include <machine/resource.h> 72a3be63b3SDoug Rabson 73a3be63b3SDoug Rabson #include <isa/isavar.h> 74a3be63b3SDoug Rabson #include <isa/isa_common.h> 75a3be63b3SDoug Rabson #ifdef __alpha__ /* XXX workaround a stupid warning */ 76a3be63b3SDoug Rabson #include <alpha/isa/isavar.h> 77a3be63b3SDoug Rabson #endif 78a3be63b3SDoug Rabson 79a3be63b3SDoug Rabson MALLOC_DEFINE(M_ISADEV, "isadev", "ISA device"); 80a3be63b3SDoug Rabson 81a3be63b3SDoug Rabson static devclass_t isa_devclass; 82a3be63b3SDoug Rabson 83a3be63b3SDoug Rabson /* 84a3be63b3SDoug Rabson * At 'probe' time, we add all the devices which we know about to the 85a3be63b3SDoug Rabson * bus. The generic attach routine will probe and attach them if they 86a3be63b3SDoug Rabson * are alive. 87a3be63b3SDoug Rabson */ 88a3be63b3SDoug Rabson static int 89a3be63b3SDoug Rabson isa_probe(device_t dev) 90a3be63b3SDoug Rabson { 91a3be63b3SDoug Rabson device_set_desc(dev, "ISA bus"); 92a3be63b3SDoug Rabson isa_init(); /* Allow machdep code to initialise */ 93a3be63b3SDoug Rabson return bus_generic_probe(dev); 94a3be63b3SDoug Rabson } 95a3be63b3SDoug Rabson 96a3be63b3SDoug Rabson extern device_t isa_bus_device; 97a3be63b3SDoug Rabson 98a3be63b3SDoug Rabson static int 99a3be63b3SDoug Rabson isa_attach(device_t dev) 100a3be63b3SDoug Rabson { 101a3be63b3SDoug Rabson /* 102a3be63b3SDoug Rabson * Arrange for bus_generic_attach(dev) to be called later. 103a3be63b3SDoug Rabson */ 104a3be63b3SDoug Rabson isa_bus_device = dev; 105a3be63b3SDoug Rabson return 0; 106a3be63b3SDoug Rabson } 107a3be63b3SDoug Rabson 108a3be63b3SDoug Rabson /* 109a3be63b3SDoug Rabson * Add a new child with default ivars. 110a3be63b3SDoug Rabson */ 111a3be63b3SDoug Rabson static device_t 112a3be63b3SDoug Rabson isa_add_child(device_t dev, device_t place, const char *name, int unit) 113a3be63b3SDoug Rabson { 114a3be63b3SDoug Rabson struct isa_device *idev; 115a3be63b3SDoug Rabson 116a3be63b3SDoug Rabson idev = malloc(sizeof(struct isa_device), M_ISADEV, M_NOWAIT); 117a3be63b3SDoug Rabson if (!idev) 118a3be63b3SDoug Rabson return 0; 119a3be63b3SDoug Rabson bzero(idev, sizeof *idev); 120a3be63b3SDoug Rabson 121a3be63b3SDoug Rabson resource_list_init(&idev->id_resources); 122a3be63b3SDoug Rabson idev->id_flags = 0; 123a3be63b3SDoug Rabson 124a3be63b3SDoug Rabson if (place) 125a3be63b3SDoug Rabson return device_add_child_after(dev, place, name, unit, idev); 126a3be63b3SDoug Rabson else 127a3be63b3SDoug Rabson return device_add_child(dev, name, unit, idev); 128a3be63b3SDoug Rabson } 129a3be63b3SDoug Rabson 130a3be63b3SDoug Rabson static void 131a3be63b3SDoug Rabson isa_print_resources(struct resource_list *rl, const char *name, int type, 132a3be63b3SDoug Rabson const char *format) 133a3be63b3SDoug Rabson { 134a3be63b3SDoug Rabson struct resource_list_entry *rle0 = resource_list_find(rl, type, 0); 135a3be63b3SDoug Rabson struct resource_list_entry *rle1 = resource_list_find(rl, type, 1); 136a3be63b3SDoug Rabson 137a3be63b3SDoug Rabson if (rle0 || rle1) { 138a3be63b3SDoug Rabson printf(" %s ", name); 139a3be63b3SDoug Rabson if (rle0) { 140a3be63b3SDoug Rabson printf(format, rle0->start); 141a3be63b3SDoug Rabson if (rle0->count > 1) { 142a3be63b3SDoug Rabson printf("-"); 143a3be63b3SDoug Rabson printf(format, rle0->start + rle0->count - 1); 144a3be63b3SDoug Rabson } 145a3be63b3SDoug Rabson } 146a3be63b3SDoug Rabson if (rle1) { 147a3be63b3SDoug Rabson if (rle0) 148a3be63b3SDoug Rabson printf(","); 149a3be63b3SDoug Rabson printf(format, rle1->start); 150a3be63b3SDoug Rabson if (rle1->count > 1) { 151a3be63b3SDoug Rabson printf("-"); 152a3be63b3SDoug Rabson printf(format, rle1->start + rle1->count - 1); 153a3be63b3SDoug Rabson } 154a3be63b3SDoug Rabson } 155a3be63b3SDoug Rabson } 156a3be63b3SDoug Rabson } 157a3be63b3SDoug Rabson 158a3be63b3SDoug Rabson static void 159a3be63b3SDoug Rabson isa_print_child(device_t bus, device_t dev) 160a3be63b3SDoug Rabson { 161a3be63b3SDoug Rabson struct isa_device *idev = DEVTOISA(dev); 162a3be63b3SDoug Rabson struct resource_list *rl = &idev->id_resources; 163a3be63b3SDoug Rabson 164a3be63b3SDoug Rabson if (SLIST_FIRST(rl) || idev->id_flags) 165a3be63b3SDoug Rabson printf(" at"); 166a3be63b3SDoug Rabson 167a3be63b3SDoug Rabson isa_print_resources(rl, "port", SYS_RES_IOPORT, "%#lx"); 168a3be63b3SDoug Rabson isa_print_resources(rl, "iomem", SYS_RES_MEMORY, "%#lx"); 169a3be63b3SDoug Rabson isa_print_resources(rl, "irq", SYS_RES_IRQ, "%ld"); 170a3be63b3SDoug Rabson isa_print_resources(rl, "drq", SYS_RES_DRQ, "%ld"); 171a3be63b3SDoug Rabson if (idev->id_flags) 172a3be63b3SDoug Rabson printf(" flags %#x", idev->id_flags); 173a3be63b3SDoug Rabson 174a3be63b3SDoug Rabson printf(" on %s%d", 175a3be63b3SDoug Rabson device_get_name(bus), device_get_unit(bus)); 176a3be63b3SDoug Rabson } 177a3be63b3SDoug Rabson 178a3be63b3SDoug Rabson static int 179a3be63b3SDoug Rabson isa_read_ivar(device_t bus, device_t dev, int index, uintptr_t * result) 180a3be63b3SDoug Rabson { 181a3be63b3SDoug Rabson struct isa_device* idev = DEVTOISA(dev); 182a3be63b3SDoug Rabson struct resource_list *rl = &idev->id_resources; 183a3be63b3SDoug Rabson struct resource_list_entry *rle; 184a3be63b3SDoug Rabson 185a3be63b3SDoug Rabson switch (index) { 186a3be63b3SDoug Rabson case ISA_IVAR_PORT_0: 187a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_IOPORT, 0); 188a3be63b3SDoug Rabson if (rle) 189a3be63b3SDoug Rabson *result = rle->start; 190a3be63b3SDoug Rabson else 191a3be63b3SDoug Rabson *result = -1; 192a3be63b3SDoug Rabson break; 193a3be63b3SDoug Rabson 194a3be63b3SDoug Rabson case ISA_IVAR_PORT_1: 195a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_IOPORT, 1); 196a3be63b3SDoug Rabson if (rle) 197a3be63b3SDoug Rabson *result = rle->start; 198a3be63b3SDoug Rabson else 199a3be63b3SDoug Rabson *result = -1; 200a3be63b3SDoug Rabson break; 201a3be63b3SDoug Rabson 202a3be63b3SDoug Rabson case ISA_IVAR_PORTSIZE_0: 203a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_IOPORT, 0); 204a3be63b3SDoug Rabson if (rle) 205a3be63b3SDoug Rabson *result = rle->count; 206a3be63b3SDoug Rabson else 207a3be63b3SDoug Rabson *result = 0; 208a3be63b3SDoug Rabson break; 209a3be63b3SDoug Rabson 210a3be63b3SDoug Rabson case ISA_IVAR_PORTSIZE_1: 211a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_IOPORT, 1); 212a3be63b3SDoug Rabson if (rle) 213a3be63b3SDoug Rabson *result = rle->count; 214a3be63b3SDoug Rabson else 215a3be63b3SDoug Rabson *result = 0; 216a3be63b3SDoug Rabson break; 217a3be63b3SDoug Rabson 218a3be63b3SDoug Rabson case ISA_IVAR_MADDR_0: 219a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_MEMORY, 0); 220a3be63b3SDoug Rabson if (rle) 221a3be63b3SDoug Rabson *result = rle->start; 222a3be63b3SDoug Rabson else 223a3be63b3SDoug Rabson *result = -1; 224a3be63b3SDoug Rabson break; 225a3be63b3SDoug Rabson 226a3be63b3SDoug Rabson case ISA_IVAR_MADDR_1: 227a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_MEMORY, 1); 228a3be63b3SDoug Rabson if (rle) 229a3be63b3SDoug Rabson *result = rle->start; 230a3be63b3SDoug Rabson else 231a3be63b3SDoug Rabson *result = -1; 232a3be63b3SDoug Rabson break; 233a3be63b3SDoug Rabson 234a3be63b3SDoug Rabson case ISA_IVAR_MSIZE_0: 235a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_MEMORY, 0); 236a3be63b3SDoug Rabson if (rle) 237a3be63b3SDoug Rabson *result = rle->count; 238a3be63b3SDoug Rabson else 239a3be63b3SDoug Rabson *result = 0; 240a3be63b3SDoug Rabson break; 241a3be63b3SDoug Rabson 242a3be63b3SDoug Rabson case ISA_IVAR_MSIZE_1: 243a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_MEMORY, 1); 244a3be63b3SDoug Rabson if (rle) 245a3be63b3SDoug Rabson *result = rle->count; 246a3be63b3SDoug Rabson else 247a3be63b3SDoug Rabson *result = 0; 248a3be63b3SDoug Rabson break; 249a3be63b3SDoug Rabson 250a3be63b3SDoug Rabson case ISA_IVAR_IRQ_0: 251a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_IRQ, 0); 252a3be63b3SDoug Rabson if (rle) 253a3be63b3SDoug Rabson *result = rle->start; 254a3be63b3SDoug Rabson else 255a3be63b3SDoug Rabson *result = -1; 256a3be63b3SDoug Rabson break; 257a3be63b3SDoug Rabson 258a3be63b3SDoug Rabson case ISA_IVAR_IRQ_1: 259a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_IRQ, 1); 260a3be63b3SDoug Rabson if (rle) 261a3be63b3SDoug Rabson *result = rle->start; 262a3be63b3SDoug Rabson else 263a3be63b3SDoug Rabson *result = -1; 264a3be63b3SDoug Rabson break; 265a3be63b3SDoug Rabson 266a3be63b3SDoug Rabson case ISA_IVAR_DRQ_0: 267a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_DRQ, 0); 268a3be63b3SDoug Rabson if (rle) 269a3be63b3SDoug Rabson *result = rle->start; 270a3be63b3SDoug Rabson else 271a3be63b3SDoug Rabson *result = -1; 272a3be63b3SDoug Rabson break; 273a3be63b3SDoug Rabson 274a3be63b3SDoug Rabson case ISA_IVAR_DRQ_1: 275a3be63b3SDoug Rabson rle = resource_list_find(rl, SYS_RES_DRQ, 1); 276a3be63b3SDoug Rabson if (rle) 277a3be63b3SDoug Rabson *result = rle->start; 278a3be63b3SDoug Rabson else 279a3be63b3SDoug Rabson *result = -1; 280a3be63b3SDoug Rabson break; 281a3be63b3SDoug Rabson 282a3be63b3SDoug Rabson case ISA_IVAR_FLAGS: 283a3be63b3SDoug Rabson *result = idev->id_flags; 284a3be63b3SDoug Rabson break; 285a3be63b3SDoug Rabson } 286a3be63b3SDoug Rabson return ENOENT; 287a3be63b3SDoug Rabson } 288a3be63b3SDoug Rabson 289a3be63b3SDoug Rabson static int 290a3be63b3SDoug Rabson isa_write_ivar(device_t bus, device_t dev, 291a3be63b3SDoug Rabson int index, uintptr_t value) 292a3be63b3SDoug Rabson { 293a3be63b3SDoug Rabson struct isa_device* idev = DEVTOISA(dev); 294a3be63b3SDoug Rabson 295a3be63b3SDoug Rabson switch (index) { 296a3be63b3SDoug Rabson case ISA_IVAR_PORT_0: 297a3be63b3SDoug Rabson case ISA_IVAR_PORT_1: 298a3be63b3SDoug Rabson case ISA_IVAR_PORTSIZE_0: 299a3be63b3SDoug Rabson case ISA_IVAR_PORTSIZE_1: 300a3be63b3SDoug Rabson case ISA_IVAR_MADDR_0: 301a3be63b3SDoug Rabson case ISA_IVAR_MADDR_1: 302a3be63b3SDoug Rabson case ISA_IVAR_MSIZE_0: 303a3be63b3SDoug Rabson case ISA_IVAR_MSIZE_1: 304a3be63b3SDoug Rabson case ISA_IVAR_IRQ_0: 305a3be63b3SDoug Rabson case ISA_IVAR_IRQ_1: 306a3be63b3SDoug Rabson case ISA_IVAR_DRQ_0: 307a3be63b3SDoug Rabson case ISA_IVAR_DRQ_1: 308a3be63b3SDoug Rabson return EINVAL; 309a3be63b3SDoug Rabson 310a3be63b3SDoug Rabson case ISA_IVAR_FLAGS: 311a3be63b3SDoug Rabson idev->id_flags = value; 312a3be63b3SDoug Rabson break; 313a3be63b3SDoug Rabson default: 314a3be63b3SDoug Rabson return (ENOENT); 315a3be63b3SDoug Rabson } 316a3be63b3SDoug Rabson return (0); 317a3be63b3SDoug Rabson } 318a3be63b3SDoug Rabson 319a3be63b3SDoug Rabson static int 320a3be63b3SDoug Rabson isa_set_resource(device_t dev, device_t child, int type, int rid, 321a3be63b3SDoug Rabson u_long start, u_long count) 322a3be63b3SDoug Rabson { 323a3be63b3SDoug Rabson struct isa_device* idev = DEVTOISA(child); 324a3be63b3SDoug Rabson struct resource_list *rl = &idev->id_resources; 325a3be63b3SDoug Rabson 326a3be63b3SDoug Rabson if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY 327a3be63b3SDoug Rabson && type != SYS_RES_IRQ && type != SYS_RES_DRQ) 328a3be63b3SDoug Rabson return EINVAL; 329a3be63b3SDoug Rabson if (rid < 0 || rid > 1) 330a3be63b3SDoug Rabson return EINVAL; 331a3be63b3SDoug Rabson 332a3be63b3SDoug Rabson resource_list_add(rl, type, rid, start, start + count - 1, count); 333a3be63b3SDoug Rabson 334a3be63b3SDoug Rabson return 0; 335a3be63b3SDoug Rabson } 336a3be63b3SDoug Rabson 337a3be63b3SDoug Rabson static int 338a3be63b3SDoug Rabson isa_get_resource(device_t dev, device_t child, int type, int rid, 339a3be63b3SDoug Rabson u_long *startp, u_long *countp) 340a3be63b3SDoug Rabson { 341a3be63b3SDoug Rabson struct isa_device* idev = DEVTOISA(child); 342a3be63b3SDoug Rabson struct resource_list *rl = &idev->id_resources; 343a3be63b3SDoug Rabson struct resource_list_entry *rle; 344a3be63b3SDoug Rabson 345a3be63b3SDoug Rabson rle = resource_list_find(rl, type, rid); 346a3be63b3SDoug Rabson if (!rle) 347a3be63b3SDoug Rabson return ENOENT; 348a3be63b3SDoug Rabson 349a3be63b3SDoug Rabson *startp = rle->start; 350a3be63b3SDoug Rabson *countp = rle->count; 351a3be63b3SDoug Rabson 352a3be63b3SDoug Rabson return 0; 353a3be63b3SDoug Rabson } 354a3be63b3SDoug Rabson 355a3be63b3SDoug Rabson static device_method_t isa_methods[] = { 356a3be63b3SDoug Rabson /* Device interface */ 357a3be63b3SDoug Rabson DEVMETHOD(device_probe, isa_probe), 358a3be63b3SDoug Rabson DEVMETHOD(device_attach, isa_attach), 359a3be63b3SDoug Rabson DEVMETHOD(device_detach, bus_generic_detach), 360a3be63b3SDoug Rabson DEVMETHOD(device_shutdown, bus_generic_shutdown), 361a3be63b3SDoug Rabson DEVMETHOD(device_suspend, bus_generic_suspend), 362a3be63b3SDoug Rabson DEVMETHOD(device_resume, bus_generic_resume), 363a3be63b3SDoug Rabson 364a3be63b3SDoug Rabson /* Bus interface */ 365a3be63b3SDoug Rabson DEVMETHOD(bus_add_child, isa_add_child), 366a3be63b3SDoug Rabson DEVMETHOD(bus_print_child, isa_print_child), 367a3be63b3SDoug Rabson DEVMETHOD(bus_read_ivar, isa_read_ivar), 368a3be63b3SDoug Rabson DEVMETHOD(bus_write_ivar, isa_write_ivar), 369a3be63b3SDoug Rabson DEVMETHOD(bus_alloc_resource, isa_alloc_resource), 370a3be63b3SDoug Rabson DEVMETHOD(bus_release_resource, isa_release_resource), 371a3be63b3SDoug Rabson DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), 372a3be63b3SDoug Rabson DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), 373a3be63b3SDoug Rabson DEVMETHOD(bus_setup_intr, isa_setup_intr), 374a3be63b3SDoug Rabson DEVMETHOD(bus_teardown_intr, isa_teardown_intr), 375a3be63b3SDoug Rabson 376a3be63b3SDoug Rabson /* ISA interface */ 377a3be63b3SDoug Rabson DEVMETHOD(isa_set_resource, isa_set_resource), 378a3be63b3SDoug Rabson DEVMETHOD(isa_get_resource, isa_get_resource), 379a3be63b3SDoug Rabson 380a3be63b3SDoug Rabson { 0, 0 } 381a3be63b3SDoug Rabson }; 382a3be63b3SDoug Rabson 383a3be63b3SDoug Rabson static driver_t isa_driver = { 384a3be63b3SDoug Rabson "isa", 385a3be63b3SDoug Rabson isa_methods, 386a3be63b3SDoug Rabson 1, /* no softc */ 387a3be63b3SDoug Rabson }; 388a3be63b3SDoug Rabson 389a3be63b3SDoug Rabson /* 390a3be63b3SDoug Rabson * ISA can be attached to a PCI-ISA bridge or directly to the nexus. 391a3be63b3SDoug Rabson */ 392a3be63b3SDoug Rabson DRIVER_MODULE(isa, isab, isa_driver, isa_devclass, 0, 0); 393a3be63b3SDoug Rabson #ifdef __i386__ 394a3be63b3SDoug Rabson DRIVER_MODULE(isa, nexus, isa_driver, isa_devclass, 0, 0); 395a3be63b3SDoug Rabson #endif 396