Re: Re: [PATCH v3 12/13] arm64: dts: mediatek: mt7988a-bpi-r4: add sfp cages and link to gmac

Andrew Lunn
2025-06-10T12:59:08Z

> > sff,sfp.yaml says:
> >
> > maximum-power-milliwatt:
> > minimum: 1000
> > default: 1000
> > description:
> > Maximum module power consumption Specifies the maximum power consumption
> > allowable by a module in the slot, in milli-Watts. Presently, modules can
> > be up to 1W, 1.5W or 2W.
> >
> > I've no idea what will happen when the SFP core sees 3000. Is the
> > comment out of date?
>
> at least sfp-core has no issue with the setting
>
> root@bpi-r4-phy-8G:~# dmesg | grep sfp
> [ 1.269437] sfp sfp1: Host maximum power 3.0W
> [ 1.613749] sfp sfp1: module CISCO-FINISAR FTLX8571D3BCL-C2 rev A sn S2209167650 dc 220916
>
> imho some modules require more than 2W (some gpon/xpon and 10G copper ethernet).

Looking at the code:

static int sfp_module_parse_power(struct sfp *sfp)
{
u32 power_mW = 1000;
bool supports_a2;

if (sfp->id.ext.sff8472_compliance >= SFP_SFF8472_COMPLIANCE_REV10_2 &&
sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_POWER_DECL))
power_mW = 1500;
/* Added in Rev 11.9, but there is no compliance code for this */
if (sfp->id.ext.sff8472_compliance >= SFP_SFF8472_COMPLIANCE_REV11_4 &&
sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_HIGH_POWER_LEVEL))
power_mW = 2000;

How does your module indicate it needs 3000 mW? Does this bit of code
need extending to read additional bits?

Andrew