Author: mw
Date: Tue Apr 10 08:35:43 2018
New Revision: 332354
URL: https://svnweb.freebsd.org/changeset/base/332354

Log:
  Improve detection of addressing mode in e6000sw
  
  Some devices cannot rely on the switch MDIO address passed in the DTB
  for specifying single/multi-chip addressing mode. Introduce new property
  "single-chip-addressing" which added to DTS will force single-chip mode.
  
  Submitted by: Michal Mazur <m...@semihalf.com>
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14800

Modified:
  head/sys/dev/etherswitch/e6000sw/e6000sw.c

Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c
==============================================================================
--- head/sys/dev/etherswitch/e6000sw/e6000sw.c  Tue Apr 10 08:19:14 2018        
(r332353)
+++ head/sys/dev/etherswitch/e6000sw/e6000sw.c  Tue Apr 10 08:35:43 2018        
(r332354)
@@ -213,7 +213,9 @@ e6000sw_probe(device_t dev)
        if (OF_getencprop(sc->node, "reg", &sc->sw_addr,
            sizeof(sc->sw_addr)) < 0)
                return (ENXIO);
-       if (sc->sw_addr != 0 && (sc->sw_addr % 2) == 0)
+
+       if (!OF_hasprop(sc->node, "single-chip-addressing") &&
+           (sc->sw_addr != 0 && (sc->sw_addr % 2) == 0))
                sc->multi_chip = true;
 
        /*
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to