HomeFreeBSD

dwc: Use mii_fdt function
Concern Raisedf77d8d10115b

Description

dwc: Use mii_fdt function

Use the helper function to get phy mode and configure dwc accordingly.

Reviewed by: ian

Details

Auditors
sg2342_googlemail.com
Provenance
manuAuthored on Apr 11 2021, 7:34 PM
Parents
rG80020d788834: mmccam: probe*: Style(9)
Branches
Unknown
Tags
Unknown

Event Timeline

This commit changed the behavior of dwc_attach() in a way that broke ethernet on my Allwinner A20 based cubieboard2:

root@cubieboard2:~ # ofwdump -P 'phy-mode' /soc/ethernet@1c50000 
Node 0x5354: ethernet@1c50000
  phy-mode:
    6d 69 69 00 
    'mii'

before this commit; dwc_attach() on the cubieboard2 would leave set sc->phy_mode alone (which is fine since sys/arm/allwinner/aw_if_dwc.c does not need this information).
now it fails with ENXIO.

This commit now has outstanding concerns.Dec 31 2021, 4:08 PM
This comment was removed by kevans.

Sorry, I deleted that as I realized it was all wrong once I re-read the quoted comment.

We should likely just be leaving this as PHY_MODE_UNKNOWN, and rockchip (seems to be the only consumer?) can/should punt if it gets !RGMII/RMII.