Page MenuHomeFreeBSD

sff: add an ACPI front-end for SFP transceivers
Needs ReviewPublic

Authored by yarshure_gmail.com on Sun, Sep 27, 1:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 28, 5:49 AM
Unknown Object (File)
Mon, Sep 28, 4:07 AM
Unknown Object (File)
Mon, Sep 28, 3:54 AM
Unknown Object (File)
Mon, Sep 28, 3:50 AM
Unknown Object (File)
Mon, Sep 28, 2:28 AM
Unknown Object (File)
Mon, Sep 28, 1:47 AM
Unknown Object (File)
Mon, Sep 28, 1:08 AM
Subscribers
None
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

The counterpart of sfp_fdt(4). Firmware describes the cage the same way a
device tree does -- a node with compatible "sff,sfp", carried in _DSD under
_HID "PRP0001" -- but places it where ACPI places an i2c device: in the scope
of the bus its EEPROM answers on, with an I2cSerialBus resource giving the
base page's 7-bit address, 0x50.

So where the FDT front-end has to follow an "i2c-bus" phandle to find its
bus, this one simply has it as a parent, and it can own the bus request
itself rather than borrowing another device on the bus. read_eeprom is then
the same single call as on the FDT side.

Everything above this -- the SFF interface, and a NIC driver's SIOCGI2C
handler -- is shared with the FDT path and learns nothing about which of the
two described the transceiver.

Depends on D60066

Test Plan

arm64 GENERIC, and a variant with sff as a module.

Hardware: SolidRun CEX7 (NXP LX2160A) under UEFI/ACPI.

This board's firmware does not describe the SFP cages. edk2-platforms'
Silicon/NXP/LX2160A/AcpiTables/Dsdt-Cex7/I2c.asl declares I2C0, the PCA9547
and channels 1 and 3 only, and says as much at the top of the file -- the
SFP+/zQSFP+ cages are among the devices left out, "Rest Devices on Mux1 are
for debug purpose".

To exercise the described path I overrode the DSDT (loader's
acpi_dsdt_load/acpi_dsdt_name; this board has no SSDT, so the override has no
other effect) with the cages added in the idiom the firmware already uses for
PHYs: a Device per channel carrying its _ADR, and under it a PRP0001 device
with _DSD compatible "sff,sfp" and an I2cSerialBusV2 at 0x50. iasl compiles
the result with the same diagnostics as the unmodified table.

The transceivers then attach as devices on the bus their EEPROM answers on:

iicbus6 <Philips I2C bus (ACPI-hinted)>
  sfp_acpi0 <Small Form-factor Pluggable Transceiver> _HID=PRP0001 _UID=5
            at addr=0xa0 handle=\_SB_.I2C0.MUX0.CH05.SFP0
iicbus7 <Philips I2C bus (ACPI-hinted)>
  sfp_acpi1 <Small Form-factor Pluggable Transceiver> _HID=PRP0001 _UID=6
            at addr=0xa0 handle=\_SB_.I2C0.MUX0.CH06.SFP1

and the last commit in this series reads both modules through them.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped