Skip to content

Commit e4a8db9

Browse files
mdegevinodkoul
authored andcommitted
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>
1 parent d337c55 commit e4a8db9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

drivers/phy/renesas/r8a779f0-ether-serdes.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ static void r8a779f0_eth_serdes_write32(void __iomem *addr, u32 offs, u32 bank,
4949
iowrite32(data, addr + offs);
5050
}
5151

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+
5259
static int
5360
r8a779f0_eth_serdes_reg_wait(struct r8a779f0_eth_serdes_channel *channel,
5461
u32 offs, u32 bank, u32 mask, u32 expected)
@@ -319,6 +326,7 @@ static int r8a779f0_eth_serdes_hw_init_late(struct r8a779f0_eth_serdes_channel
319326
*channel)
320327
{
321328
int ret;
329+
u32 val;
322330

323331
ret = r8a779f0_eth_serdes_chan_setting(channel);
324332
if (ret)
@@ -332,6 +340,26 @@ static int r8a779f0_eth_serdes_hw_init_late(struct r8a779f0_eth_serdes_channel
332340

333341
r8a779f0_eth_serdes_write32(channel->addr, 0x03d0, 0x380, 0x0000);
334342

343+
val = r8a779f0_eth_serdes_read32(channel->addr, 0x00c0, 0x180);
344+
r8a779f0_eth_serdes_write32(channel->addr, 0x00c0, 0x180, val | BIT(8));
345+
ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0100, 0x180, BIT(0), 1);
346+
if (ret)
347+
return ret;
348+
r8a779f0_eth_serdes_write32(channel->addr, 0x00c0, 0x180, val & ~BIT(8));
349+
ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0100, 0x180, BIT(0), 0);
350+
if (ret)
351+
return ret;
352+
353+
val = r8a779f0_eth_serdes_read32(channel->addr, 0x0144, 0x180);
354+
r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, val | BIT(4));
355+
ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0180, 0x180, BIT(0), 1);
356+
if (ret)
357+
return ret;
358+
r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, val & ~BIT(4));
359+
ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0180, 0x180, BIT(0), 0);
360+
if (ret)
361+
return ret;
362+
335363
return r8a779f0_eth_serdes_monitor_linkup(channel);
336364
}
337365

0 commit comments

Comments
 (0)