Page MenuHomeFreeBSD

if_awg: Support new emac bindings
ClosedPublic

Authored by kevans on Jan 5 2018, 7:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 30 2024, 12:08 AM
Unknown Object (File)
Jan 24 2024, 3:14 AM
Unknown Object (File)
Jan 17 2024, 2:12 AM
Unknown Object (File)
Jan 6 2024, 7:50 PM
Unknown Object (File)
Dec 20 2023, 3:19 AM
Unknown Object (File)
Dec 10 2023, 11:47 PM
Unknown Object (File)
Dec 9 2023, 2:08 PM
Unknown Object (File)
Nov 23 2023, 3:30 PM
Subscribers

Details

Summary

Highlights of the new bindings:

  • ahb clock is specified as 'stmmaceth'
  • The PHY to be used is now specified as phy-handle
  • We must now check the parent of the node phy-handle points to in order to discover if we're using internal PHY.
  • The ephy clk/reset will be specified on the PHY node, not the emac node.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu requested changes to this revision.Jan 6 2018, 8:43 PM

Works for me :

Tested on OrangePi-One (H3 with internal phy)
awg0: <Allwinner Gigabit Ethernet> mem 0x1c30000-0x1c3ffff irq 21 on simplebus0
simplebus0: no default resources for rid = 1, type = 3
awg0: PHY type: mii, conf mode: reg
awg0: Using internal PHY
awg0: EMAC clock: 0x00168000
awg0: AHB frequency 300000000 Hz, MDC div: 0x3

Tested On NanoPi M1 Plus (H3 with external phy) :
awg0: <Allwinner Gigabit Ethernet> mem 0x1c30000-0x1c3ffff irq 21 on simplebus0
simplebus0: no default resources for rid = 1, type = 3
awg0: clk_ephy not found
awg0: rst_ephy not found
awg0: PHY type: rgmii, conf mode: reg
awg0: No internal PHY
awg0: EMAC clock: 0x00050006
awg0: AHB frequency 300000000 Hz, MDC div: 0x3

Just a little nit, the printf that print that clk/rst for ephy isn't found when it's not enabled.
Also should we attach is phy_node == 0 ? That would mean that either internal or external phy was found no ?

This revision now requires changes to proceed.Jan 6 2018, 8:43 PM

All test were done using linux 4.15-rc6 dts with u-boot from ports. Booted from sdcard or netbooted.

In D13777#288714, @manu wrote:

Works for me :

Dang =)

Just a little nit, the printf that print that clk/rst for ephy isn't found when it's not enabled.

I intend to remove these, unless you think they'd be helpful in debugging other stuff- then I could fix them.

Also should we attach is phy_node == 0 ? That would mean that either internal or external phy was found no ?

IIRC, that would break our legacy compatibility. The phy-handle is a new binding thing (again, IIRC), so we'll need to maintain it for some time like this.

kevans edited the summary of this revision. (Show Details)
  • Removed a bunch of device_printf's that were added in frustration while trying to figure out why it wasn't working on my OrangePi One.
  • Made awg fail to attach if we have a phy-handle that we failed to resolve to a node.

@manu - any further objections? I'll add some "Tested on" lines to the commit message prior to commit.

This revision is now accepted and ready to land.Jan 11 2018, 6:13 AM
This revision was automatically updated to reflect the committed changes.