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 <lukma@denx.de>
This commit is contained in:
Lukasz Majewski 2024-10-30 16:55:55 +01:00 committed by Anas Nashif
parent 3ea491cb1c
commit 835cbad6cc
1 changed files with 6 additions and 2 deletions

View File

@ -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 */