Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: renesas: r8a779f0-ether-serdes: add new step added to latest datasheet

R-Car S4-8 datasheet Rev.1.20 describes some additional register
settings at the end of the initialization.

Signed-off-by: Michael Dege <michael.dege@renesas.com>
Link: https://lore.kernel.org/r/20250703-renesas-serdes-update-v4-2-1db5629cac2b@renesas.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Michael Dege and committed by
Vinod Koul
e4a8db93 d337c557

+28
+28
drivers/phy/renesas/r8a779f0-ether-serdes.c
··· 49 49 iowrite32(data, addr + offs); 50 50 } 51 51 52 + static u32 r8a779f0_eth_serdes_read32(void __iomem *addr, u32 offs, u32 bank) 53 + { 54 + iowrite32(bank, addr + R8A779F0_ETH_SERDES_BANK_SELECT); 55 + 56 + return ioread32(addr + offs); 57 + } 58 + 52 59 static int 53 60 r8a779f0_eth_serdes_reg_wait(struct r8a779f0_eth_serdes_channel *channel, 54 61 u32 offs, u32 bank, u32 mask, u32 expected) ··· 326 319 *channel) 327 320 { 328 321 int ret; 322 + u32 val; 329 323 330 324 ret = r8a779f0_eth_serdes_chan_setting(channel); 331 325 if (ret) ··· 339 331 r8a779f0_eth_serdes_write32(channel->addr, 0x03c0, 0x380, 0x0000); 340 332 341 333 r8a779f0_eth_serdes_write32(channel->addr, 0x03d0, 0x380, 0x0000); 334 + 335 + val = r8a779f0_eth_serdes_read32(channel->addr, 0x00c0, 0x180); 336 + r8a779f0_eth_serdes_write32(channel->addr, 0x00c0, 0x180, val | BIT(8)); 337 + ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0100, 0x180, BIT(0), 1); 338 + if (ret) 339 + return ret; 340 + r8a779f0_eth_serdes_write32(channel->addr, 0x00c0, 0x180, val & ~BIT(8)); 341 + ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0100, 0x180, BIT(0), 0); 342 + if (ret) 343 + return ret; 344 + 345 + val = r8a779f0_eth_serdes_read32(channel->addr, 0x0144, 0x180); 346 + r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, val | BIT(4)); 347 + ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0180, 0x180, BIT(0), 1); 348 + if (ret) 349 + return ret; 350 + r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, val & ~BIT(4)); 351 + ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0180, 0x180, BIT(0), 0); 352 + if (ret) 353 + return ret; 342 354 343 355 return r8a779f0_eth_serdes_monitor_linkup(channel); 344 356 }