All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: phy: micrel: Get phy node from phy-handle
@ 2021-04-26  3:43 Ley Foon Tan
  2021-04-29 20:26 ` Ramon Fried
  0 siblings, 1 reply; 5+ messages in thread
From: Ley Foon Tan @ 2021-04-26  3:43 UTC (permalink / raw)
  To: u-boot

If can't find ethernet-phy subnode, try to get phy node from "phy-handle".
Lastly, only use Ethernet node if can't find phy node from ethernet-phy
subnode and phy-handle.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
---
 drivers/net/phy/micrel_ksz90x1.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c
index e5f578201f35..e33789b7f747 100644
--- a/drivers/net/phy/micrel_ksz90x1.c
+++ b/drivers/net/phy/micrel_ksz90x1.c
@@ -112,6 +112,7 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,
 {
 	struct udevice *dev = phydev->dev;
 	struct phy_driver *drv = phydev->drv;
+	struct ofnode_phandle_args phandle;
 	int val[4];
 	int i, changed = 0, offset, max;
 	u16 regval = 0;
@@ -128,8 +129,14 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,
 	}
 
 	if (!ofnode_valid(node)) {
-		/* No node found, look in the Ethernet node */
-		node = dev_ofnode(dev);
+		if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0,
+					       &phandle)) {
+			/* No phy-handle found, look in the Ethernet node */
+			node = dev_ofnode(dev);
+		} else {
+			/* phy-handle found */
+			node = phandle.node;
+		}
 	}
 
 	for (i = 0; i < ofcfg->grpsz; i++) {
-- 
2.25.1

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

* [PATCH] net: phy: micrel: Get phy node from phy-handle
  2021-04-26  3:43 [PATCH] net: phy: micrel: Get phy node from phy-handle Ley Foon Tan
@ 2021-04-29 20:26 ` Ramon Fried
  0 siblings, 0 replies; 5+ messages in thread
From: Ramon Fried @ 2021-04-29 20:26 UTC (permalink / raw)
  To: u-boot

On Mon, Apr 26, 2021 at 6:43 AM Ley Foon Tan <ley.foon.tan@intel.com> wrote:
>
> If can't find ethernet-phy subnode, try to get phy node from "phy-handle".
> Lastly, only use Ethernet node if can't find phy node from ethernet-phy
> subnode and phy-handle.
>
> Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
> ---
>  drivers/net/phy/micrel_ksz90x1.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c
> index e5f578201f35..e33789b7f747 100644
> --- a/drivers/net/phy/micrel_ksz90x1.c
> +++ b/drivers/net/phy/micrel_ksz90x1.c
> @@ -112,6 +112,7 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,
>  {
>         struct udevice *dev = phydev->dev;
>         struct phy_driver *drv = phydev->drv;
> +       struct ofnode_phandle_args phandle;
>         int val[4];
>         int i, changed = 0, offset, max;
>         u16 regval = 0;
> @@ -128,8 +129,14 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,
>         }
>
>         if (!ofnode_valid(node)) {
> -               /* No node found, look in the Ethernet node */
> -               node = dev_ofnode(dev);
> +               if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0,
> +                                              &phandle)) {
> +                       /* No phy-handle found, look in the Ethernet node */
> +                       node = dev_ofnode(dev);
> +               } else {
> +                       /* phy-handle found */
> +                       node = phandle.node;
> +               }
>         }
>
>         for (i = 0; i < ofcfg->grpsz; i++) {
> --
> 2.25.1
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

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

* RE: [PATCH] net: phy: micrel: Get phy node from phy-handle
  2022-11-26 22:50 ` Ramon Fried
@ 2022-11-28  1:45   ` Lim, Jit Loon
  0 siblings, 0 replies; 5+ messages in thread
From: Lim, Jit Loon @ 2022-11-28  1:45 UTC (permalink / raw)
  To: Ramon Fried
  Cc: u-boot, Jagan Teki, Vignesh R, Vasut, Marek, Simon, Chee,
	Tien Fong, Hea, Kok Kiang, Lim,  Elly Siew Chin, Kho, Sin Hui,
	Lokanathan, Raaj, Maniyam, Dinesh, Ng, Boon Khai, Yuslaimi,
	Alif Zakuan, Chong, Teik Heng, Zamri, Muhammad Hazim Izzat, Tang,
	Sieu Mun, Ley Foon Tan, Lim, Jit Loon

-----Original Message-----
From: Ramon Fried <rfried.dev@gmail.com> 
Sent: Sunday, 27 November, 2022 6:50 AM
To: Lim, Jit Loon <jit.loon.lim@intel.com>
Cc: u-boot@lists.denx.de; Jagan Teki <jagan@amarulasolutions.com>; Vignesh R <vigneshr@ti.com>; Vasut, Marek <marex@denx.de>; Simon <simon.k.r.goldschmidt@gmail.com>; Chee, Tien Fong <tien.fong.chee@intel.com>; Hea, Kok Kiang <kok.kiang.hea@intel.com>; Lim, Elly Siew Chin <elly.siew.chin.lim@intel.com>; Kho, Sin Hui <sin.hui.kho@intel.com>; Lokanathan, Raaj <raaj.lokanathan@intel.com>; Maniyam, Dinesh <dinesh.maniyam@intel.com>; Ng, Boon Khai <boon.khai.ng@intel.com>; Yuslaimi, Alif Zakuan <alif.zakuan.yuslaimi@intel.com>; Chong, Teik Heng <teik.heng.chong@intel.com>; Zamri, Muhammad Hazim Izzat <muhammad.hazim.izzat.zamri@intel.com>; Tang, Sieu Mun <sieu.mun.tang@intel.com>; Ley Foon Tan <ley.foon.tan@intel.com>
Subject: Re: [PATCH] net: phy: micrel: Get phy node from phy-handle

On Tue, Nov 22, 2022 at 4:41 PM Jit Loon Lim <jit.loon.lim@intel.com> wrote:
>
> From: Ley Foon Tan <ley.foon.tan@intel.com>
>
> HSD #1509063521: Try to get phy node from "phy-handle" if can't find ethernet-phy subnode.
What is this HSD ? Intel internal ?
Please remove.

Yes, this is for Intel internal tracking. We shall remove it and update the patch. 

> Lastly only use Ethernet node if can't find phy node from ethernet-phy 
> subnode and phy-handle.
>
> Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
> Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
> ---
>  drivers/net/phy/micrel_ksz90x1.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/phy/micrel_ksz90x1.c 
> b/drivers/net/phy/micrel_ksz90x1.c
> index e5f578201f..e33789b7f7 100644
> --- a/drivers/net/phy/micrel_ksz90x1.c
> +++ b/drivers/net/phy/micrel_ksz90x1.c
> @@ -112,6 +112,7 @@ static int ksz90x1_of_config_group(struct 
> phy_device *phydev,  {
>         struct udevice *dev = phydev->dev;
>         struct phy_driver *drv = phydev->drv;
> +       struct ofnode_phandle_args phandle;
>         int val[4];
>         int i, changed = 0, offset, max;
>         u16 regval = 0;
> @@ -128,8 +129,14 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,
>         }
>
>         if (!ofnode_valid(node)) {
> -               /* No node found, look in the Ethernet node */
> -               node = dev_ofnode(dev);
> +               if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0,
> +                                              &phandle)) {
> +                       /* No phy-handle found, look in the Ethernet node */
> +                       node = dev_ofnode(dev);
> +               } else {
> +                       /* phy-handle found */
> +                       node = phandle.node;
> +               }
>         }
>
>         for (i = 0; i < ofcfg->grpsz; i++) {
> --
> 2.26.2
>

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

* Re: [PATCH] net: phy: micrel: Get phy node from phy-handle
  2022-11-22 14:41 Jit Loon Lim
@ 2022-11-26 22:50 ` Ramon Fried
  2022-11-28  1:45   ` Lim, Jit Loon
  0 siblings, 1 reply; 5+ messages in thread
From: Ramon Fried @ 2022-11-26 22:50 UTC (permalink / raw)
  To: Jit Loon Lim
  Cc: u-boot, Jagan Teki, Vignesh R, Marek, Simon, Tien Fong,
	Kok Kiang, Siew Chin, Sin Hui, Raaj, Dinesh, Boon Khai, Alif,
	Teik Heng, Hazim, Sieu Mun Tang, Ley Foon Tan

On Tue, Nov 22, 2022 at 4:41 PM Jit Loon Lim <jit.loon.lim@intel.com> wrote:
>
> From: Ley Foon Tan <ley.foon.tan@intel.com>
>
> HSD #1509063521: Try to get phy node from "phy-handle" if can't find ethernet-phy subnode.
What is this HSD ? Intel internal ?
Please remove.
> Lastly only use Ethernet node if can't find phy node from ethernet-phy
> subnode and phy-handle.
>
> Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
> Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
> ---
>  drivers/net/phy/micrel_ksz90x1.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c
> index e5f578201f..e33789b7f7 100644
> --- a/drivers/net/phy/micrel_ksz90x1.c
> +++ b/drivers/net/phy/micrel_ksz90x1.c
> @@ -112,6 +112,7 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,
>  {
>         struct udevice *dev = phydev->dev;
>         struct phy_driver *drv = phydev->drv;
> +       struct ofnode_phandle_args phandle;
>         int val[4];
>         int i, changed = 0, offset, max;
>         u16 regval = 0;
> @@ -128,8 +129,14 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,
>         }
>
>         if (!ofnode_valid(node)) {
> -               /* No node found, look in the Ethernet node */
> -               node = dev_ofnode(dev);
> +               if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0,
> +                                              &phandle)) {
> +                       /* No phy-handle found, look in the Ethernet node */
> +                       node = dev_ofnode(dev);
> +               } else {
> +                       /* phy-handle found */
> +                       node = phandle.node;
> +               }
>         }
>
>         for (i = 0; i < ofcfg->grpsz; i++) {
> --
> 2.26.2
>

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

* [PATCH] net: phy: micrel: Get phy node from phy-handle
@ 2022-11-22 14:41 Jit Loon Lim
  2022-11-26 22:50 ` Ramon Fried
  0 siblings, 1 reply; 5+ messages in thread
From: Jit Loon Lim @ 2022-11-22 14:41 UTC (permalink / raw)
  To: u-boot
  Cc: Jagan Teki, Vignesh R, Marek, Simon, Tien Fong, Kok Kiang,
	Siew Chin, Sin Hui, Raaj, Dinesh, Boon Khai, Alif, Teik Heng,
	Hazim, Jit Loon Lim, Sieu Mun Tang, Ley Foon Tan

From: Ley Foon Tan <ley.foon.tan@intel.com>

HSD #1509063521: Try to get phy node from "phy-handle" if can't find ethernet-phy subnode.
Lastly only use Ethernet node if can't find phy node from ethernet-phy
subnode and phy-handle.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
---
 drivers/net/phy/micrel_ksz90x1.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c
index e5f578201f..e33789b7f7 100644
--- a/drivers/net/phy/micrel_ksz90x1.c
+++ b/drivers/net/phy/micrel_ksz90x1.c
@@ -112,6 +112,7 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,
 {
 	struct udevice *dev = phydev->dev;
 	struct phy_driver *drv = phydev->drv;
+	struct ofnode_phandle_args phandle;
 	int val[4];
 	int i, changed = 0, offset, max;
 	u16 regval = 0;
@@ -128,8 +129,14 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,
 	}
 
 	if (!ofnode_valid(node)) {
-		/* No node found, look in the Ethernet node */
-		node = dev_ofnode(dev);
+		if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0,
+					       &phandle)) {
+			/* No phy-handle found, look in the Ethernet node */
+			node = dev_ofnode(dev);
+		} else {
+			/* phy-handle found */
+			node = phandle.node;
+		}
 	}
 
 	for (i = 0; i < ofcfg->grpsz; i++) {
-- 
2.26.2


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

end of thread, other threads:[~2022-11-28  1:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26  3:43 [PATCH] net: phy: micrel: Get phy node from phy-handle Ley Foon Tan
2021-04-29 20:26 ` Ramon Fried
2022-11-22 14:41 Jit Loon Lim
2022-11-26 22:50 ` Ramon Fried
2022-11-28  1:45   ` Lim, Jit Loon

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.