Page MenuHomeFreeBSD

Add etherswitch support to mge
ClosedPublic

Authored by bsz_semihalf.com on Oct 15 2015, 12:30 PM.
Referenced Files
Unknown Object (File)
Sun, Nov 10, 9:12 AM
Unknown Object (File)
Fri, Nov 8, 10:48 PM
Unknown Object (File)
Mon, Nov 4, 10:18 AM
Unknown Object (File)
Sun, Oct 27, 10:33 PM
Unknown Object (File)
Sun, Oct 27, 10:28 PM
Unknown Object (File)
Sun, Oct 27, 8:41 PM
Unknown Object (File)
Sep 23 2024, 8:40 PM
Unknown Object (File)
Sep 9 2024, 3:34 AM
Subscribers

Details

Summary

This commit introduces support for etherswitch devices that utilize SMI as a way of accessing its registers. SMI register is located in address space of mge -- access to it was exported through MDIO interface.

Attachment functions were enhanced so as to ensure proper initialisation in both cases: 1) PHYs attached directly to mge, 2) PHYs attached to switch device and switch attached to mge. Attachment of etherswitch device depends on dts entry with compatible="mrvl,sw" property. If none is found, typical PHY attachment procedure follows.

In case of switch attached, PHYs' status and configuration is accessible via etherswitchcfg, and ifconfig shows always-up, non-configurable mge interfaces.

Due to the fact that there may be simultaneous accessess to SMI registers (e.g. from PHY attached to one of mge instances and switch to the other), SMI access interlock was added. It is SX lock, because sleep ability is necessary -- busy-waiting would result in poor performance due to long delays required by hardware. Underlying switch driver is obliged to use sleepable locks as well.

Test Plan

It was tested on DB-88F6XXX (mge with singly PHY) and one custom Kirkwood-based platform (equipped with switch device).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bsz_semihalf.com retitled this revision from to Add etherswitch support to mge.
bsz_semihalf.com updated this object.
bsz_semihalf.com edited the test plan for this revision. (Show Details)
bsz_semihalf.com added reviewers: adrian, ian, zbb.
bsz_semihalf.com set the repository for this revision to rS FreeBSD src repository - subversion.
bsz_semihalf.com added a project: network.
adrian edited edge metadata.

looks fine to me. Please commit!

This revision is now accepted and ready to land.Oct 18 2015, 7:09 AM
This revision was automatically updated to reflect the committed changes.