1 /* $NetBSD: ixp425.c,v 1.12 2009/03/17 00:51:27 msaitoh Exp $ */
5 * Ichiro FUKUHARA <ichiro@ichiro.org>.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
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.
17 * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 #include <sys/cdefs.h>
33 __KERNEL_RCSID(0, "$NetBSD: ixp425.c,v 1.12 2009/03/17 00:51:27 msaitoh Exp $");
35 #include <sys/param.h>
36 #include <sys/systm.h>
37 #include <sys/device.h>
40 #include <machine/bus.h>
42 #include <arm/xscale/ixp425reg.h>
43 #include <arm/xscale/ixp425var.h>
45 struct ixp425_softc
*ixp425_softc
;
48 ixp425_attach(struct ixp425_softc
*sc
)
51 struct pcibus_attach_args pba
;
54 sc
->sc_iot
= &ixp425_bs_tag
;
61 * Mapping for GPIO Registers
63 if (bus_space_map(sc
->sc_iot
, IXP425_GPIO_HWBASE
, IXP425_GPIO_SIZE
,
65 panic("%s: unable to map GPIO registers", sc
->sc_dev
.dv_xname
);
67 if (bus_space_map(sc
->sc_iot
, IXP425_EXP_HWBASE
, IXP425_EXP_SIZE
,
69 panic("%s: unable to map Expansion Bus registers",
76 if (bus_space_map(sc
->sc_iot
, IXP425_PCI_HWBASE
, IXP425_PCI_SIZE
,
78 panic("%s: unable to map PCI registers", sc
->sc_dev
.dv_xname
);
81 * Invoke the board-specific PCI initialization code
83 ixp425_md_pci_init(sc
);
86 * Generic initialization of the PCI chipset.
91 * Initialize the DMA tags.
93 ixp425_pci_dma_init(sc
);
98 pba
.pba_pc
= &sc
->ia_pci_chipset
;
99 pba
.pba_iot
= &sc
->sc_pci_iot
;
100 pba
.pba_memt
= &sc
->sc_pci_memt
;
101 pba
.pba_dmat
= &sc
->ia_pci_dmat
;
102 pba
.pba_bus
= 0; /* bus number = 0 */
103 pba
.pba_bridgetag
= NULL
;
104 pba
.pba_intrswiz
= 0; /* XXX */
106 pba
.pba_flags
= PCI_FLAGS_IO_ENABLED
| PCI_FLAGS_MEM_ENABLED
|
107 PCI_FLAGS_MRL_OKAY
| PCI_FLAGS_MRM_OKAY
|
109 (void) config_found_ia(&sc
->sc_dev
, "pcibus", &pba
, pcibusprint
);