summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2002-03-09 21:52:31 +0000
committertmm <tmm@FreeBSD.org>2002-03-09 21:52:31 +0000
commit1b31933622768c8da3dd0856212605b8f745d615 (patch)
tree73f6f460724126d75ca04ca805db08d9aa34158a /sys/dev
parentc0d9a360cef77771ee10586858074b15e2309272 (diff)
downloadFreeBSD-src-1b31933622768c8da3dd0856212605b8f745d615.zip
FreeBSD-src-1b31933622768c8da3dd0856212605b8f745d615.tar.gz
Set the busmaster enable bit in the PCI command register, as the firmware
of sparc64 machines will not do this for us if the interface is not used for booting over the network.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/gem/if_gem_pci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/gem/if_gem_pci.c b/sys/dev/gem/if_gem_pci.c
index 9be2fac..26bf635 100644
--- a/sys/dev/gem/if_gem_pci.c
+++ b/sys/dev/gem/if_gem_pci.c
@@ -143,6 +143,15 @@ gem_pci_attach(dev)
{
struct gem_pci_softc *gsc = device_get_softc(dev);
struct gem_softc *sc = &gsc->gsc_gem;
+ u_int16_t csr;
+
+ /*
+ * Enable bus master access. The firmware does in some cases not do
+ * this for us on sparc64 machines.
+ */
+ csr = pci_read_config(dev, PCIR_COMMAND, 2);
+ csr |= PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN;
+ pci_write_config(dev, PCIR_COMMAND, csr, 2);
sc->sc_dev = dev;
sc->sc_pci = 1; /* XXX */
OpenPOWER on IntegriCloud