Home | History | Annotate | Line # | Download | only in ixdp425
ixdp425_mainbus.c revision 1.1
      1 /*	$NetBSD: ixdp425_mainbus.c,v 1.1 2003/05/23 00:57:27 ichiro Exp $ */
      2 
      3 /*
      4  * Copyright (c) 2003
      5  *	Ichiro FUKUHARA <ichiro (at) ichiro.org>.
      6  * All rights reserved.
      7  *
      8  * Redistribution and use in source and binary forms, with or without
      9  * modification, are permitted provided that the following conditions
     10  * are met:
     11  * 1. Redistributions of source code must retain the above copyright
     12  *    notice, this list of conditions and the following disclaimer.
     13  * 2. Redistributions in binary form must reproduce the above copyright
     14  *    notice, this list of conditions and the following disclaimer in the
     15  *    documentation and/or other materials provided with the distribution.
     16  * 3. All advertising materials mentioning features or use of this software
     17  *    must display the following acknowledgement:
     18  *	This product includes software developed by Ichiro FUKUHARA.
     19  * 4. The name of the company nor the name of the author may be used to
     20  *    endorse or promote products derived from this software without specific
     21  *    prior written permission.
     22  *
     23  * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
     24  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     25  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     26  * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
     27  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33  * SUCH DAMAGE.
     34  */
     35 
     36 #include <sys/cdefs.h>
     37 __KERNEL_RCSID(0, "$NetBSD: ixdp425_mainbus.c,v 1.1 2003/05/23 00:57:27 ichiro Exp $");
     38 
     39 /*
     40  * front-end for the ixp425 NetworkProcessor.
     41  */
     42 
     43 #include <sys/param.h>
     44 #include <sys/systm.h>
     45 #include <sys/device.h>
     46 
     47 #include <machine/autoconf.h>
     48 #include <machine/bus.h>
     49 
     50 #include <arm/xscale/ixp425reg.h>
     51 #include <arm/xscale/ixp425var.h>
     52 
     53 #include "locators.h"
     54 
     55 static int	ixp425_mainbus_match(struct device *, struct cfdata *, void *);
     56 static void	ixp425_mainbus_attach(struct device *, struct device *, void *);
     57 
     58 CFATTACH_DECL(ixpio_mainbus, sizeof(struct ixp425_softc),
     59     ixp425_mainbus_match, ixp425_mainbus_attach, NULL, NULL);
     60 
     61 extern struct bus_space ixp425_bs_tag;
     62 
     63 int
     64 ixp425_mainbus_match(struct device *parent, struct cfdata *cf, void *aux)
     65 {
     66 	return (1);
     67 }
     68 
     69 void
     70 ixp425_mainbus_attach(struct device *parent, struct device *self, void *aux)
     71 {
     72 	struct ixp425_softc *sc = (void *) self;
     73 
     74 	ixp425_bs_init(&ixp425_bs_tag, sc);
     75 	sc->sc_iot = &ixp425_bs_tag;
     76 	sc->sc_ioh = IXP425_IO_VBASE;
     77 #if 0
     78 	/*
     79 	 * Initialize the interrupt part of our PCI chipset tag
     80 	 */
     81 	ixm1200_pci_init(&sc->ia_pci_chipset, sc);
     82 #endif
     83 	ixp425_attach(sc);
     84 }
     85