sun7i_a20_gmac_clk_setup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

sun7i_a20_gmac_clk_setup β€” the setup function for the A20/A31 GMAC clock module, bestie πŸ’–


✨ SYNOPSIS ✨

void sun7i_a20_gmac_clk_setup (struct device_node *node );

πŸŽ€ ARGUMENTS πŸŽ€

  • node β€” the struct device_node for the clock, like that's literally the whole personality of this argument 🫢

πŸ’… DESCRIPTION πŸ’…

okay so picture this clock, right? it's giving circuit diagram, and it looks something like this:

       This clock looks something like this ________________________ MII TX
       clock from PHY >-----|___________    _________|----> to GMAC core GMAC
       Int. RGMII TX clk >----|_____________/__gate---|----> to PHY Ext. 125MHz
       RGMII TX clk >--|__divider__/            | |________________________|

the way that this whole thing works: that external 125 MHz reference is optional, no cap β€” the GMAC can just use its internal TX clock and it's literally fine πŸ’€. and heads up, the A31 GMAC clock module does not have the divider controls for the external reference. so don't go looking for them, they're not there, periodt.

to keep it simple (and honestly, iconic of them), let the GMAC use either the MII TX clock for MII mode, and its internal TX clock for GMII and RGMII modes. the GMAC driver should be the one selecting the appropriate source and gating/ungating the output to the PHY πŸ‘‘

⚠️ only the GMAC should use this clock. altering the clock so that it doesn't match the GMAC's operation parameters will result in the GMAC not being able to send traffic out 😭 that's the whole point of the thing, bestie.

the GMAC driver should set the clock rate and enable/disable this clock to configure the required state β€” and the clock driver then responds by auto-reparenting the clock. it just does that. main character energy fr fr ✨


πŸ¦‹ SEE ALSO πŸ¦‹

  • kernel file ./drivers/clk/sunxi/clk-a20-gmac.c β€” go read it, iykyk πŸ“–

and that's the whole page, bestie πŸŽ€ this came to you from ./drivers/clk/sunxi, dated October 2026, and it's titled sun7i_a20_gmac_clk_setup(9) in case you forgot already πŸ™ˆ slay, go configure your clocks πŸ’…βœ¨

πŸ“¦ where this page comes from