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