Deleted Added
full compact
ixp425_pci.c (164426) ixp425_pci.c (166064)
1/* $NetBSD: ixp425_pci.c,v 1.5 2006/04/10 03:36:03 simonb Exp $ */
2
3/*
4 * Copyright (c) 2003
5 * Ichiro FUKUHARA <ichiro@ichiro.org>.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

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>
1/* $NetBSD: ixp425_pci.c,v 1.5 2006/04/10 03:36:03 simonb Exp $ */
2
3/*
4 * Copyright (c) 2003
5 * Ichiro FUKUHARA <ichiro@ichiro.org>.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

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__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/ixp425_pci.c 164426 2006-11-19 23:55:23Z sam $");
37__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/ixp425_pci.c 166064 2007-01-17 00:58:25Z cognet $");
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/malloc.h>
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/malloc.h>
42#define _ARM32_BUS_DMA_PRIVATE
42#include <sys/bus.h>
43#include <sys/kernel.h>
44#include <sys/module.h>
45#include <sys/rman.h>
46
47#include <machine/bus.h>
48#include <machine/cpu.h>
49#include <machine/pcb.h>

--- 74 unchanged lines hidden (view full) ---

124
125 rid = 0;
126 sc->sc_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
127 IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_HWBASE + IXP425_PCI_MEM_SIZE,
128 IXP425_PCI_MEM_SIZE, RF_ACTIVE);
129 if (sc->sc_mem == NULL)
130 panic("cannot allocate PCI MEM space");
131
43#include <sys/bus.h>
44#include <sys/kernel.h>
45#include <sys/module.h>
46#include <sys/rman.h>
47
48#include <machine/bus.h>
49#include <machine/cpu.h>
50#include <machine/pcb.h>

--- 74 unchanged lines hidden (view full) ---

125
126 rid = 0;
127 sc->sc_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
128 IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_HWBASE + IXP425_PCI_MEM_SIZE,
129 IXP425_PCI_MEM_SIZE, RF_ACTIVE);
130 if (sc->sc_mem == NULL)
131 panic("cannot allocate PCI MEM space");
132
133#define AHB_OFFSET 0x10000000UL
134 if (bus_dma_tag_create(NULL, 1, 0, AHB_OFFSET + 64 * 1024 * 1024,
135 BUS_SPACE_MAXADDR, NULL, NULL, 0xffffffff, 0xff, 0xffffffff, 0,
136 NULL, NULL, &sc->sc_dmat))
137 panic("couldn't create the PCI dma tag !");
138 /*
139 * The PCI bus can only address 64MB. However, due to the way our
140 * implementation of busdma works, busdma can't tell if a device
141 * is a PCI device or not. So defaults to the PCI dma tag, which
142 * restrict the DMA'able memory to the first 64MB, and explicitely
143 * create less restrictive tags for non-PCI devices.
144 */
145 arm_root_dma_tag = sc->sc_dmat;
132 /*
133 * Initialize the bus space tags.
134 */
135 ixp425_io_bs_init(&sc->sc_pci_iot, sc);
136 ixp425_mem_bs_init(&sc->sc_pci_memt, sc);
137
138 sc->sc_dev = dev;
139

--- 13 unchanged lines hidden (view full) ---

153 IXP425_PCI_MEM_HWBASE + IXP425_PCI_MEM_SIZE) != 0) {
154 panic("ixppcib_probe: failed to set up memory rman");
155 }
156
157 /*
158 * PCI->AHB address translation
159 * begin at the physical memory start + OFFSET
160 */
146 /*
147 * Initialize the bus space tags.
148 */
149 ixp425_io_bs_init(&sc->sc_pci_iot, sc);
150 ixp425_mem_bs_init(&sc->sc_pci_memt, sc);
151
152 sc->sc_dev = dev;
153

--- 13 unchanged lines hidden (view full) ---

167 IXP425_PCI_MEM_HWBASE + IXP425_PCI_MEM_SIZE) != 0) {
168 panic("ixppcib_probe: failed to set up memory rman");
169 }
170
171 /*
172 * PCI->AHB address translation
173 * begin at the physical memory start + OFFSET
174 */
161#define AHB_OFFSET 0x10000000UL
162 PCI_CSR_WRITE_4(sc, PCI_AHBMEMBASE,
163 (AHB_OFFSET & 0xFF000000) +
164 ((AHB_OFFSET & 0xFF000000) >> 8) +
165 ((AHB_OFFSET & 0xFF000000) >> 16) +
166 ((AHB_OFFSET & 0xFF000000) >> 24) +
167 0x00010203);
168
169#define IXPPCIB_WRITE_CONF(sc, reg, val) \

--- 286 unchanged lines hidden ---
175 PCI_CSR_WRITE_4(sc, PCI_AHBMEMBASE,
176 (AHB_OFFSET & 0xFF000000) +
177 ((AHB_OFFSET & 0xFF000000) >> 8) +
178 ((AHB_OFFSET & 0xFF000000) >> 16) +
179 ((AHB_OFFSET & 0xFF000000) >> 24) +
180 0x00010203);
181
182#define IXPPCIB_WRITE_CONF(sc, reg, val) \

--- 286 unchanged lines hidden ---