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 <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14800
This commit is contained in:
Marcin Wojtas 2018-04-10 08:35:43 +00:00
parent 2caa5afc9c
commit fb4478a336
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332354

View File

@ -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;
/*