Skip to content

Commit 835cbad

Browse files
Lukasz Majewskinashif
authored andcommitted
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 <[email protected]>
1 parent 3ea491c commit 835cbad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/ethernet/eth_lan865x.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,12 @@ static int lan865x_config_plca(const struct device *dev, uint8_t node_id,
296296
/* Collision Detection */
297297
oa_tc6_reg_write(ctx->tc6, 0x00040087, 0x0083u); /* COL_DET_CTRL0 */
298298

299-
/* T1S Phy Node Id and Max Node Count */
300-
val = ((uint32_t)node_cnt << 8) | node_id;
299+
/* T1S Phy Node ID and Max Node Count */
300+
if (node_id == 0) {
301+
val = (uint32_t)node_cnt << 8;
302+
} else {
303+
val = (uint32_t)node_id;
304+
}
301305
oa_tc6_reg_write(ctx->tc6, 0x0004CA02, val); /* PLCA_CONTROL_1_REGISTER */
302306

303307
/* PLCA Burst Count and Burst Timer */

0 commit comments

Comments
 (0)