Implement the SIOCGI2C interface ioctl on dpaa2 network interfaces so
"ifconfig -v dpniX" can report an attached SFP+ module's SFF-8472
identity (vendor, part/serial number, date) and diagnostics
(temperature, voltage, TX bias, RX/TX optical power). ifconfig(8)
already decodes the raw EEPROM bytes; only the kernel side to fetch them
over i2c was missing.
The module EEPROM (i2c addresses 0xA0/0xA2) is reached over the i2c bus
the DPMAC's SFP cage sits on, resolved in one of two ways:
- FDT: the DPMAC node's "sfp" phandle references an "sff,sfp" node whose "i2c-bus" property names the (possibly muxed) i2c bus. A new dpaa2_mc bus method, get_sfp_dev(), resolves a DPMAC id to that i2c bus device; any i2c mux is switched transparently by the i2c framework on request.
- ACPI: firmware provides no such association, so it is supplied per interface by loader tunables and the i2c mux (if any) is switched explicitly (hw.dpaa2.dpni<unit>.sfp_bus / sfp_mux / sfp_chan / sfp_type).
The read holds the i2c bus across the optional mux channel select, the
SFF-8472 offset write (repeat-start) and the data read. Note iicbus
slave addresses are 8-bit left-aligned, so the ifi2creq dev_addr
(0xA0/0xA2) is used directly.
Developed with AI assistance; the design and SFF-8472 byte offsets were
reviewed by hand against the spec and an independent user-space decoder.
MFC after: 2 weeks