diff options
author | cognet <cognet@FreeBSD.org> | 2004-12-21 11:36:09 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2004-12-21 11:36:09 +0000 |
commit | a90b1e36568bbf68413166df0db874fdf3e841c2 (patch) | |
tree | 2a42df39f65eb52ccf57743a9dbe46c0c75610f5 /sys/arm | |
parent | 618fb8df6386ee7a6ff1b347b88638ab500edae9 (diff) | |
download | FreeBSD-src-a90b1e36568bbf68413166df0db874fdf3e841c2.zip FreeBSD-src-a90b1e36568bbf68413166df0db874fdf3e841c2.tar.gz |
- 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>
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/xscale/i80321/i80321_pci.c | 18 |
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 965f01e..41582b4 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; |