All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] board: gateworks venice: add support for GPY111 phy
@ 2022-03-08 18:47 Tim Harvey
  2022-03-09  1:10 ` Peng Fan
  2022-04-12 21:40 ` sbabic
  0 siblings, 2 replies; 3+ messages in thread
From: Tim Harvey @ 2022-03-08 18:47 UTC (permalink / raw)
  To: u-boot, Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: Tim Harvey

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>
---
 board/gateworks/venice/venice.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/board/gateworks/venice/venice.c b/board/gateworks/venice/venice.c
index 5334500ef6a7..425c69056da5 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)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] board: gateworks venice: add support for GPY111 phy
  2022-03-08 18:47 [PATCH] board: gateworks venice: add support for GPY111 phy Tim Harvey
@ 2022-03-09  1:10 ` Peng Fan
  2022-04-12 21:40 ` sbabic
  1 sibling, 0 replies; 3+ messages in thread
From: Peng Fan @ 2022-03-09  1:10 UTC (permalink / raw)
  To: tharvey, u-boot, Stefano Babic, Fabio Estevam, dl-uboot-imx; +Cc: tharvey

> Subject: [PATCH] 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>

> ---
>  board/gateworks/venice/venice.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/board/gateworks/venice/venice.c
> b/board/gateworks/venice/venice.c index 5334500ef6a7..425c69056da5
> 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)
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] board: gateworks venice: add support for GPY111 phy
  2022-03-08 18:47 [PATCH] board: gateworks venice: add support for GPY111 phy Tim Harvey
  2022-03-09  1:10 ` Peng Fan
@ 2022-04-12 21:40 ` sbabic
  1 sibling, 0 replies; 3+ messages in thread
From: sbabic @ 2022-04-12 21:40 UTC (permalink / raw)
  To: Tim Harvey, u-boot

> 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>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-12 21:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 18:47 [PATCH] board: gateworks venice: add support for GPY111 phy Tim Harvey
2022-03-09  1:10 ` Peng Fan
2022-04-12 21:40 ` sbabic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.