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)
Thu, Aug 8, 10:45 AM
Unknown Object (File)
Fri, Aug 2, 2:42 AM
Unknown Object (File)
Mon, Jul 29, 12:21 PM
Unknown Object (File)
Sun, Jul 28, 5:54 PM
Unknown Object (File)
Jul 10 2024, 5:36 AM
Unknown Object (File)
Jul 10 2024, 2:05 AM
Unknown Object (File)
Jul 3 2024, 10:12 PM
Unknown Object (File)
Jun 21 2024, 2:22 PM
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.