
On 2/22/22 08:35, Frieder Schrempf wrote:
Hi Marek,
Hi,
+int board_phy_config(struct phy_device *phydev) +{ + /* enable rgmii rxc skew and phy mode select to RGMII copper */ + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x1f); + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x8);
+ phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x00); + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x82ee); + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05); + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100);
This is a AR8031, correct? Is there a reason why you don't use the device tree binding to set RGMII voltage, and RX and tx delays?
I quickly cobbled this together from another board, since I needed ethernet to do other tests with this board and the ethernet support was missing. If you can send subsequent patch to flip this to DT-only setup, I can test the patch on the board.
So why don't you post it as RFC? To be honest it seems a bit contradictory that you normally take a critical position on other people's patches when they use legacy code instead of DM/DT (which is alright) and then send a half-baked approach yourself and expect other people to fix it for you afterwards.
I don't want to complain, it just occurred to me.
It's just a patch I had half-baked in a tree for over a year, so I sent it. It didn't occur to me there is now a way to do this in DT, since the patch was in my tree for so long and I only dealt with the ar803x PHY recently. I will try and convert this to DT next time I have the board on my desk, but if someone is faster ... even better.