mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] net/designware: update version display to print user ID and Synosys ID
@ 2012-10-04  7:00 Jean-Christophe PLAGNIOL-VILLARD
  2012-10-04  7:00 ` [PATCH 2/3] net/designware: fix phy_addr type to int Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-04  7:00 UTC (permalink / raw)
  To: barebox

So we can check it with the kernel one

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/net/designware.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index a9a04e3..6a36f14 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -373,6 +373,15 @@ static int dwc_ether_set_ethaddr(struct eth_device *dev, u8 adr[6])
 	return 0;
 }
 
+static void dwc_version(struct device_d *dev, u32 hwid)
+{
+	u32 uid = ((hwid & 0x0000ff00) >> 8);
+	u32 synid = (hwid & 0x000000ff);
+
+	dev_info(dev, "user ID: 0x%x, Synopsys ID: 0x%x\n",
+		uid, synid);
+}
+
 static int dwc_ether_probe(struct device_d *dev)
 {
 	struct dw_eth_dev *priv;
@@ -390,7 +399,7 @@ static int dwc_ether_probe(struct device_d *dev)
 
 	base = dev_request_mem_region(dev, 0);
 	priv->mac_regs_p = base;
-	dev_info(dev, "MAC version %08x\n", readl(&priv->mac_regs_p->version));
+	dwc_version(dev, readl(&priv->mac_regs_p->version));
 	priv->dma_regs_p = base + DW_DMA_BASE_OFFSET;
 	priv->tx_mac_descrtable = dma_alloc_coherent(
 		CONFIG_TX_DESCR_NUM * sizeof(struct dmamacdescr));
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/3] net/designware: fix phy_addr type to int
  2012-10-04  7:00 [PATCH 1/3] net/designware: update version display to print user ID and Synosys ID Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-04  7:00 ` Jean-Christophe PLAGNIOL-VILLARD
  2012-10-04  7:00 ` [PATCH 3/3] net/designware: fix phylib support Jean-Christophe PLAGNIOL-VILLARD
  2012-10-04 15:21 ` [PATCH 1/3] net/designware: update version display to print user ID and Synosys ID Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-04  7:00 UTC (permalink / raw)
  To: barebox

so we can pass -1 for auto detect

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 include/net/designware.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/designware.h b/include/net/designware.h
index 3f9f5b9..1c8a00e 100644
--- a/include/net/designware.h
+++ b/include/net/designware.h
@@ -2,7 +2,7 @@
 #define __DWC_UNIMAC_H
 
 struct dwc_ether_platform_data {
-	u8 phy_addr;
+	int phy_addr;
 	void (*fix_mac_speed)(int speed);
 };
 
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/3] net/designware: fix phylib support
  2012-10-04  7:00 [PATCH 1/3] net/designware: update version display to print user ID and Synosys ID Jean-Christophe PLAGNIOL-VILLARD
  2012-10-04  7:00 ` [PATCH 2/3] net/designware: fix phy_addr type to int Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-04  7:00 ` Jean-Christophe PLAGNIOL-VILLARD
  2012-10-04 15:21 ` [PATCH 1/3] net/designware: update version display to print user ID and Synosys ID Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-04  7:00 UTC (permalink / raw)
  To: barebox

/opt/work/barebox/drivers/net/designware.c: In function 'dwc_update_linkspeed':
/opt/work/barebox/drivers/net/designware.c:234:9: error: 'mac_p' undeclared (first use in this function)
/opt/work/barebox/drivers/net/designware.c:234:9: note: each undeclared identifier is reported only once for each function it appears in
/opt/work/barebox/drivers/net/designware.c: In function 'dwc_ether_open':
/opt/work/barebox/drivers/net/designware.c:254:6: error: too few arguments to function 'phy_device_connect'
/opt/work/barebox/include/linux/phy.h:252:5: note: declared here
/opt/work/barebox/drivers/net/designware.c: At top level:
/opt/work/barebox/drivers/net/designware.c:226:13: warning: 'dwc_update_linkspeed' defined but not used

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/net/designware.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 6a36f14..ec51825 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -226,6 +226,7 @@ static int dwc_ether_init(struct eth_device *dev)
 static void dwc_update_linkspeed(struct eth_device *edev)
 {
 	struct dw_eth_dev *priv = edev->priv;
+	struct eth_mac_regs *mac_p = priv->mac_regs_p;
 	u32 conf;
 
 	if (priv->fix_mac_speed)
@@ -251,7 +252,7 @@ static int dwc_ether_open(struct eth_device *dev)
 	int ret;
 
 	ret = phy_device_connect(dev, &priv->miibus, priv->phy_addr,
-				 0, PHY_INTERFACE_MODE_NA);
+				 dwc_update_linkspeed, 0, PHY_INTERFACE_MODE_NA);
 	if (ret)
 		return ret;
 
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/3] net/designware: update version display to print user ID and Synosys ID
  2012-10-04  7:00 [PATCH 1/3] net/designware: update version display to print user ID and Synosys ID Jean-Christophe PLAGNIOL-VILLARD
  2012-10-04  7:00 ` [PATCH 2/3] net/designware: fix phy_addr type to int Jean-Christophe PLAGNIOL-VILLARD
  2012-10-04  7:00 ` [PATCH 3/3] net/designware: fix phylib support Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-04 15:21 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2012-10-04 15:21 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Thu, Oct 04, 2012 at 09:00:25AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> So we can check it with the kernel one
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Applied this series.

Thanks
 Sascha

> ---
>  drivers/net/designware.c |   11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/designware.c b/drivers/net/designware.c
> index a9a04e3..6a36f14 100644
> --- a/drivers/net/designware.c
> +++ b/drivers/net/designware.c
> @@ -373,6 +373,15 @@ static int dwc_ether_set_ethaddr(struct eth_device *dev, u8 adr[6])
>  	return 0;
>  }
>  
> +static void dwc_version(struct device_d *dev, u32 hwid)
> +{
> +	u32 uid = ((hwid & 0x0000ff00) >> 8);
> +	u32 synid = (hwid & 0x000000ff);
> +
> +	dev_info(dev, "user ID: 0x%x, Synopsys ID: 0x%x\n",
> +		uid, synid);
> +}
> +
>  static int dwc_ether_probe(struct device_d *dev)
>  {
>  	struct dw_eth_dev *priv;
> @@ -390,7 +399,7 @@ static int dwc_ether_probe(struct device_d *dev)
>  
>  	base = dev_request_mem_region(dev, 0);
>  	priv->mac_regs_p = base;
> -	dev_info(dev, "MAC version %08x\n", readl(&priv->mac_regs_p->version));
> +	dwc_version(dev, readl(&priv->mac_regs_p->version));
>  	priv->dma_regs_p = base + DW_DMA_BASE_OFFSET;
>  	priv->tx_mac_descrtable = dma_alloc_coherent(
>  		CONFIG_TX_DESCR_NUM * sizeof(struct dmamacdescr));
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-10-04 15:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-04  7:00 [PATCH 1/3] net/designware: update version display to print user ID and Synosys ID Jean-Christophe PLAGNIOL-VILLARD
2012-10-04  7:00 ` [PATCH 2/3] net/designware: fix phy_addr type to int Jean-Christophe PLAGNIOL-VILLARD
2012-10-04  7:00 ` [PATCH 3/3] net/designware: fix phylib support Jean-Christophe PLAGNIOL-VILLARD
2012-10-04 15:21 ` [PATCH 1/3] net/designware: update version display to print user ID and Synosys ID Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox