ixp12x0_mainbus.c revision 1.1
11.1Sichiro/*	$NetBSD: ixp12x0_mainbus.c,v 1.1 2002/07/15 17:13:34 ichiro Exp $ */
21.1Sichiro/*
31.1Sichiro * Copyright (c) 2002
41.1Sichiro *	Ichiro FUKUHARA <ichiro@ichiro.org>.
51.1Sichiro * All rights reserved.
61.1Sichiro *
71.1Sichiro * Redistribution and use in source and binary forms, with or without
81.1Sichiro * modification, are permitted provided that the following conditions
91.1Sichiro * are met:
101.1Sichiro * 1. Redistributions of source code must retain the above copyright
111.1Sichiro *    notice, this list of conditions and the following disclaimer.
121.1Sichiro * 2. Redistributions in binary form must reproduce the above copyright
131.1Sichiro *    notice, this list of conditions and the following disclaimer in the
141.1Sichiro *    documentation and/or other materials provided with the distribution.
151.1Sichiro * 3. All advertising materials mentioning features or use of this software
161.1Sichiro *    must display the following acknowledgement:
171.1Sichiro *	This product includes software developed by Ichiro FUKUHARA.
181.1Sichiro * 4. The name of the company nor the name of the author may be used to
191.1Sichiro *    endorse or promote products derived from this software without specific
201.1Sichiro *    prior written permission.
211.1Sichiro *
221.1Sichiro * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
231.1Sichiro * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
241.1Sichiro * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
251.1Sichiro * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
261.1Sichiro * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
271.1Sichiro * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
281.1Sichiro * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
291.1Sichiro * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
301.1Sichiro * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
311.1Sichiro * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
321.1Sichiro * SUCH DAMAGE.
331.1Sichiro */
341.1Sichiro
351.1Sichiro/*
361.1Sichiro * front-end for the ixp12x0 I/O Processor.
371.1Sichiro */
381.1Sichiro
391.1Sichiro#include <sys/param.h>
401.1Sichiro#include <sys/systm.h>
411.1Sichiro#include <sys/device.h>
421.1Sichiro
431.1Sichiro#include <machine/autoconf.h>
441.1Sichiro#include <machine/bus.h>
451.1Sichiro
461.1Sichiro#include <evbarm/ixm1200/ixm1200reg.h>
471.1Sichiro#include <evbarm/ixm1200/ixm1200var.h>
481.1Sichiro
491.1Sichiro#include <arm/ixp12x0/ixp12x0reg.h>
501.1Sichiro#include <arm/ixp12x0/ixp12x0var.h>
511.1Sichiro
521.1Sichiro#include "locators.h"
531.1Sichiro
541.1Sichirostatic int	ixp12x0_mainbus_match(struct device *, struct cfdata *, void *);
551.1Sichirostatic void	ixp12x0_mainbus_attach(struct device *, struct device *, void *);
561.1Sichiro
571.1Sichirostruct cfattach ixpio_mainbus_ca = {
581.1Sichiro	sizeof(struct ixp12x0_softc), ixp12x0_mainbus_match,
591.1Sichiro	    ixp12x0_mainbus_attach,
601.1Sichiro};
611.1Sichiro
621.1Sichiroextern struct bus_space ixp12x0_bs_tag;
631.1Sichiro
641.1Sichiroint
651.1Sichiroixp12x0_mainbus_match(struct device *parent, struct cfdata *cf, void *aux)
661.1Sichiro{
671.1Sichiro	return (1);
681.1Sichiro}
691.1Sichiro
701.1Sichirovoid
711.1Sichiroixp12x0_mainbus_attach(struct device *parent, struct device *self, void *aux)
721.1Sichiro{
731.1Sichiro	struct ixp12x0_softc *sc = (void *) self;
741.1Sichiro
751.1Sichiro	ixp12x0_bs_init(&ixp12x0_bs_tag, sc);
761.1Sichiro	sc->sc_iot = &ixp12x0_bs_tag;
771.1Sichiro	sc->sc_ioh = IXP12X0_PCI_VBASE;
781.1Sichiro
791.1Sichiro	/*
801.1Sichiro	 * Initialize the interrupt part of our PCI chipset tag
811.1Sichiro	 */
821.1Sichiro	ixm1200_pci_init(&sc->ia_pci_chipset, sc);
831.1Sichiro
841.1Sichiro	ixp12x0_attach(sc);
851.1Sichiro}
86