diff options
author | marius <marius@FreeBSD.org> | 2010-09-16 09:29:48 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2010-09-16 09:29:48 +0000 |
commit | 485553ca579c4163a30ab9a6707f9d7ed1e820d3 (patch) | |
tree | 1d572ec4d18b333dcd9ee430e578ca7439a2bd58 /sys/dev/gem/if_gem_pci.c | |
parent | a59a434889e85d1d59947cb293330c657a32b412 (diff) | |
download | FreeBSD-src-485553ca579c4163a30ab9a6707f9d7ed1e820d3.zip FreeBSD-src-485553ca579c4163a30ab9a6707f9d7ed1e820d3.tar.gz |
Merge r207585 from cas(4):
- Don't probe for PHYs if we already know to use a SERDES. Unlike as with
cas(4) this only serves to speed up the the device attach though and can
only be determined via the OFW device tree but not from the VPD.
- Don't touch the MIF when using a SERDES.
- Add some missing bus space barriers, mainly in the PCS code path.
Diffstat (limited to 'sys/dev/gem/if_gem_pci.c')
-rw-r--r-- | sys/dev/gem/if_gem_pci.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/gem/if_gem_pci.c b/sys/dev/gem/if_gem_pci.c index 051dbcc..cfea337 100644 --- a/sys/dev/gem/if_gem_pci.c +++ b/sys/dev/gem/if_gem_pci.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include <machine/bus.h> #if defined(__powerpc__) || defined(__sparc64__) +#include <dev/ofw/ofw_bus.h> #include <dev/ofw/openfirm.h> #include <machine/ofw_machdep.h> #endif @@ -140,12 +141,17 @@ static struct resource_spec gem_pci_res_spec[] = { { -1, 0 } }; +#define GEM_SHARED_PINS "shared-pins" +#define GEM_SHARED_PINS_SERDES "serdes" + static int gem_pci_attach(device_t dev) { struct gem_softc *sc; int i; -#if !(defined(__powerpc__) || defined(__sparc64__)) +#if defined(__powerpc__) || defined(__sparc64__) + char buf[sizeof(GEM_SHARED_PINS)]; +#else int j; #endif @@ -207,6 +213,12 @@ gem_pci_attach(device_t dev) #if defined(__powerpc__) || defined(__sparc64__) OF_getetheraddr(dev, sc->sc_enaddr); + if (OF_getprop(ofw_bus_get_node(dev), GEM_SHARED_PINS, buf, + sizeof(buf)) > 0) { + buf[sizeof(buf) - 1] = '\0'; + if (strcmp(buf, GEM_SHARED_PINS_SERDES) == 0) + sc->sc_flags |= GEM_SERDES; + } #else /* * Dig out VPD (vital product data) and read NA (network address). |