Skip to content

Commit 305cfb9

Browse files
hsdenxgregkh
authored andcommitted
net: phy: dp83869: fix setting CLK_O_SEL field.
[ Upstream commit 46f74a3 ] Table 7-121 in datasheet says we have to set register 0xc6 to value 0x10 before CLK_O_SEL can be modified. No more infos about this field found in datasheet. With this fix, setting of CLK_O_SEL field in IO_MUX_CFG register worked through dts property "ti,clk-output-sel" on a DP83869HMRGZR. Signed-off-by: Heiko Schocher <hs@nabladev.com> Reviewed-by: Simon Horman <horms@kernel.org> Fixes: 01db923 ("net: phy: dp83869: Add TI dp83869 phy") Link: https://patch.msgid.link/20260425031339.3318-1-hs@nabladev.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4b0ce98 commit 305cfb9

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/net/phy/dp83869.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#define DP83869_RGMIICTL 0x0032
3232
#define DP83869_STRAP_STS1 0x006e
3333
#define DP83869_RGMIIDCTL 0x0086
34+
#define DP83869_ANA_PLL_PROG_PI 0x00c6
3435
#define DP83869_RXFCFG 0x0134
3536
#define DP83869_RXFPMD1 0x0136
3637
#define DP83869_RXFPMD2 0x0137
@@ -827,12 +828,22 @@ static int dp83869_config_init(struct phy_device *phydev)
827828
dp83869_config_port_mirroring(phydev);
828829

829830
/* Clock output selection if muxing property is set */
830-
if (dp83869->clk_output_sel != DP83869_CLK_O_SEL_REF_CLK)
831+
if (dp83869->clk_output_sel != DP83869_CLK_O_SEL_REF_CLK) {
832+
/*
833+
* Table 7-121 in datasheet says we have to set register 0xc6
834+
* to value 0x10 before CLK_O_SEL can be modified.
835+
*/
836+
ret = phy_write_mmd(phydev, DP83869_DEVADDR,
837+
DP83869_ANA_PLL_PROG_PI, 0x10);
838+
if (ret)
839+
return ret;
840+
831841
ret = phy_modify_mmd(phydev,
832842
DP83869_DEVADDR, DP83869_IO_MUX_CFG,
833843
DP83869_IO_MUX_CFG_CLK_O_SEL_MASK,
834844
dp83869->clk_output_sel <<
835845
DP83869_IO_MUX_CFG_CLK_O_SEL_SHIFT);
846+
}
836847

837848
if (phy_interface_is_rgmii(phydev)) {
838849
ret = phy_write_mmd(phydev, DP83869_DEVADDR, DP83869_RGMIIDCTL,

0 commit comments

Comments
 (0)