Message ID | 20240926-th1520-dwmac-v2-0-f34f28ad1dc9@tenstorrent.com (mailing list archive) |
---|---|
Headers | show |
Series | Add the dwmac driver support for T-HEAD TH1520 SoC | expand |
> Regarding rx and tx internal delays, that same section in the manual > doesn't specify what unit is represented by the delay_ctrl bit field in > GMAC_RXCLK_DELAY_CTRL and GMAC_TXCLK_DELAY_CTRL. It is only 5 bits and > a max value of 31 seems too small to represent picoseconds. The vendor > kernel [2] uses properties named "rx-clk-delay" and "tx-clk-delay" but > doesn't indicate any units. I see ti,dp83867.yaml adds vendor specific > rx and tx delay properties so that is what I've now done in this series. > Note: the hardware default value of 0 for delay_ctrl works okay for the > TH1520 hardware that I have. I assume you are talking about RGMII delays here? Do you have a board which needs to set these delays? In general, linux has the PHY provide the 2ns delay. You only need the MAC to add the delays if a PHY is being used which cannot add the needed delays. Occasionally you need to fine tune the delay, and the MAC delays can then be interesting. But since you have no idea what the units are, i would prefer to simply hard code it to 0, unless is it really needed. Andrew
On Thu, Sep 26, 2024 at 08:23:12PM +0200, Andrew Lunn wrote: > > Regarding rx and tx internal delays, that same section in the manual > > doesn't specify what unit is represented by the delay_ctrl bit field in > > GMAC_RXCLK_DELAY_CTRL and GMAC_TXCLK_DELAY_CTRL. It is only 5 bits and > > a max value of 31 seems too small to represent picoseconds. The vendor > > kernel [2] uses properties named "rx-clk-delay" and "tx-clk-delay" but > > doesn't indicate any units. I see ti,dp83867.yaml adds vendor specific > > rx and tx delay properties so that is what I've now done in this series. > > Note: the hardware default value of 0 for delay_ctrl works okay for the > > TH1520 hardware that I have. > > I assume you are talking about RGMII delays here? > > Do you have a board which needs to set these delays? In general, linux > has the PHY provide the 2ns delay. You only need the MAC to add the > delays if a PHY is being used which cannot add the needed > delays. Occasionally you need to fine tune the delay, and the MAC > delays can then be interesting. But since you have no idea what the > units are, i would prefer to simply hard code it to 0, unless is it > really needed. > > Andrew Yes, this is for the RGMII delays. None of the TH1520 boards that I have seem to need this. The hardware reset value is 0 which seems to work okay. I'll remove these custom properties in the next revision. Thanks, Drew