Skip to content

Commit

Permalink
drivers/net/ksz9477.c: Errata 16, reset SGMII always on init
Browse files Browse the repository at this point in the history
  • Loading branch information
jpaali committed Nov 22, 2024
1 parent 0161c16 commit 9f5d812
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/ksz9477.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,13 @@ int ksz9477_init(ksz9477_port_t master_port)
return ret ? ret : -EINVAL;
}

/* Errata 16: SGMII registers are not initialized by hardware reset
* To ensure clean environment, reset the switch now.
*/
regval16 = SGMII_CONTROL_SOFT_RESET;
ret = ksz9477_sgmii_write_indirect(KSZ9477_SGMII_CONTROL,
&regval16, 1);

/* Check that indirect access to PHY MMD works.
* Write LED mode to single-LED mode and verify access by
* reading back the value.
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/ksz9477_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@

/* Register bit definitions */

/* KSZ9477_SGMII_CONTROL */

#define SGMII_CONTROL_SOFT_RESET (1 << 15)

/* KSZ9477_ID2, KSZ9477_ID1 */

#define KSZ9477_ID 0x9477
Expand Down

0 comments on commit 9f5d812

Please sign in to comment.