Home | History | Annotate | Line # | Download | only in gemini
gemini_obio.c revision 1.7
      1  1.7  cliff /*	$NetBSD: gemini_obio.c,v 1.7 2008/11/20 20:23:05 cliff Exp $	*/
      2  1.1   matt 
      3  1.1   matt /* adapted from:
      4  1.6  cliff  *      NetBSD: omap2_obio.c,v 1.5 2008/10/21 18:50:25 matt Exp
      5  1.1   matt  */
      6  1.1   matt 
      7  1.1   matt /*
      8  1.6  cliff  * Autoconfiguration support for the Gemini "On Board" I/O.
      9  1.1   matt  *
     10  1.6  cliff  * Based on arm/omap/omap2_obio.c which in turn was derived
     11  1.1   matt  * Based on arm/omap/omap_emifs.c which in turn was derived
     12  1.1   matt  * Based on arm/xscale/pxa2x0.c which in turn was derived
     13  1.1   matt  * from arm/sa11x0/sa11x0.c
     14  1.1   matt  *
     15  1.1   matt  * Copyright (c) 2002, 2005  Genetec Corporation.  All rights reserved.
     16  1.1   matt  * Written by Hiroyuki Bessho for Genetec Corporation.
     17  1.1   matt  *
     18  1.1   matt  * Redistribution and use in source and binary forms, with or without
     19  1.1   matt  * modification, are permitted provided that the following conditions
     20  1.1   matt  * are met:
     21  1.1   matt  * 1. Redistributions of source code must retain the above copyright
     22  1.1   matt  *    notice, this list of conditions and the following disclaimer.
     23  1.1   matt  * 2. Redistributions in binary form must reproduce the above copyright
     24  1.1   matt  *    notice, this list of conditions and the following disclaimer in the
     25  1.1   matt  *    documentation and/or other materials provided with the distribution.
     26  1.1   matt  * 3. All advertising materials mentioning features or use of this software
     27  1.1   matt  *    must display the following acknowledgement:
     28  1.1   matt  *	This product includes software developed for the NetBSD Project by
     29  1.1   matt  *	Genetec Corporation.
     30  1.1   matt  * 4. The name of Genetec Corporation may not be used to endorse or
     31  1.1   matt  *    promote products derived from this software without specific prior
     32  1.1   matt  *    written permission.
     33  1.1   matt  *
     34  1.1   matt  * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
     35  1.1   matt  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     36  1.1   matt  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     37  1.1   matt  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GENETEC CORPORATION
     38  1.1   matt  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     39  1.1   matt  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     40  1.1   matt  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     41  1.1   matt  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     42  1.1   matt  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     43  1.1   matt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     44  1.1   matt  * POSSIBILITY OF SUCH DAMAGE.
     45  1.1   matt  *
     46  1.1   matt  * Copyright (c) 1997,1998, 2001, The NetBSD Foundation, Inc.
     47  1.1   matt  * All rights reserved.
     48  1.1   matt  *
     49  1.1   matt  * This code is derived from software contributed to The NetBSD Foundation
     50  1.1   matt  * by IWAMOTO Toshihiro, Ichiro FUKUHARA and Paul Kranenburg.
     51  1.1   matt  *
     52  1.1   matt  * Redistribution and use in source and binary forms, with or without
     53  1.1   matt  * modification, are permitted provided that the following conditions
     54  1.1   matt  * are met:
     55  1.1   matt  * 1. Redistributions of source code must retain the above copyright
     56  1.1   matt  *    notice, this list of conditions and the following disclaimer.
     57  1.1   matt  * 2. Redistributions in binary form must reproduce the above copyright
     58  1.1   matt  *    notice, this list of conditions and the following disclaimer in the
     59  1.1   matt  *    documentation and/or other materials provided with the distribution.
     60  1.1   matt  *
     61  1.1   matt  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     62  1.1   matt  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     63  1.1   matt  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     64  1.1   matt  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     65  1.1   matt  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     66  1.1   matt  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     67  1.1   matt  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     68  1.1   matt  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     69  1.1   matt  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     70  1.1   matt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     71  1.1   matt  * POSSIBILITY OF SUCH DAMAGE.
     72  1.1   matt  *
     73  1.1   matt  * Copyright (c) 1999
     74  1.1   matt  *         Shin Takemura and PocketBSD Project. All rights reserved.
     75  1.1   matt  *
     76  1.1   matt  * Redistribution and use in source and binary forms, with or without
     77  1.1   matt  * modification, are permitted provided that the following conditions
     78  1.1   matt  * are met:
     79  1.1   matt  * 1. Redistributions of source code must retain the above copyright
     80  1.1   matt  *    notice, this list of conditions and the following disclaimer.
     81  1.1   matt  * 2. Redistributions in binary form must reproduce the above copyright
     82  1.1   matt  *    notice, this list of conditions and the following disclaimer in the
     83  1.1   matt  *    documentation and/or other materials provided with the distribution.
     84  1.1   matt  * 3. All advertising materials mentioning features or use of this software
     85  1.1   matt  *    must display the following acknowledgement:
     86  1.1   matt  *	This product includes software developed by the PocketBSD project
     87  1.1   matt  *	and its contributors.
     88  1.1   matt  * 4. Neither the name of the project nor the names of its contributors
     89  1.1   matt  *    may be used to endorse or promote products derived from this software
     90  1.1   matt  *    without specific prior written permission.
     91  1.1   matt  *
     92  1.1   matt  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     93  1.1   matt  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     94  1.1   matt  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     95  1.1   matt  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     96  1.1   matt  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     97  1.1   matt  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     98  1.1   matt  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     99  1.1   matt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    100  1.1   matt  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    101  1.1   matt  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    102  1.1   matt  * SUCH DAMAGE.
    103  1.1   matt  */
    104  1.1   matt 
    105  1.1   matt #include "opt_gemini.h"
    106  1.1   matt #include <sys/cdefs.h>
    107  1.7  cliff __KERNEL_RCSID(0, "$NetBSD: gemini_obio.c,v 1.7 2008/11/20 20:23:05 cliff Exp $");
    108  1.1   matt 
    109  1.1   matt #include "locators.h"
    110  1.1   matt #include "obio.h"
    111  1.1   matt #include "geminiicu.h"
    112  1.2  cliff #include "pci.h"
    113  1.1   matt 
    114  1.1   matt #include <sys/param.h>
    115  1.1   matt #include <sys/systm.h>
    116  1.1   matt #include <sys/device.h>
    117  1.1   matt #include <sys/kernel.h>
    118  1.1   matt #include <sys/reboot.h>
    119  1.1   matt 
    120  1.1   matt #include <machine/cpu.h>
    121  1.1   matt #include <machine/bus.h>
    122  1.1   matt 
    123  1.1   matt #include <arm/cpufunc.h>
    124  1.1   matt #include <arm/mainbus/mainbus.h>
    125  1.1   matt #include <arm/gemini/gemini_var.h>
    126  1.1   matt #include <arm/gemini/gemini_reg.h>
    127  1.1   matt 
    128  1.1   matt #include <arm/gemini/gemini_obiovar.h>
    129  1.1   matt 
    130  1.1   matt typedef struct {
    131  1.1   matt 	boolean_t	cs_valid;
    132  1.1   matt 	ulong		cs_addr;
    133  1.1   matt 	ulong		cs_size;
    134  1.1   matt } obio_csconfig_t;
    135  1.1   matt 
    136  1.1   matt /* prototypes */
    137  1.1   matt static int	obio_match(device_t, cfdata_t, void *);
    138  1.1   matt static void	obio_attach(device_t, device_t, void *);
    139  1.1   matt static int 	obio_search(device_t, cfdata_t, const int *, void *);
    140  1.1   matt static int	obio_find(device_t, cfdata_t, const int *, void *);
    141  1.1   matt static int	obio_print(void *, const char *);
    142  1.1   matt static void	obio_attach_critical(struct obio_softc *);
    143  1.1   matt 
    144  1.1   matt /* attach structures */
    145  1.7  cliff CFATTACH_DECL_NEW(obio, sizeof(struct obio_softc),
    146  1.1   matt 	obio_match, obio_attach, NULL, NULL);
    147  1.1   matt 
    148  1.1   matt 
    149  1.1   matt static int
    150  1.1   matt obio_match(device_t parent, cfdata_t match, void *aux)
    151  1.1   matt {
    152  1.1   matt 	return 1;
    153  1.1   matt }
    154  1.1   matt 
    155  1.1   matt static void
    156  1.1   matt obio_attach(device_t parent, device_t self, void *aux)
    157  1.1   matt {
    158  1.1   matt 	struct obio_softc *sc = device_private(self);
    159  1.1   matt 	struct mainbus_attach_args *mb = (struct mainbus_attach_args *)aux;
    160  1.2  cliff #if NPCI > 0
    161  1.1   matt 	struct pcibus_attach_args pba;
    162  1.2  cliff #endif
    163  1.1   matt 
    164  1.7  cliff 	sc->sc_dev = self;
    165  1.7  cliff 
    166  1.1   matt 	sc->sc_iot = &gemini_bs_tag;
    167  1.1   matt 
    168  1.1   matt 	aprint_normal(": On-Board IO\n");
    169  1.1   matt 
    170  1.6  cliff #if (GEMINI_BUSBASE != 0)
    171  1.5  cliff 	sc->sc_dmarange.dr_sysbase = 0;
    172  1.6  cliff 	sc->sc_dmarange.dr_busbase = (GEMINI_BUSBASE * 1024 * 1024);
    173  1.5  cliff 	sc->sc_dmarange.dr_len = MEMSIZE * 1024 * 1024;
    174  1.5  cliff 	gemini_bus_dma_tag._ranges = &sc->sc_dmarange;
    175  1.5  cliff 	gemini_bus_dma_tag._nranges = 1;
    176  1.5  cliff #endif
    177  1.5  cliff 
    178  1.1   matt 	sc->sc_ioh = 0;
    179  1.1   matt 	sc->sc_dmat = &gemini_bus_dma_tag;
    180  1.1   matt 	sc->sc_base = mb->mb_iobase;
    181  1.1   matt 	sc->sc_size = mb->mb_iosize;
    182  1.1   matt 
    183  1.1   matt 	/*
    184  1.1   matt 	 * Attach critical devices first.
    185  1.1   matt 	 */
    186  1.1   matt 	obio_attach_critical(sc);
    187  1.1   matt 
    188  1.2  cliff #if NPCI > 0
    189  1.1   matt 	/*
    190  1.1   matt 	 * map PCI controller registers
    191  1.1   matt 	 */
    192  1.1   matt 	if (bus_space_map(sc->sc_iot, GEMINI_PCICFG_BASE,
    193  1.1   matt 		GEMINI_PCI_CFG_DATA+4, 0, &sc->sc_pcicfg_ioh)) {
    194  1.1   matt 			aprint_error("cannot map PCI controller at %#x\n",
    195  1.1   matt 				GEMINI_PCICFG_BASE);
    196  1.1   matt 			return;
    197  1.1   matt 	}
    198  1.1   matt 	/*
    199  1.1   matt 	 * initialize the PCI chipset tag
    200  1.1   matt 	 */
    201  1.1   matt 	gemini_pci_init(&sc->sc_pci_chipset, sc);
    202  1.2  cliff #endif	/* NPCI */
    203  1.1   matt 
    204  1.1   matt 	/*
    205  1.1   matt 	 * attach the rest of our devices
    206  1.1   matt 	 */
    207  1.1   matt 	config_search_ia(obio_search, self, "obio", NULL);
    208  1.1   matt 
    209  1.2  cliff #if NPCI > 0
    210  1.1   matt 	/*
    211  1.1   matt 	 * attach the PCI bus
    212  1.1   matt 	 */
    213  1.1   matt 	pba.pba_memt = sc->sc_iot;
    214  1.1   matt 	pba.pba_iot =  sc->sc_iot;;
    215  1.1   matt 	pba.pba_dmat = sc->sc_dmat;
    216  1.1   matt 	pba.pba_dmat64 = NULL;
    217  1.1   matt 	pba.pba_pc = &sc->sc_pci_chipset;
    218  1.1   matt 	pba.pba_bus = 0;
    219  1.1   matt 	pba.pba_bridgetag = NULL;
    220  1.1   matt 	pba.pba_intrswiz = 0;
    221  1.1   matt 	pba.pba_intrtag = 0;
    222  1.1   matt 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
    223  1.1   matt 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
    224  1.1   matt 
    225  1.7  cliff 	(void) config_found_ia(sc->sc_dev, "pcibus", &pba, pcibusprint);
    226  1.2  cliff #endif	/* NPCI */
    227  1.1   matt 
    228  1.1   matt }
    229  1.1   matt 
    230  1.1   matt static int
    231  1.1   matt obio_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
    232  1.1   matt {
    233  1.1   matt 	struct obio_softc * const sc = device_private(parent);
    234  1.1   matt 	struct obio_attach_args oa;
    235  1.1   matt 
    236  1.1   matt 	/* Set up the attach args. */
    237  1.1   matt 	if (cf->cf_loc[OBIOCF_NOBYTEACC] == 1) {
    238  1.1   matt #if 0
    239  1.1   matt 		if (cf->cf_loc[OBIOCF_MULT] == 1)
    240  1.1   matt 			oa.obio_iot = &nobyteacc_bs_tag;
    241  1.1   matt 		else
    242  1.1   matt #endif
    243  1.1   matt 			panic("nobyteacc specified for device with "
    244  1.1   matt 				"non-byte multiplier\n");
    245  1.1   matt 	} else {
    246  1.1   matt 		switch (cf->cf_loc[OBIOCF_MULT]) {
    247  1.1   matt 		case 1:
    248  1.1   matt 			oa.obio_iot = &gemini_bs_tag;
    249  1.1   matt 			break;
    250  1.1   matt #if 0
    251  1.1   matt 		case 2:
    252  1.1   matt 			oa.obio_iot = &gemini_a2x_bs_tag;
    253  1.1   matt 			break;
    254  1.1   matt #endif
    255  1.1   matt 		case 4:
    256  1.1   matt 			oa.obio_iot = &gemini_a4x_bs_tag;
    257  1.1   matt 			break;
    258  1.1   matt 		default:
    259  1.1   matt 			panic("Unsupported obio bus multiplier.");
    260  1.1   matt 			break;
    261  1.1   matt 		}
    262  1.1   matt 	}
    263  1.1   matt 
    264  1.1   matt 	oa.obio_dmat = sc->sc_dmat;
    265  1.1   matt 	oa.obio_addr = cf->cf_loc[OBIOCF_ADDR];
    266  1.1   matt 	oa.obio_size = cf->cf_loc[OBIOCF_SIZE];
    267  1.1   matt 	oa.obio_intr = cf->cf_loc[OBIOCF_INTR];
    268  1.1   matt 	oa.obio_intrbase = cf->cf_loc[OBIOCF_INTRBASE];
    269  1.1   matt 
    270  1.1   matt 	if (config_match(parent, cf, &oa)) {
    271  1.1   matt 		config_attach(parent, cf, &oa, obio_print);
    272  1.1   matt 		return 0;			/* love it */
    273  1.1   matt 	}
    274  1.1   matt 
    275  1.1   matt 	return UNCONF;	/* NG */
    276  1.1   matt }
    277  1.1   matt 
    278  1.1   matt static int
    279  1.1   matt obio_find(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
    280  1.1   matt {
    281  1.1   matt 	struct obio_attach_args * const oa = aux;
    282  1.1   matt 
    283  1.1   matt 	if (oa->obio_addr != OBIOCF_ADDR_DEFAULT
    284  1.1   matt 	    && oa->obio_addr != cf->cf_loc[OBIOCF_ADDR])
    285  1.1   matt 		return 0;
    286  1.1   matt 	if (oa->obio_size != OBIOCF_SIZE_DEFAULT
    287  1.1   matt 	    && oa->obio_size != cf->cf_loc[OBIOCF_SIZE])
    288  1.1   matt 		return 0;
    289  1.1   matt 	if (oa->obio_intr != OBIOCF_INTR_DEFAULT
    290  1.1   matt 	    && oa->obio_intr != cf->cf_loc[OBIOCF_INTR])
    291  1.1   matt 		return 0;
    292  1.1   matt 	if (oa->obio_intrbase != OBIOCF_INTRBASE_DEFAULT
    293  1.1   matt 	    && oa->obio_intrbase != cf->cf_loc[OBIOCF_INTRBASE])
    294  1.1   matt 		return 0;
    295  1.1   matt 
    296  1.1   matt 	/* Set up the attach args. */
    297  1.1   matt 	if (cf->cf_loc[OBIOCF_NOBYTEACC] == 1) {
    298  1.1   matt #if 0
    299  1.1   matt 		if (cf->cf_loc[OBIOCF_MULT] == 1)
    300  1.1   matt 			oa->obio_iot = &nobyteacc_bs_tag;
    301  1.1   matt 		else
    302  1.1   matt #endif
    303  1.1   matt 			panic("nobyteacc specified for device with "
    304  1.1   matt 				"non-byte multiplier\n");
    305  1.1   matt 	} else {
    306  1.1   matt 		switch (cf->cf_loc[OBIOCF_MULT]) {
    307  1.1   matt 		case 1:
    308  1.1   matt 			oa->obio_iot = &gemini_bs_tag;
    309  1.1   matt 			break;
    310  1.1   matt #if 0
    311  1.1   matt 		case 2:
    312  1.1   matt 			oa->obio_iot = &gemini_a2x_bs_tag;
    313  1.1   matt 			break;
    314  1.1   matt #endif
    315  1.1   matt 		case 4:
    316  1.1   matt 			oa->obio_iot = &gemini_a4x_bs_tag;
    317  1.1   matt 			break;
    318  1.1   matt 		default:
    319  1.1   matt 			panic("Unsupported obio bus multiplier.");
    320  1.1   matt 			break;
    321  1.1   matt 		}
    322  1.1   matt 	}
    323  1.1   matt 	oa->obio_addr = cf->cf_loc[OBIOCF_ADDR];
    324  1.1   matt 	oa->obio_size = cf->cf_loc[OBIOCF_SIZE];
    325  1.1   matt 	oa->obio_intr = cf->cf_loc[OBIOCF_INTR];
    326  1.1   matt 	oa->obio_intrbase = cf->cf_loc[OBIOCF_INTRBASE];
    327  1.1   matt 
    328  1.1   matt 	return config_match(parent, cf, oa);
    329  1.1   matt }
    330  1.1   matt 
    331  1.1   matt #if NGEMINIICU == 0
    332  1.1   matt #error no geminiicu present in config file
    333  1.1   matt #endif
    334  1.1   matt 
    335  1.1   matt static const struct {
    336  1.1   matt 	const char *name;
    337  1.1   matt 	bus_addr_t addr;
    338  1.1   matt 	bool required;
    339  1.1   matt } critical_devs[] = {
    340  1.4  cliff #if defined(GEMINI_MASTER) || defined(GEMINI_SINGLE)
    341  1.3  cliff 	{ .name = "geminiicu0",   .addr = 0x48000000, .required = true },
    342  1.3  cliff 	{ .name = "geminiwdt0",   .addr = 0x41000000, .required = true },
    343  1.3  cliff 	{ .name = "geminitmr0",   .addr = 0x43000000, .required = true },
    344  1.3  cliff 	{ .name = "geminitmr2",   .addr = 0x43000000, .required = true },
    345  1.3  cliff 	{ .name = "com0",         .addr = 0x42000000, .required = true },
    346  1.4  cliff #elif defined(GEMINI_SLAVE)
    347  1.3  cliff 	{ .name = "geminiicu1",   .addr = 0x49000000, .required = true },
    348  1.3  cliff 	{ .name = "geminitmr1",   .addr = 0x43000000, .required = true },
    349  1.3  cliff 	{ .name = "geminitmr2",   .addr = 0x43000000, .required = true },
    350  1.3  cliff 	{ .name = "geminilpchc0", .addr = 0x47000000, .required = true },
    351  1.2  cliff #endif
    352  1.1   matt };
    353  1.1   matt 
    354  1.1   matt static void
    355  1.1   matt obio_attach_critical(struct obio_softc *sc)
    356  1.1   matt {
    357  1.1   matt 	struct obio_attach_args oa;
    358  1.1   matt 	cfdata_t cf;
    359  1.1   matt 	size_t i;
    360  1.1   matt 
    361  1.1   matt 	for (i = 0; i < __arraycount(critical_devs); i++) {
    362  1.1   matt 		oa.obio_iot = sc->sc_iot;
    363  1.1   matt 		oa.obio_dmat = sc->sc_dmat;
    364  1.1   matt 
    365  1.1   matt 		oa.obio_addr = critical_devs[i].addr;
    366  1.1   matt 		oa.obio_size = OBIOCF_SIZE_DEFAULT;
    367  1.1   matt 		oa.obio_intr = OBIOCF_INTR_DEFAULT;
    368  1.1   matt 		oa.obio_intrbase = OBIOCF_INTRBASE_DEFAULT;
    369  1.1   matt 
    370  1.1   matt #if 0
    371  1.1   matt 		if (oa.obio_addr != OBIOCF_ADDR_DEFAULT
    372  1.1   matt 		    && (oa.obio_addr < sc->sc_base
    373  1.1   matt 		        || oa.obio_addr >= sc->sc_base + sc->sc_size))
    374  1.1   matt 			continue;
    375  1.1   matt #endif
    376  1.1   matt 
    377  1.7  cliff 		cf = config_search_ia(obio_find, sc->sc_dev, "obio", &oa);
    378  1.1   matt 		if (cf == NULL && critical_devs[i].required)
    379  1.1   matt 			panic("obio_attach_critical: failed to find %s!",
    380  1.1   matt 			    critical_devs[i].name);
    381  1.1   matt 
    382  1.1   matt 		oa.obio_addr = cf->cf_loc[OBIOCF_ADDR];
    383  1.1   matt 		oa.obio_size = cf->cf_loc[OBIOCF_SIZE];
    384  1.1   matt 		oa.obio_intr = cf->cf_loc[OBIOCF_INTR];
    385  1.1   matt 		oa.obio_intrbase = cf->cf_loc[OBIOCF_INTRBASE];
    386  1.7  cliff 		config_attach(sc->sc_dev, cf, &oa, obio_print);
    387  1.1   matt 	}
    388  1.1   matt }
    389  1.1   matt 
    390  1.1   matt static int
    391  1.1   matt obio_print(void *aux, const char *name)
    392  1.1   matt {
    393  1.1   matt 	struct obio_attach_args *oa = (struct obio_attach_args*)aux;
    394  1.1   matt 
    395  1.1   matt 	if (oa->obio_addr != OBIOCF_ADDR_DEFAULT) {
    396  1.1   matt 		aprint_normal(" addr 0x%08lx", oa->obio_addr);
    397  1.1   matt 		if (oa->obio_size != OBIOCF_SIZE_DEFAULT)
    398  1.1   matt 			aprint_normal("-0x%08lx",
    399  1.1   matt 				oa->obio_addr + oa->obio_size-1);
    400  1.1   matt 	}
    401  1.1   matt 	if (oa->obio_intr != OBIOCF_INTR_DEFAULT)
    402  1.1   matt 		aprint_normal(" intr %d", oa->obio_intr);
    403  1.1   matt 	if (oa->obio_intrbase != OBIOCF_INTRBASE_DEFAULT)
    404  1.1   matt 		aprint_normal(" intrbase %d", oa->obio_intrbase);
    405  1.1   matt 
    406  1.1   matt 	return UNCONF;
    407  1.1   matt }
    408