Bug 260848 - dwc_attach fails on cubiboard2
Summary: dwc_attach fails on cubiboard2
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm Any
: --- Affects Some People
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
: 260849 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-12-31 16:24 UTC by Stefan Grundmann
Modified: 2022-08-11 18:24 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Grundmann 2021-12-31 16:24:16 UTC
my comment in review R10:f77d8d10115b0863cc3dfd6e1746c02847d6569d

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.
Comment 1 Stefan Grundmann 2021-12-31 16:50:20 UTC
*** Bug 260849 has been marked as a duplicate of this bug. ***
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-02-22 09:02:42 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=da6252a6a099e6253207b69960e6762ce3cca0f8

commit da6252a6a099e6253207b69960e6762ce3cca0f8
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-02-22 08:58:36 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-02-22 09:01:56 +0000

    dwc: Support phy mode MII

    Some board use dwc phy in MII mode, so do not fail to attach if this is
    the case.
    Only rockchip code uses the phy mode to program some custom syscon register.

    PR:     260848
    MFC after:      1 week
    Sponsored by:   Beckhoff Automation GmbH & Co. KG

 sys/dev/dwc/if_dwc.c | 11 +++++++----
 sys/dev/dwc/if_dwc.h |  1 +
 2 files changed, 8 insertions(+), 4 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-03-04 10:29:49 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=949837074342a5206a17de5debd277da1d61b1cb

commit 949837074342a5206a17de5debd277da1d61b1cb
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-02-22 08:58:36 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-03-04 10:29:13 +0000

    dwc: Support phy mode MII

    Some board use dwc phy in MII mode, so do not fail to attach if this is
    the case.
    Only rockchip code uses the phy mode to program some custom syscon register.

    PR:     260848
    MFC after:      1 week
    Sponsored by:   Beckhoff Automation GmbH & Co. KG

    (cherry picked from commit da6252a6a099e6253207b69960e6762ce3cca0f8)

 sys/dev/dwc/if_dwc.c | 11 +++++++----
 sys/dev/dwc/if_dwc.h |  1 +
 2 files changed, 8 insertions(+), 4 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-08-11 18:24:02 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=9c6bcc94c875d10e3cd30b24d4854c62d4bc6ab9

commit 9c6bcc94c875d10e3cd30b24d4854c62d4bc6ab9
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-02-22 08:58:36 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-08-11 17:55:09 +0000

    dwc: Support phy mode MII

    Some board use dwc phy in MII mode, so do not fail to attach if this is
    the case.
    Only rockchip code uses the phy mode to program some custom syscon register.

    PR:     260848
    MFC after:      1 week
    Sponsored by:   Beckhoff Automation GmbH & Co. KG

    (cherry picked from commit da6252a6a099e6253207b69960e6762ce3cca0f8)

 sys/dev/dwc/if_dwc.c | 11 +++++++----
 sys/dev/dwc/if_dwc.h |  1 +
 2 files changed, 8 insertions(+), 4 deletions(-)