diff options
author | Tim Harvey | 2022-03-08 10:47:44 -0800 |
---|---|---|
committer | Stefano Babic | 2022-04-12 21:08:22 +0200 |
commit | 8f40e7d29f587b35540b2a447250d1b047ef5f8b (patch) | |
tree | ed0a571f10c9e2b2278a9ab7b82750be3241ae11 /board | |
parent | 255658127b2a26ee8d18d97cc16f1bc694e46bbd (diff) |
board: gateworks venice: add support for GPY111 phy
The TI DP83867 phy has been replaced with the MaxLinear GPY111 phy due
to part availability.
Add support for it by adding LED config and dt-prop based internal delay
config tx-delay/rx-delay per PHY ID.
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/gateworks/venice/venice.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/board/gateworks/venice/venice.c b/board/gateworks/venice/venice.c index 5334500ef6a..425c69056da 100644 --- a/board/gateworks/venice/venice.c +++ b/board/gateworks/venice/venice.c @@ -63,6 +63,7 @@ static int setup_fec(void) int board_phy_config(struct phy_device *phydev) { unsigned short val; + ofnode node; switch (phydev->phy_id) { case 0x2000a231: /* TI DP83867 GbE PHY */ @@ -73,6 +74,21 @@ int board_phy_config(struct phy_device *phydev) val |= 0xb << 8; /* LED2(Green;Link/Act): blink for TX/RX act */ phy_write(phydev, MDIO_DEVAD_NONE, 24, val); break; + case 0xd565a401: /* MaxLinear GPY111 */ + puts("GPY111 "); + node = phy_get_ofnode(phydev); + if (ofnode_valid(node)) { + u32 rx_delay, tx_delay; + + rx_delay = ofnode_read_u32_default(node, "rx-internal-delay-ps", 2000); + tx_delay = ofnode_read_u32_default(node, "tx-internal-delay-ps", 2000); + val = phy_read(phydev, MDIO_DEVAD_NONE, 0x17); + val &= ~((0x7 << 12) | (0x7 << 8)); + val |= (rx_delay / 500) << 12; + val |= (tx_delay / 500) << 8; + phy_write(phydev, MDIO_DEVAD_NONE, 0x17, val); + } + break; } if (phydev->drv->config) |