All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [UBOOT PATCH v2] net: zynq_gem: convert to use livetree
@ 2018-07-16 12:55 Siva Durga Prasad Paladugu
  2018-07-23  5:48 ` Siva Durga Prasad Paladugu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Siva Durga Prasad Paladugu @ 2018-07-16 12:55 UTC (permalink / raw)
  To: u-boot

This patch updates the zynq gem driver to support livetree.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
---
Changes for v2:
- Note that this patch is based on below two series.
https://patchwork.ozlabs.org/cover/936370/
and
https://patchwork.ozlabs.org/cover/936380/
---
 drivers/net/zynq_gem.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 0f56cda..68d1c2f 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -178,7 +178,7 @@ struct zynq_gem_priv {
 	struct zynq_gem_regs *iobase;
 	phy_interface_t interface;
 	struct phy_device *phydev;
-	int phy_of_handle;
+	ofnode phy_of_node;
 	struct mii_dev *bus;
 	struct clk clk;
 	u32 max_speed;
@@ -348,9 +348,7 @@ static int zynq_phy_init(struct udevice *dev)
 	}
 
 	priv->phydev->advertising = priv->phydev->supported;
-
-	if (priv->phy_of_handle > 0)
-		priv->phydev->node = offset_to_ofnode(priv->phy_of_handle);
+	priv->phydev->node = priv->phy_of_node;
 
 	return phy_config(priv->phydev);
 }
@@ -693,21 +691,23 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
 {
 	struct eth_pdata *pdata = dev_get_platdata(dev);
 	struct zynq_gem_priv *priv = dev_get_priv(dev);
-	int node = dev_of_offset(dev);
+	struct ofnode_phandle_args phandle_args;
 	const char *phy_mode;
 
-	pdata->iobase = (phys_addr_t)devfdt_get_addr(dev);
+	pdata->iobase = (phys_addr_t)dev_read_addr(dev);
 	priv->iobase = (struct zynq_gem_regs *)pdata->iobase;
 	/* Hardcode for now */
 	priv->phyaddr = -1;
 
-	priv->phy_of_handle = fdtdec_lookup_phandle(gd->fdt_blob, node,
-						    "phy-handle");
-	if (priv->phy_of_handle > 0)
-		priv->phyaddr = fdtdec_get_int(gd->fdt_blob,
-					priv->phy_of_handle, "reg", -1);
+	if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0,
+				       &phandle_args)) {
+		debug("phy-handle does not exist %s\n", dev->name);
+		return -ENOENT;
+	}
 
-	phy_mode = fdt_getprop(gd->fdt_blob, node, "phy-mode", NULL);
+	priv->phyaddr = ofnode_read_u32_default(phandle_args.node, "reg", -1);
+	priv->phy_of_node = phandle_args.node;
+	phy_mode = dev_read_prop(dev, "phy-mode", NULL);
 	if (phy_mode)
 		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
 	if (pdata->phy_interface == -1) {
@@ -716,10 +716,8 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
 	}
 	priv->interface = pdata->phy_interface;
 
-	priv->max_speed = fdtdec_get_uint(gd->fdt_blob, priv->phy_of_handle,
-					  "max-speed", SPEED_1000);
-	priv->int_pcs = fdtdec_get_bool(gd->fdt_blob, node,
-					"is-internal-pcspma");
+	priv->max_speed = dev_read_u32_default(dev, "max-speed", SPEED_1000);
+	priv->int_pcs = dev_read_bool(dev, "is-internal-pcspma");
 
 	printf("ZYNQ GEM: %lx, phyaddr %x, interface %s\n", (ulong)priv->iobase,
 	       priv->phyaddr, phy_string_for_interface(priv->interface));
-- 
2.7.4

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

* [U-Boot] [UBOOT PATCH v2] net: zynq_gem: convert to use livetree
  2018-07-16 12:55 [U-Boot] [UBOOT PATCH v2] net: zynq_gem: convert to use livetree Siva Durga Prasad Paladugu
@ 2018-07-23  5:48 ` Siva Durga Prasad Paladugu
  2018-07-24  8:58   ` Michal Simek
  2018-07-25 17:48 ` Joe Hershberger
  2018-07-26 19:18 ` [U-Boot] " Joe Hershberger
  2 siblings, 1 reply; 7+ messages in thread
From: Siva Durga Prasad Paladugu @ 2018-07-23  5:48 UTC (permalink / raw)
  To: u-boot

Hi Joe/Michal,

Can you please take it up if it is fine.

Thanks,
Siva

> -----Original Message-----
> From: Siva Durga Prasad Paladugu [mailto:siva.durga.paladugu at xilinx.com]
> Sent: Monday, July 16, 2018 6:26 PM
> To: u-boot at lists.denx.de
> Cc: Michal Simek <michals@xilinx.com>; joe.hershberger at ni.com;
> grygorii.strashko at ti.com; Siva Durga Prasad Paladugu
> <sivadur@xilinx.com>; Vipul Kumar <vipulk@xilinx.com>
> Subject: [UBOOT PATCH v2] net: zynq_gem: convert to use livetree
> 
> This patch updates the zynq gem driver to support livetree.
> 
> Signed-off-by: Siva Durga Prasad Paladugu
> <siva.durga.paladugu@xilinx.com>
> Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
> ---
> Changes for v2:
> - Note that this patch is based on below two series.
> https://patchwork.ozlabs.org/cover/936370/
> and
> https://patchwork.ozlabs.org/cover/936380/
> ---
>  drivers/net/zynq_gem.c | 30 ++++++++++++++----------------
>  1 file changed, 14 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index
> 0f56cda..68d1c2f 100644
> --- a/drivers/net/zynq_gem.c
> +++ b/drivers/net/zynq_gem.c
> @@ -178,7 +178,7 @@ struct zynq_gem_priv {
>  	struct zynq_gem_regs *iobase;
>  	phy_interface_t interface;
>  	struct phy_device *phydev;
> -	int phy_of_handle;
> +	ofnode phy_of_node;
>  	struct mii_dev *bus;
>  	struct clk clk;
>  	u32 max_speed;
> @@ -348,9 +348,7 @@ static int zynq_phy_init(struct udevice *dev)
>  	}
> 
>  	priv->phydev->advertising = priv->phydev->supported;
> -
> -	if (priv->phy_of_handle > 0)
> -		priv->phydev->node = offset_to_ofnode(priv-
> >phy_of_handle);
> +	priv->phydev->node = priv->phy_of_node;
> 
>  	return phy_config(priv->phydev);
>  }
> @@ -693,21 +691,23 @@ static int zynq_gem_ofdata_to_platdata(struct
> udevice *dev)  {
>  	struct eth_pdata *pdata = dev_get_platdata(dev);
>  	struct zynq_gem_priv *priv = dev_get_priv(dev);
> -	int node = dev_of_offset(dev);
> +	struct ofnode_phandle_args phandle_args;
>  	const char *phy_mode;
> 
> -	pdata->iobase = (phys_addr_t)devfdt_get_addr(dev);
> +	pdata->iobase = (phys_addr_t)dev_read_addr(dev);
>  	priv->iobase = (struct zynq_gem_regs *)pdata->iobase;
>  	/* Hardcode for now */
>  	priv->phyaddr = -1;
> 
> -	priv->phy_of_handle = fdtdec_lookup_phandle(gd->fdt_blob, node,
> -						    "phy-handle");
> -	if (priv->phy_of_handle > 0)
> -		priv->phyaddr = fdtdec_get_int(gd->fdt_blob,
> -					priv->phy_of_handle, "reg", -1);
> +	if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0,
> +				       &phandle_args)) {
> +		debug("phy-handle does not exist %s\n", dev->name);
> +		return -ENOENT;
> +	}
> 
> -	phy_mode = fdt_getprop(gd->fdt_blob, node, "phy-mode", NULL);
> +	priv->phyaddr = ofnode_read_u32_default(phandle_args.node,
> "reg", -1);
> +	priv->phy_of_node = phandle_args.node;
> +	phy_mode = dev_read_prop(dev, "phy-mode", NULL);
>  	if (phy_mode)
>  		pdata->phy_interface =
> phy_get_interface_by_name(phy_mode);
>  	if (pdata->phy_interface == -1) {
> @@ -716,10 +716,8 @@ static int zynq_gem_ofdata_to_platdata(struct
> udevice *dev)
>  	}
>  	priv->interface = pdata->phy_interface;
> 
> -	priv->max_speed = fdtdec_get_uint(gd->fdt_blob, priv-
> >phy_of_handle,
> -					  "max-speed", SPEED_1000);
> -	priv->int_pcs = fdtdec_get_bool(gd->fdt_blob, node,
> -					"is-internal-pcspma");
> +	priv->max_speed = dev_read_u32_default(dev, "max-speed",
> SPEED_1000);
> +	priv->int_pcs = dev_read_bool(dev, "is-internal-pcspma");
> 
>  	printf("ZYNQ GEM: %lx, phyaddr %x, interface %s\n", (ulong)priv-
> >iobase,
>  	       priv->phyaddr, phy_string_for_interface(priv->interface));
> --
> 2.7.4

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

* [U-Boot] [UBOOT PATCH v2] net: zynq_gem: convert to use livetree
  2018-07-23  5:48 ` Siva Durga Prasad Paladugu
@ 2018-07-24  8:58   ` Michal Simek
  2018-07-25 17:45     ` Joe Hershberger
  0 siblings, 1 reply; 7+ messages in thread
From: Michal Simek @ 2018-07-24  8:58 UTC (permalink / raw)
  To: u-boot

Hi,

On 23.7.2018 07:48, Siva Durga Prasad Paladugu wrote:
> Hi Joe/Michal,
> 
> Can you please take it up if it is fine.

joe: Can you please take it via your tree?
There are some patches before this.

Thanks,
Michal

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

* [U-Boot] [UBOOT PATCH v2] net: zynq_gem: convert to use livetree
  2018-07-24  8:58   ` Michal Simek
@ 2018-07-25 17:45     ` Joe Hershberger
  2018-07-26  5:50       ` Michal Simek
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Hershberger @ 2018-07-25 17:45 UTC (permalink / raw)
  To: u-boot

On Tue, Jul 24, 2018 at 3:58 AM, Michal Simek <michal.simek@xilinx.com> wrote:
> Hi,
>
> On 23.7.2018 07:48, Siva Durga Prasad Paladugu wrote:
>> Hi Joe/Michal,
>>
>> Can you please take it up if it is fine.
>
> joe: Can you please take it via your tree?
> There are some patches before this.

Sure. The second series that you depend on has build issues, so this
will be backed up behind that.

Cheers,
-Joe

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

* [U-Boot] [UBOOT PATCH v2] net: zynq_gem: convert to use livetree
  2018-07-16 12:55 [U-Boot] [UBOOT PATCH v2] net: zynq_gem: convert to use livetree Siva Durga Prasad Paladugu
  2018-07-23  5:48 ` Siva Durga Prasad Paladugu
@ 2018-07-25 17:48 ` Joe Hershberger
  2018-07-26 19:18 ` [U-Boot] " Joe Hershberger
  2 siblings, 0 replies; 7+ messages in thread
From: Joe Hershberger @ 2018-07-25 17:48 UTC (permalink / raw)
  To: u-boot

On Mon, Jul 16, 2018 at 7:55 AM, Siva Durga Prasad Paladugu
<siva.durga.paladugu@xilinx.com> wrote:
> This patch updates the zynq gem driver to support livetree.
>
> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
> Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

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

* [U-Boot] [UBOOT PATCH v2] net: zynq_gem: convert to use livetree
  2018-07-25 17:45     ` Joe Hershberger
@ 2018-07-26  5:50       ` Michal Simek
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2018-07-26  5:50 UTC (permalink / raw)
  To: u-boot

On 25.7.2018 19:45, Joe Hershberger wrote:
> On Tue, Jul 24, 2018 at 3:58 AM, Michal Simek <michal.simek@xilinx.com> wrote:
>> Hi,
>>
>> On 23.7.2018 07:48, Siva Durga Prasad Paladugu wrote:
>>> Hi Joe/Michal,
>>>
>>> Can you please take it up if it is fine.
>>
>> joe: Can you please take it via your tree?
>> There are some patches before this.
> 
> Sure. The second series that you depend on has build issues, so this
> will be backed up behind that.

ok. We will wait then.

Thanks,
Michal

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

* [U-Boot] net: zynq_gem: convert to use livetree
  2018-07-16 12:55 [U-Boot] [UBOOT PATCH v2] net: zynq_gem: convert to use livetree Siva Durga Prasad Paladugu
  2018-07-23  5:48 ` Siva Durga Prasad Paladugu
  2018-07-25 17:48 ` Joe Hershberger
@ 2018-07-26 19:18 ` Joe Hershberger
  2 siblings, 0 replies; 7+ messages in thread
From: Joe Hershberger @ 2018-07-26 19:18 UTC (permalink / raw)
  To: u-boot

Hi Siva,

https://patchwork.ozlabs.org/patch/944372/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

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

end of thread, other threads:[~2018-07-26 19:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-16 12:55 [U-Boot] [UBOOT PATCH v2] net: zynq_gem: convert to use livetree Siva Durga Prasad Paladugu
2018-07-23  5:48 ` Siva Durga Prasad Paladugu
2018-07-24  8:58   ` Michal Simek
2018-07-25 17:45     ` Joe Hershberger
2018-07-26  5:50       ` Michal Simek
2018-07-25 17:48 ` Joe Hershberger
2018-07-26 19:18 ` [U-Boot] " Joe Hershberger

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.