From 835cbad6cce90c86cbe3c99c609e0d073230c6a3 Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Wed, 30 Oct 2024 16:55:55 +0100 Subject: [PATCH] drivers: ethernet: lan865x: Avoid writing PLCA node count when nodeID not 0 The newest AN1760 application note - Revision F (DS60001760G - June 2024) is recommending to not write the node count to PLCA_CTRL1 register when the node is not the PLCA coordinator (i.e. its ID is not zero). Signed-off-by: Lukasz Majewski --- drivers/ethernet/eth_lan865x.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/ethernet/eth_lan865x.c b/drivers/ethernet/eth_lan865x.c index a9a3673ed99..0ced9732928 100644 --- a/drivers/ethernet/eth_lan865x.c +++ b/drivers/ethernet/eth_lan865x.c @@ -296,8 +296,12 @@ static int lan865x_config_plca(const struct device *dev, uint8_t node_id, /* Collision Detection */ oa_tc6_reg_write(ctx->tc6, 0x00040087, 0x0083u); /* COL_DET_CTRL0 */ - /* T1S Phy Node Id and Max Node Count */ - val = ((uint32_t)node_cnt << 8) | node_id; + /* T1S Phy Node ID and Max Node Count */ + if (node_id == 0) { + val = (uint32_t)node_cnt << 8; + } else { + val = (uint32_t)node_id; + } oa_tc6_reg_write(ctx->tc6, 0x0004CA02, val); /* PLCA_CONTROL_1_REGISTER */ /* PLCA Burst Count and Burst Timer */