Re: [PATCH net-next 5/5] net: mdio: bcm-unimac: implement timestamped MDIO writes
flat view
From: Nicolai Buchwitz <nb@tipi-net.de>
Date: 2026-10-10 15:18:18
Also in:
lkml
Hi Florian, hi James On 9.10.2026 18:04, Florian Fainelli wrote:
[...]
quoted
When there is no clock, unimac_mdio_clk_set() assumes a 250 MHz reference rate, and no in-tree DT gives GENET or UniMAC a clock. For BCM2711 I have no documentation of the reference rate or of the clock that supplies it, but MDIO busy times measured at several MDC dividers fit a rate of 200 MHz. This patch checks the parent's compatible string, which is unsatisfactory. I would prefer to get the rate from DT, and would welcome suggestions for the right DT description.You can, and should define a chip-specific compatible string for the MDIO contorller node. We have one for 2711 already for GENET (brcm,bcm2711-genet-v5), so you could define brcm,bcm2711-genet-mdio-v5 The clock frequency is fixed, so you could also provide a fixed clock to ensure that the clock frequency is derived correctly. I will check the actual clocking because 200MHz sounds odd to me, since the RGMII interface does require 125MHz and therefore a 250MHz source makes that easy.
I dug a bit deeper on a CM4: AFAIU the MDC runs off the GISB clock, which the firmware sets to 200 MHz (CPRMAN 0x1d8, PLLD_PER 750 MHz / 3.75). Bumping that divider to 4.0 at runtime moves the MDIO busy time by exactly the same ratio, so that's the one. The 250 MHz you have in mind is genet250 / genet125, the RGMII side, a different generator. So instead of a fixed clock or a compatible match this could just be BCM2711_CLOCK_GISB in clk-bcm2835 (critical, firmware owns it) and clocks = <&clocks BCM2711_CLOCK_GISB> on the mdio node. I can send that if it helps. Regards, Nicolai