aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Houchard <cognet@FreeBSD.org>2004-12-21 11:36:09 +0000
committerOlivier Houchard <cognet@FreeBSD.org>2004-12-21 11:36:09 +0000
commite1e6b9d3c6f5d4c5bef0fba915a31ef5f7809c96 (patch)
tree2a42df39f65eb52ccf57743a9dbe46c0c75610f5
parent564299ef5fafdac487298f80c694712f1b640623 (diff)
downloadsrc-e1e6b9d3c6f5d4c5bef0fba915a31ef5f7809c96.tar.gz
src-e1e6b9d3c6f5d4c5bef0fba915a31ef5f7809c96.zip
- The IQ80321 has a jumper which changes the PCI device id from 4 to 8 for the
GigE controller, so handle this. - Use the outbound window 0 if the PCI mem requested is in its range, instead of inconditionally use the outbound window 1. This should be enough to get FreeBSD/arm to work on the IQ80321 board as well. Reported and tested by: Jia-Shiun Li <jiashiun at gmail dot com>
Notes
Notes: svn path=/head/; revision=139117
-rw-r--r--sys/arm/xscale/i80321/i80321_pci.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/arm/xscale/i80321/i80321_pci.c b/sys/arm/xscale/i80321/i80321_pci.c
index 965f01e0ec72..41582b47de48 100644
--- a/sys/arm/xscale/i80321/i80321_pci.c
+++ b/sys/arm/xscale/i80321/i80321_pci.c
@@ -236,7 +236,7 @@ i80321_pci_write_config(device_t dev, int bus, int slot, int func, int reg,
struct i80321_pci_softc *sc = device_get_softc(dev);
uint32_t addr;
- if (i80321_pci_conf_setup(sc, bus, slot, func, reg, &addr))
+ if (i80321_pci_conf_setup(sc, bus, slot, func, reg & ~3, &addr))
return;
@@ -244,10 +244,12 @@ i80321_pci_write_config(device_t dev, int bus, int slot, int func, int reg,
addr);
switch (bytes) {
case 1:
- bus_space_write_1(sc->sc_st, sc->sc_atu_sh, ATU_OCCDR, data);
+ bus_space_write_1(sc->sc_st, sc->sc_atu_sh, ATU_OCCDR +
+ (reg & 3), data);
break;
case 2:
- bus_space_write_2(sc->sc_st, sc->sc_atu_sh, ATU_OCCDR, data);
+ bus_space_write_2(sc->sc_st, sc->sc_atu_sh, ATU_OCCDR +
+ (reg & 3), data);
break;
case 4:
bus_space_write_4(sc->sc_st, sc->sc_atu_sh, ATU_OCCDR, data);
@@ -266,7 +268,6 @@ i80321_pci_route_interrupt(device_t pcib, device_t dev, int pin)
int func;
uint32_t busno;
struct i80321_pci_softc *sc = device_get_softc(pcib);
-
bus = pci_get_bus(dev);
device = pci_get_slot(dev);
func = pci_get_function(dev);
@@ -293,6 +294,10 @@ i80321_pci_route_interrupt(device_t pcib, device_t dev, int pin)
goto no_mapping;
/* IQ80321 PCI */
case 4: /* i82544 Gig-E */
+ case 8: /*
+ * Apparently you can set the device for the ethernet adapter
+ * to 8 with a jumper, so handle that as well
+ */
if (pin == 1)
return (ICU_INT_XINT(0));
goto no_mapping;
@@ -362,7 +367,10 @@ i80321_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
case SYS_RES_MEMORY:
rm = &sc->sc_mem_rman;
bt = sc->sc_pcimem;
- bh = sc->sc_mem;
+ bh = (start >= 0x80000000 && start < 0x84000000) ? 0x80000000 :
+ sc->sc_mem;
+ start &= (0x1000000 - 1);
+ end &= (0x1000000 - 1);
break;
case SYS_RES_IOPORT:
rm = &sc->sc_io_rman;