All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL
@ 2017-04-10 11:44 Peng Fan
  2017-04-10 11:44 ` [U-Boot] [PATCH 2/3] net: fec_mxc: avoid transfer dev_id -1 to get mac address from fuse Peng Fan
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Peng Fan @ 2017-04-10 11:44 UTC (permalink / raw)
  To: u-boot

The MIB RAM and FIFO receive start register does not exist on
i.MX6ULL. Accessing these register will cause enet not work well or
cause system report fault.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
---
 drivers/net/fec_mxc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 910879b..ac7afb5 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -563,7 +563,7 @@ static int fec_init(struct eth_device *dev, bd_t *bd)
 	writel(0x00000000, &fec->eth->gaddr2);
 
 	/* Do not access reserved register for i.MX6UL */
-	if (!is_mx6ul()) {
+	if (!is_mx6ul() && !is_mx6ull()) {
 		/* clear MIB RAM */
 		for (i = mib_ptr; i <= mib_ptr + 0xfc; i += 4)
 			writel(0, i);
-- 
2.6.2

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

* [U-Boot] [PATCH 2/3] net: fec_mxc: avoid transfer dev_id -1 to get mac address from fuse
  2017-04-10 11:44 [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL Peng Fan
@ 2017-04-10 11:44 ` Peng Fan
  2017-04-12 16:22   ` Stefano Babic
  2017-04-10 11:44 ` [U-Boot] [PATCH 3/3] net: fec_mxc: specify the registered eth index by dev_id Peng Fan
  2017-04-12 16:21 ` [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL Stefano Babic
  2 siblings, 1 reply; 8+ messages in thread
From: Peng Fan @ 2017-04-10 11:44 UTC (permalink / raw)
  To: u-boot

From: Andy Duan <fugang.duan@nxp.com>

Avoid transfer parameter dev_id value with "-1" to .fec_get_hwaddr(),
it should transfer fec->dev_id to get mac address from fuse.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
---
 drivers/net/fec_mxc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index ac7afb5..d67a69b 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -1086,8 +1086,8 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
 #endif
 	eth_register(edev);
 
-	if (fec_get_hwaddr(dev_id, ethaddr) == 0) {
-		debug("got MAC%d address from fuse: %pM\n", dev_id, ethaddr);
+	if (fec_get_hwaddr(fec->dev_id, ethaddr) == 0) {
+		debug("got MAC%d address from fuse: %pM\n", fec->dev_id, ethaddr);
 		memcpy(edev->enetaddr, ethaddr, 6);
 		if (!getenv("ethaddr"))
 			eth_setenv_enetaddr("ethaddr", ethaddr);
-- 
2.6.2

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

* [U-Boot] [PATCH 3/3] net: fec_mxc: specify the registered eth index by dev_id
  2017-04-10 11:44 [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL Peng Fan
  2017-04-10 11:44 ` [U-Boot] [PATCH 2/3] net: fec_mxc: avoid transfer dev_id -1 to get mac address from fuse Peng Fan
@ 2017-04-10 11:44 ` Peng Fan
  2017-04-12 16:22   ` Stefano Babic
  2017-04-12 16:21 ` [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL Stefano Babic
  2 siblings, 1 reply; 8+ messages in thread
From: Peng Fan @ 2017-04-10 11:44 UTC (permalink / raw)
  To: u-boot

From: Andy Duan <fugang.duan@nxp.com>

Specify the registered eth index by dev_id.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
---
 drivers/net/fec_mxc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index d67a69b..08bea8b 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -1023,6 +1023,7 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
 	struct eth_device *edev;
 	struct fec_priv *fec;
 	unsigned char ethaddr[6];
+	char mac[16];
 	uint32_t start;
 	int ret = 0;
 
@@ -1085,12 +1086,18 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
 	fec->phy_id = phy_id;
 #endif
 	eth_register(edev);
+	/* only support one eth device, the index number pointed by dev_id */
+	edev->index = fec->dev_id;
 
 	if (fec_get_hwaddr(fec->dev_id, ethaddr) == 0) {
 		debug("got MAC%d address from fuse: %pM\n", fec->dev_id, ethaddr);
 		memcpy(edev->enetaddr, ethaddr, 6);
-		if (!getenv("ethaddr"))
-			eth_setenv_enetaddr("ethaddr", ethaddr);
+		if (fec->dev_id)
+			sprintf(mac, "eth%daddr", fec->dev_id);
+		else
+			strcpy(mac, "ethaddr");
+		if (!getenv(mac))
+			eth_setenv_enetaddr(mac, ethaddr);
 	}
 	return ret;
 err4:
-- 
2.6.2

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

* [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL
  2017-04-10 11:44 [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL Peng Fan
  2017-04-10 11:44 ` [U-Boot] [PATCH 2/3] net: fec_mxc: avoid transfer dev_id -1 to get mac address from fuse Peng Fan
  2017-04-10 11:44 ` [U-Boot] [PATCH 3/3] net: fec_mxc: specify the registered eth index by dev_id Peng Fan
@ 2017-04-12 16:21 ` Stefano Babic
  2017-04-18 13:39   ` Peng Fan
  2 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2017-04-12 16:21 UTC (permalink / raw)
  To: u-boot

On 10/04/2017 13:44, Peng Fan wrote:
> The MIB RAM and FIFO receive start register does not exist on
> i.MX6ULL. Accessing these register will cause enet not work well or
> cause system report fault.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> ---
>  drivers/net/fec_mxc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 910879b..ac7afb5 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -563,7 +563,7 @@ static int fec_init(struct eth_device *dev, bd_t *bd)
>  	writel(0x00000000, &fec->eth->gaddr2);
>  
>  	/* Do not access reserved register for i.MX6UL */
> -	if (!is_mx6ul()) {
> +	if (!is_mx6ul() && !is_mx6ull()) {
>  		/* clear MIB RAM */
>  		for (i = mib_ptr; i <= mib_ptr + 0xfc; i += 4)
>  			writel(0, i);
> 

Reviewed-by : Stefano Babic <sbabic@denx.de>

Joe, I see Tom has assigned the series  to me. If it is ok for you, I
will merge the series into u-boot-imx.

Regards,
Stefano

-- 
=====================================================================
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 at denx.de
=====================================================================

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

* [U-Boot] [PATCH 2/3] net: fec_mxc: avoid transfer dev_id -1 to get mac address from fuse
  2017-04-10 11:44 ` [U-Boot] [PATCH 2/3] net: fec_mxc: avoid transfer dev_id -1 to get mac address from fuse Peng Fan
@ 2017-04-12 16:22   ` Stefano Babic
  0 siblings, 0 replies; 8+ messages in thread
From: Stefano Babic @ 2017-04-12 16:22 UTC (permalink / raw)
  To: u-boot

On 10/04/2017 13:44, Peng Fan wrote:
> From: Andy Duan <fugang.duan@nxp.com>
> 
> Avoid transfer parameter dev_id value with "-1" to .fec_get_hwaddr(),
> it should transfer fec->dev_id to get mac address from fuse.
> 
> Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> ---
>  drivers/net/fec_mxc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index ac7afb5..d67a69b 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -1086,8 +1086,8 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
>  #endif
>  	eth_register(edev);
>  
> -	if (fec_get_hwaddr(dev_id, ethaddr) == 0) {
> -		debug("got MAC%d address from fuse: %pM\n", dev_id, ethaddr);
> +	if (fec_get_hwaddr(fec->dev_id, ethaddr) == 0) {
> +		debug("got MAC%d address from fuse: %pM\n", fec->dev_id, ethaddr);
>  		memcpy(edev->enetaddr, ethaddr, 6);
>  		if (!getenv("ethaddr"))
>  			eth_setenv_enetaddr("ethaddr", ethaddr);
> 

Right !

Acked-by: Stefano Babic <sbabic@denx.de>

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 at denx.de
=====================================================================

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

* [U-Boot] [PATCH 3/3] net: fec_mxc: specify the registered eth index by dev_id
  2017-04-10 11:44 ` [U-Boot] [PATCH 3/3] net: fec_mxc: specify the registered eth index by dev_id Peng Fan
@ 2017-04-12 16:22   ` Stefano Babic
  0 siblings, 0 replies; 8+ messages in thread
From: Stefano Babic @ 2017-04-12 16:22 UTC (permalink / raw)
  To: u-boot

On 10/04/2017 13:44, Peng Fan wrote:
> From: Andy Duan <fugang.duan@nxp.com>
> 
> Specify the registered eth index by dev_id.
> 
> Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> ---
>  drivers/net/fec_mxc.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index d67a69b..08bea8b 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -1023,6 +1023,7 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
>  	struct eth_device *edev;
>  	struct fec_priv *fec;
>  	unsigned char ethaddr[6];
> +	char mac[16];
>  	uint32_t start;
>  	int ret = 0;
>  
> @@ -1085,12 +1086,18 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
>  	fec->phy_id = phy_id;
>  #endif
>  	eth_register(edev);
> +	/* only support one eth device, the index number pointed by dev_id */
> +	edev->index = fec->dev_id;
>  
>  	if (fec_get_hwaddr(fec->dev_id, ethaddr) == 0) {
>  		debug("got MAC%d address from fuse: %pM\n", fec->dev_id, ethaddr);
>  		memcpy(edev->enetaddr, ethaddr, 6);
> -		if (!getenv("ethaddr"))
> -			eth_setenv_enetaddr("ethaddr", ethaddr);
> +		if (fec->dev_id)
> +			sprintf(mac, "eth%daddr", fec->dev_id);
> +		else
> +			strcpy(mac, "ethaddr");
> +		if (!getenv(mac))
> +			eth_setenv_enetaddr(mac, ethaddr);
>  	}
>  	return ret;
>  err4:
> 

Reviewed-by : Stefano Babic <sbabic@denx.de>

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 at denx.de
=====================================================================

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

* [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL
  2017-04-12 16:21 ` [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL Stefano Babic
@ 2017-04-18 13:39   ` Peng Fan
  2017-04-18 14:01     ` Stefano Babic
  0 siblings, 1 reply; 8+ messages in thread
From: Peng Fan @ 2017-04-18 13:39 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

> -----Original Message-----
> From: Stefano Babic [mailto:sbabic at denx.de]
> Sent: Thursday, April 13, 2017 12:22 AM
> To: Peng Fan <peng.fan@nxp.com>; joe.hershberger at ni.com
> Cc: u-boot at lists.denx.de
> Subject: Re: [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for
> i.MX6ULL
> 
> On 10/04/2017 13:44, Peng Fan wrote:
> > The MIB RAM and FIFO receive start register does not exist on
> > i.MX6ULL. Accessing these register will cause enet not work well or
> > cause system report fault.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > Cc: Joe Hershberger <joe.hershberger@ni.com>
> > ---
> >  drivers/net/fec_mxc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index
> > 910879b..ac7afb5 100644
> > --- a/drivers/net/fec_mxc.c
> > +++ b/drivers/net/fec_mxc.c
> > @@ -563,7 +563,7 @@ static int fec_init(struct eth_device *dev, bd_t *bd)
> >  	writel(0x00000000, &fec->eth->gaddr2);
> >
> >  	/* Do not access reserved register for i.MX6UL */
> > -	if (!is_mx6ul()) {
> > +	if (!is_mx6ul() && !is_mx6ull()) {
> >  		/* clear MIB RAM */
> >  		for (i = mib_ptr; i <= mib_ptr + 0xfc; i += 4)
> >  			writel(0, i);
> >
> 
> Reviewed-by : Stefano Babic <sbabic@denx.de>
> 
> Joe, I see Tom has assigned the series  to me. If it is ok for you, I will merge the
> series into u-boot-imx.

Will you pick up this patch set?

Thanks,
Peng.
> 
> Regards,
> Stefano
> 
> --
> ============================================================
> =========
> 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 at denx.de
> ============================================================
> =========

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

* [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL
  2017-04-18 13:39   ` Peng Fan
@ 2017-04-18 14:01     ` Stefano Babic
  0 siblings, 0 replies; 8+ messages in thread
From: Stefano Babic @ 2017-04-18 14:01 UTC (permalink / raw)
  To: u-boot

On 18/04/2017 15:39, Peng Fan wrote:
> Hi Stefano,
> 
>> -----Original Message-----
>> From: Stefano Babic [mailto:sbabic at denx.de]
>> Sent: Thursday, April 13, 2017 12:22 AM
>> To: Peng Fan <peng.fan@nxp.com>; joe.hershberger at ni.com
>> Cc: u-boot at lists.denx.de
>> Subject: Re: [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for
>> i.MX6ULL
>>
>> On 10/04/2017 13:44, Peng Fan wrote:
>>> The MIB RAM and FIFO receive start register does not exist on
>>> i.MX6ULL. Accessing these register will cause enet not work well or
>>> cause system report fault.
>>>
>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>> Cc: Joe Hershberger <joe.hershberger@ni.com>
>>> ---
>>>  drivers/net/fec_mxc.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index
>>> 910879b..ac7afb5 100644
>>> --- a/drivers/net/fec_mxc.c
>>> +++ b/drivers/net/fec_mxc.c
>>> @@ -563,7 +563,7 @@ static int fec_init(struct eth_device *dev, bd_t *bd)
>>>  	writel(0x00000000, &fec->eth->gaddr2);
>>>
>>>  	/* Do not access reserved register for i.MX6UL */
>>> -	if (!is_mx6ul()) {
>>> +	if (!is_mx6ul() && !is_mx6ull()) {
>>>  		/* clear MIB RAM */
>>>  		for (i = mib_ptr; i <= mib_ptr + 0xfc; i += 4)
>>>  			writel(0, i);
>>>
>>
>> Reviewed-by : Stefano Babic <sbabic@denx.de>
>>
>> Joe, I see Tom has assigned the series  to me. If it is ok for you, I will merge the
>> series into u-boot-imx.
> 
> Will you pick up this patch set?
> 


Yes, I pick it up. Applied to u-boot-imx, 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 at denx.de
=====================================================================

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

end of thread, other threads:[~2017-04-18 14:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-10 11:44 [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL Peng Fan
2017-04-10 11:44 ` [U-Boot] [PATCH 2/3] net: fec_mxc: avoid transfer dev_id -1 to get mac address from fuse Peng Fan
2017-04-12 16:22   ` Stefano Babic
2017-04-10 11:44 ` [U-Boot] [PATCH 3/3] net: fec_mxc: specify the registered eth index by dev_id Peng Fan
2017-04-12 16:22   ` Stefano Babic
2017-04-12 16:21 ` [U-Boot] [PATCH 1/3] net: fec: do not access reserved register for i.MX6ULL Stefano Babic
2017-04-18 13:39   ` Peng Fan
2017-04-18 14:01     ` Stefano Babic

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.