All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address
@ 2009-04-08 11:23 Daniel Mack
  2009-04-08 11:23 ` [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220 Daniel Mack
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Daniel Mack @ 2009-04-08 11:23 UTC (permalink / raw)
  To: u-boot

If the MAX address is given by the environment, write it back to the
hardware.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/smc911x.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 30f2dc2..8c9a2a8 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -41,8 +41,13 @@ static int smx911x_handle_mac_address(bd_t *bd)
 	unsigned long addrh, addrl;
 	uchar m[6];
 
-	/* if the environment has a valid mac address then use it */
-	if (!eth_getenv_enetaddr("ethaddr", m)) {
+	if (eth_getenv_enetaddr("ethaddr", m)) {
+		/* if the environment has a valid mac address then use it */
+		addrl = m[0] | (m[1] << 8) | (m[2] << 16) | (m[3] << 24);
+		addrh = m[4] | (m[5] << 8);
+		smc911x_set_mac_csr(ADDRL, addrl);
+		smc911x_set_mac_csr(ADDRH, addrh);
+	} else {
 		/* if not, try to get one from the eeprom */
 		addrh = smc911x_get_mac_csr(ADDRH);
 		addrl = smc911x_get_mac_csr(ADDRL);
-- 
1.6.2.1

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

* [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220
  2009-04-08 11:23 [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address Daniel Mack
@ 2009-04-08 11:23 ` Daniel Mack
  2009-04-08 11:23   ` [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected Daniel Mack
  2009-04-23  5:36   ` [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220 Ben Warren
  2009-04-21 11:13 ` [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address Daniel Mack
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 21+ messages in thread
From: Daniel Mack @ 2009-04-08 11:23 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/smc911x.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
index 80d2ce0..2b01cf5 100644
--- a/drivers/net/smc911x.h
+++ b/drivers/net/smc911x.h
@@ -382,6 +382,7 @@ static inline void smc911x_reg_write(u32 addr, u32 val)
 #define CHIP_9216	0x116a
 #define CHIP_9217	0x117a
 #define CHIP_9218	0x118a
+#define CHIP_9220	0x9220
 
 struct chip_id {
 	u16 id;
@@ -398,6 +399,7 @@ static const struct chip_id chip_ids[] =  {
 	{ CHIP_9216, "LAN9216" },
 	{ CHIP_9217, "LAN9217" },
 	{ CHIP_9218, "LAN9218" },
+	{ CHIP_9220, "LAN9220" },
 	{ 0, NULL },
 };
 
-- 
1.6.2.1

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

* [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected
  2009-04-08 11:23 ` [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220 Daniel Mack
@ 2009-04-08 11:23   ` Daniel Mack
  2009-04-08 22:00     ` Mike Frysinger
  2009-04-23  5:36   ` [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220 Ben Warren
  1 sibling, 1 reply; 21+ messages in thread
From: Daniel Mack @ 2009-04-08 11:23 UTC (permalink / raw)
  To: u-boot

On boards without EEPROMs, don't reset the chip on U-Boot's exit so that
the MAC set by environment settings can be used by the OS later.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/smc911x.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 8c9a2a8..f777ae9 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -225,7 +225,9 @@ int eth_send(volatile void *packet, int length)
 
 void eth_halt(void)
 {
+#ifndef CONFIG_DRIVER_SMC911X_NO_EEPROM
 	smc911x_reset();
+#endif
 }
 
 int eth_rx(void)
-- 
1.6.2.1

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

* [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected
  2009-04-08 11:23   ` [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected Daniel Mack
@ 2009-04-08 22:00     ` Mike Frysinger
  2009-04-09  0:08       ` Daniel Mack
  0 siblings, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2009-04-08 22:00 UTC (permalink / raw)
  To: u-boot

On Wednesday 08 April 2009 07:23:39 Daniel Mack wrote:
> On boards without EEPROMs, don't reset the chip on U-Boot's exit so that
> the MAC set by environment settings can be used by the OS later.

that isnt how the MAC is passed to the OS ... this change is incorrect

the OS must be able to get the MAC address regardless of the state of the 
network controller
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090408/04ddc7b5/attachment.pgp 

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

* [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected
  2009-04-08 22:00     ` Mike Frysinger
@ 2009-04-09  0:08       ` Daniel Mack
  2009-04-09  3:57         ` Mike Frysinger
  0 siblings, 1 reply; 21+ messages in thread
From: Daniel Mack @ 2009-04-09  0:08 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 08, 2009 at 06:00:40PM -0400, Mike Frysinger wrote:
> On Wednesday 08 April 2009 07:23:39 Daniel Mack wrote:
> > On boards without EEPROMs, don't reset the chip on U-Boot's exit so that
> > the MAC set by environment settings can be used by the OS later.
> 
> that isnt how the MAC is passed to the OS ... this change is incorrect
> 
> the OS must be able to get the MAC address regardless of the state of the 
> network controller

Not if the MAC is stored in the volatile smc911x registers. Issuing a
soft reset flushes these values - if U-Boot does that, the OS has no
change getting them.

That's what I saw here and it is also stated in the datasheet.

Daniel

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

* [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected
  2009-04-09  0:08       ` Daniel Mack
@ 2009-04-09  3:57         ` Mike Frysinger
  2009-04-21 11:13           ` Daniel Mack
  0 siblings, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2009-04-09  3:57 UTC (permalink / raw)
  To: u-boot

On Wednesday 08 April 2009 20:08:38 Daniel Mack wrote:
> On Wed, Apr 08, 2009 at 06:00:40PM -0400, Mike Frysinger wrote:
> > On Wednesday 08 April 2009 07:23:39 Daniel Mack wrote:
> > > On boards without EEPROMs, don't reset the chip on U-Boot's exit so
> > > that the MAC set by environment settings can be used by the OS later.
> >
> > that isnt how the MAC is passed to the OS ... this change is incorrect
> >
> > the OS must be able to get the MAC address regardless of the state of the
> > network controller
>
> Not if the MAC is stored in the volatile smc911x registers. Issuing a
> soft reset flushes these values - if U-Boot does that, the OS has no
> change getting them.

then either your u-boot or your OS is misconfigured and you need to fix that.  
as clearly stated in docs/README.enetaddr, the environment is the place where 
mac addresses live when there is no dedicated storage (like an eeprom).

ignoring that, the mac address doesnt magically get programmed.  if no network 
operation was initiated, then the part wouldnt have been programmed anyways, 
so you're still left with an OS that cant get itself functional.

> That's what I saw here and it is also stated in the datasheet.

sounds like the driver and hardware is operating correctly then
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090408/5fb53054/attachment.pgp 

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

* [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected
  2009-04-09  3:57         ` Mike Frysinger
@ 2009-04-21 11:13           ` Daniel Mack
  2009-04-27  3:14             ` Mike Frysinger
  0 siblings, 1 reply; 21+ messages in thread
From: Daniel Mack @ 2009-04-21 11:13 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 08, 2009 at 11:57:37PM -0400, Mike Frysinger wrote:
> > Not if the MAC is stored in the volatile smc911x registers. Issuing a
> > soft reset flushes these values - if U-Boot does that, the OS has no
> > change getting them.
> 
> then either your u-boot or your OS is misconfigured and you need to fix that.  
> as clearly stated in docs/README.enetaddr, the environment is the place where 
> mac addresses live when there is no dedicated storage (like an eeprom).
> 
> ignoring that, the mac address doesnt magically get programmed.  if no network 
> operation was initiated, then the part wouldnt have been programmed anyways, 
> so you're still left with an OS that cant get itself functional.

Ok, true. Thanks for pointing this out.

Daniel

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

* [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address
  2009-04-08 11:23 [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address Daniel Mack
  2009-04-08 11:23 ` [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220 Daniel Mack
@ 2009-04-21 11:13 ` Daniel Mack
  2009-04-21 11:38 ` Sascha Hauer
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 21+ messages in thread
From: Daniel Mack @ 2009-04-21 11:13 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 08, 2009 at 01:23:37PM +0200, Daniel Mack wrote:
> Signed-off-by: Daniel Mack <daniel@caiaq.de>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>

ping.


> ---
>  drivers/net/smc911x.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
> index 30f2dc2..8c9a2a8 100644
> --- a/drivers/net/smc911x.c
> +++ b/drivers/net/smc911x.c
> @@ -41,8 +41,13 @@ static int smx911x_handle_mac_address(bd_t *bd)
>  	unsigned long addrh, addrl;
>  	uchar m[6];
>  
> -	/* if the environment has a valid mac address then use it */
> -	if (!eth_getenv_enetaddr("ethaddr", m)) {
> +	if (eth_getenv_enetaddr("ethaddr", m)) {
> +		/* if the environment has a valid mac address then use it */
> +		addrl = m[0] | (m[1] << 8) | (m[2] << 16) | (m[3] << 24);
> +		addrh = m[4] | (m[5] << 8);
> +		smc911x_set_mac_csr(ADDRL, addrl);
> +		smc911x_set_mac_csr(ADDRH, addrh);
> +	} else {
>  		/* if not, try to get one from the eeprom */
>  		addrh = smc911x_get_mac_csr(ADDRH);
>  		addrl = smc911x_get_mac_csr(ADDRL);
> -- 
> 1.6.2.1
> 

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

* [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address
  2009-04-08 11:23 [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address Daniel Mack
  2009-04-08 11:23 ` [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220 Daniel Mack
  2009-04-21 11:13 ` [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address Daniel Mack
@ 2009-04-21 11:38 ` Sascha Hauer
  2009-04-21 11:44   ` Daniel Mack
  2009-04-23  5:36 ` Ben Warren
  2009-05-05 20:01 ` Mike Frysinger
  4 siblings, 1 reply; 21+ messages in thread
From: Sascha Hauer @ 2009-04-21 11:38 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 08, 2009 at 01:23:37PM +0200, Daniel Mack wrote:
> If the MAX address is given by the environment, write it back to the
> hardware.
> 
> Signed-off-by: Daniel Mack <daniel@caiaq.de>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

Anyway, you shouldn't rely on this. I'm the original author of this
driver, but I do not use U-Boot-v1 anymore, so I can't tell if this
breaks something or not.

Sascha

> ---
>  drivers/net/smc911x.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
> index 30f2dc2..8c9a2a8 100644
> --- a/drivers/net/smc911x.c
> +++ b/drivers/net/smc911x.c
> @@ -41,8 +41,13 @@ static int smx911x_handle_mac_address(bd_t *bd)
>  	unsigned long addrh, addrl;
>  	uchar m[6];
>  
> -	/* if the environment has a valid mac address then use it */
> -	if (!eth_getenv_enetaddr("ethaddr", m)) {
> +	if (eth_getenv_enetaddr("ethaddr", m)) {
> +		/* if the environment has a valid mac address then use it */
> +		addrl = m[0] | (m[1] << 8) | (m[2] << 16) | (m[3] << 24);
> +		addrh = m[4] | (m[5] << 8);
> +		smc911x_set_mac_csr(ADDRL, addrl);
> +		smc911x_set_mac_csr(ADDRH, addrh);
> +	} else {
>  		/* if not, try to get one from the eeprom */
>  		addrh = smc911x_get_mac_csr(ADDRH);
>  		addrl = smc911x_get_mac_csr(ADDRL);
> -- 
> 1.6.2.1
> 
> 

-- 
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 |

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

* [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address
  2009-04-21 11:38 ` Sascha Hauer
@ 2009-04-21 11:44   ` Daniel Mack
  2009-04-21 13:28     ` Ben Warren
  0 siblings, 1 reply; 21+ messages in thread
From: Daniel Mack @ 2009-04-21 11:44 UTC (permalink / raw)
  To: u-boot

Hi Sascha,

On Tue, Apr 21, 2009 at 01:38:23PM +0200, Sascha Hauer wrote:
> On Wed, Apr 08, 2009 at 01:23:37PM +0200, Daniel Mack wrote:
> > If the MAX address is given by the environment, write it back to the
> > hardware.
> > 
> > Signed-off-by: Daniel Mack <daniel@caiaq.de>
> > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> 
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> 
> Anyway, you shouldn't rely on this. I'm the original author of this
> driver, but I do not use U-Boot-v1 anymore, so I can't tell if this
> breaks something or not.

No problem. I just Cc'ed all email addresses I could find in the code.

Who will pick that one and the one regarding support for the 9220
controller for mainline?

Thanks,
Daniel

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

* [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address
  2009-04-21 11:44   ` Daniel Mack
@ 2009-04-21 13:28     ` Ben Warren
  2009-04-21 13:30       ` Daniel Mack
  0 siblings, 1 reply; 21+ messages in thread
From: Ben Warren @ 2009-04-21 13:28 UTC (permalink / raw)
  To: u-boot

Hi Daniel,

On Tue, Apr 21, 2009 at 4:44 AM, Daniel Mack <daniel@caiaq.de> wrote:

> Hi Sascha,
>
> On Tue, Apr 21, 2009 at 01:38:23PM +0200, Sascha Hauer wrote:
> > On Wed, Apr 08, 2009 at 01:23:37PM +0200, Daniel Mack wrote:
> > > If the MAX address is given by the environment, write it back to the
> > > hardware.
> > >
> > > Signed-off-by: Daniel Mack <daniel@caiaq.de>
> > > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> >
> > Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> >
> > Anyway, you shouldn't rely on this. I'm the original author of this
> > driver, but I do not use U-Boot-v1 anymore, so I can't tell if this
> > breaks something or not.
>
> No problem. I just Cc'ed all email addresses I could find in the code.
>
> Who will pick that one and the one regarding support for the 9220
> controller for mainline?
>
Network drivers are my responsibility.  Please CC me in the future as it
stands out more clearly.  I guess I was waiting on you to resolve 3/3, but
instead can pick up parts 1 and 2 if you like.

>
> Thanks,
> Daniel
>
regards,
Ben

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

* [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address
  2009-04-21 13:28     ` Ben Warren
@ 2009-04-21 13:30       ` Daniel Mack
  0 siblings, 0 replies; 21+ messages in thread
From: Daniel Mack @ 2009-04-21 13:30 UTC (permalink / raw)
  To: u-boot

On Tue, Apr 21, 2009 at 06:28:34AM -0700, Ben Warren wrote:
> > > Anyway, you shouldn't rely on this. I'm the original author of this
> > > driver, but I do not use U-Boot-v1 anymore, so I can't tell if this
> > > breaks something or not.
> >
> > No problem. I just Cc'ed all email addresses I could find in the code.
> >
> > Who will pick that one and the one regarding support for the 9220
> > controller for mainline?
> >
> Network drivers are my responsibility.  Please CC me in the future as it
> stands out more clearly.  I guess I was waiting on you to resolve 3/3, but
> instead can pick up parts 1 and 2 if you like.

I'll try to solve 3/3 in another fashion, so feel free to merge the
other two.

Thanks,
Daniel

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

* [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address
  2009-04-08 11:23 [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address Daniel Mack
                   ` (2 preceding siblings ...)
  2009-04-21 11:38 ` Sascha Hauer
@ 2009-04-23  5:36 ` Ben Warren
  2009-05-21  5:03   ` Dirk Behme
  2009-05-05 20:01 ` Mike Frysinger
  4 siblings, 1 reply; 21+ messages in thread
From: Ben Warren @ 2009-04-23  5:36 UTC (permalink / raw)
  To: u-boot

Daniel Mack wrote:
> If the MAX address is given by the environment, write it back to the
> hardware.
>
> Signed-off-by: Daniel Mack <daniel@caiaq.de>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/net/smc911x.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
> index 30f2dc2..8c9a2a8 100644
> --- a/drivers/net/smc911x.c
> +++ b/drivers/net/smc911x.c
> @@ -41,8 +41,13 @@ static int smx911x_handle_mac_address(bd_t *bd)
>  	unsigned long addrh, addrl;
>  	uchar m[6];
>  
> -	/* if the environment has a valid mac address then use it */
> -	if (!eth_getenv_enetaddr("ethaddr", m)) {
> +	if (eth_getenv_enetaddr("ethaddr", m)) {
> +		/* if the environment has a valid mac address then use it */
> +		addrl = m[0] | (m[1] << 8) | (m[2] << 16) | (m[3] << 24);
> +		addrh = m[4] | (m[5] << 8);
> +		smc911x_set_mac_csr(ADDRL, addrl);
> +		smc911x_set_mac_csr(ADDRH, addrh);
> +	} else {
>  		/* if not, try to get one from the eeprom */
>  		addrh = smc911x_get_mac_csr(ADDRH);
>  		addrl = smc911x_get_mac_csr(ADDRL);
Applied to net/next branch.

thanks,
Ben

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

* [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220
  2009-04-08 11:23 ` [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220 Daniel Mack
  2009-04-08 11:23   ` [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected Daniel Mack
@ 2009-04-23  5:36   ` Ben Warren
  1 sibling, 0 replies; 21+ messages in thread
From: Ben Warren @ 2009-04-23  5:36 UTC (permalink / raw)
  To: u-boot

Daniel Mack wrote:
> Signed-off-by: Daniel Mack <daniel@caiaq.de>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/net/smc911x.h |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
> index 80d2ce0..2b01cf5 100644
> --- a/drivers/net/smc911x.h
> +++ b/drivers/net/smc911x.h
> @@ -382,6 +382,7 @@ static inline void smc911x_reg_write(u32 addr, u32 val)
>  #define CHIP_9216	0x116a
>  #define CHIP_9217	0x117a
>  #define CHIP_9218	0x118a
> +#define CHIP_9220	0x9220
>  
>  struct chip_id {
>  	u16 id;
> @@ -398,6 +399,7 @@ static const struct chip_id chip_ids[] =  {
>  	{ CHIP_9216, "LAN9216" },
>  	{ CHIP_9217, "LAN9217" },
>  	{ CHIP_9218, "LAN9218" },
> +	{ CHIP_9220, "LAN9220" },
>  	{ 0, NULL },
>  };
>  
>   
Applied to net/next branch.

thanks,
Ben

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

* [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected
  2009-04-21 11:13           ` Daniel Mack
@ 2009-04-27  3:14             ` Mike Frysinger
  2009-04-27 14:44               ` Daniel Mack
  0 siblings, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2009-04-27  3:14 UTC (permalink / raw)
  To: u-boot

On Tuesday 21 April 2009 07:13:10 Daniel Mack wrote:
> On Wed, Apr 08, 2009 at 11:57:37PM -0400, Mike Frysinger wrote:
> > > Not if the MAC is stored in the volatile smc911x registers. Issuing a
> > > soft reset flushes these values - if U-Boot does that, the OS has no
> > > change getting them.
> >
> > then either your u-boot or your OS is misconfigured and you need to fix
> > that. as clearly stated in docs/README.enetaddr, the environment is the
> > place where mac addresses live when there is no dedicated storage (like
> > an eeprom).
> >
> > ignoring that, the mac address doesnt magically get programmed.  if no
> > network operation was initiated, then the part wouldnt have been
> > programmed anyways, so you're still left with an OS that cant get itself
> > functional.
>
> Ok, true. Thanks for pointing this out.

usually what i suggest to people are things like:
 - pass $(ethaddr) via kernel command line and parse /proc/cmdline
 - use the u-boot tools to read the u-boot env directly
 - set the hw address with `ifconfig` or similar tool
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090426/1123a06b/attachment.pgp 

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

* [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected
  2009-04-27  3:14             ` Mike Frysinger
@ 2009-04-27 14:44               ` Daniel Mack
  2009-04-27 15:56                 ` Mike Frysinger
  0 siblings, 1 reply; 21+ messages in thread
From: Daniel Mack @ 2009-04-27 14:44 UTC (permalink / raw)
  To: u-boot

On Sun, Apr 26, 2009 at 11:14:06PM -0400, Mike Frysinger wrote:
> On Tuesday 21 April 2009 07:13:10 Daniel Mack wrote:
> > On Wed, Apr 08, 2009 at 11:57:37PM -0400, Mike Frysinger wrote:
> > > > Not if the MAC is stored in the volatile smc911x registers. Issuing a
> > > > soft reset flushes these values - if U-Boot does that, the OS has no
> > > > change getting them.
> > >
> > > then either your u-boot or your OS is misconfigured and you need to fix
> > > that. as clearly stated in docs/README.enetaddr, the environment is the
> > > place where mac addresses live when there is no dedicated storage (like
> > > an eeprom).
> > >
> > > ignoring that, the mac address doesnt magically get programmed.  if no
> > > network operation was initiated, then the part wouldnt have been
> > > programmed anyways, so you're still left with an OS that cant get itself
> > > functional.
> >
> > Ok, true. Thanks for pointing this out.
> 
> usually what i suggest to people are things like:
>  - pass $(ethaddr) via kernel command line and parse /proc/cmdline
>  - use the u-boot tools to read the u-boot env directly
>  - set the hw address with `ifconfig` or similar tool

... which doesn't help much when it's about booting from NFS root. The
particular problem here is that the MAC changes from what it's set to in
U-Boot during the TFTP transaction and the randomly chosen one in Linux
(which takes place because after the reset, the MAC is all 0xff). And
that in turn confuses the ARP caches on other hosts. My patch solves
that issue for that very case; that's why it's still in my local tree.

Daniel

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

* [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected
  2009-04-27 14:44               ` Daniel Mack
@ 2009-04-27 15:56                 ` Mike Frysinger
  2009-04-27 19:05                   ` Scott Wood
  0 siblings, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2009-04-27 15:56 UTC (permalink / raw)
  To: u-boot

On Monday 27 April 2009 10:44:16 Daniel Mack wrote:
> On Sun, Apr 26, 2009 at 11:14:06PM -0400, Mike Frysinger wrote:
> > On Tuesday 21 April 2009 07:13:10 Daniel Mack wrote:
> > > On Wed, Apr 08, 2009 at 11:57:37PM -0400, Mike Frysinger wrote:
> > > > > Not if the MAC is stored in the volatile smc911x registers. Issuing
> > > > > a soft reset flushes these values - if U-Boot does that, the OS has
> > > > > no change getting them.
> > > >
> > > > then either your u-boot or your OS is misconfigured and you need to
> > > > fix that. as clearly stated in docs/README.enetaddr, the environment
> > > > is the place where mac addresses live when there is no dedicated
> > > > storage (like an eeprom).
> > > >
> > > > ignoring that, the mac address doesnt magically get programmed.  if
> > > > no network operation was initiated, then the part wouldnt have been
> > > > programmed anyways, so you're still left with an OS that cant get
> > > > itself functional.
> > >
> > > Ok, true. Thanks for pointing this out.
> >
> > usually what i suggest to people are things like:
> >  - pass $(ethaddr) via kernel command line and parse /proc/cmdline
> >  - use the u-boot tools to read the u-boot env directly
> >  - set the hw address with `ifconfig` or similar tool
>
> ... which doesn't help much when it's about booting from NFS root.

it works fine if you use an initramfs like everyone suggests
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090427/75391343/attachment.pgp 

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

* [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected
  2009-04-27 15:56                 ` Mike Frysinger
@ 2009-04-27 19:05                   ` Scott Wood
  0 siblings, 0 replies; 21+ messages in thread
From: Scott Wood @ 2009-04-27 19:05 UTC (permalink / raw)
  To: u-boot

On Mon, Apr 27, 2009 at 11:56:17AM -0400, Mike Frysinger wrote:
> On Monday 27 April 2009 10:44:16 Daniel Mack wrote:
> > On Sun, Apr 26, 2009 at 11:14:06PM -0400, Mike Frysinger wrote:
> > > usually what i suggest to people are things like:
> > >  - pass $(ethaddr) via kernel command line and parse /proc/cmdline
> > >  - use the u-boot tools to read the u-boot env directly
> > >  - set the hw address with `ifconfig` or similar tool
> >
> > ... which doesn't help much when it's about booting from NFS root.
> 
> it works fine if you use an initramfs like everyone suggests

Or when you use a device tree. :-)

-Scott

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

* [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address
  2009-04-08 11:23 [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address Daniel Mack
                   ` (3 preceding siblings ...)
  2009-04-23  5:36 ` Ben Warren
@ 2009-05-05 20:01 ` Mike Frysinger
  4 siblings, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2009-05-05 20:01 UTC (permalink / raw)
  To: u-boot

On Wednesday 08 April 2009 07:23:37 Daniel Mack wrote:
> If the MAX address is given by the environment, write it back to the
> hardware.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090505/9257eeff/attachment.pgp 

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

* [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address
  2009-04-23  5:36 ` Ben Warren
@ 2009-05-21  5:03   ` Dirk Behme
  2009-06-05 10:02     ` Wolfgang Denk
  0 siblings, 1 reply; 21+ messages in thread
From: Dirk Behme @ 2009-05-21  5:03 UTC (permalink / raw)
  To: u-boot

Ben Warren wrote:
> Daniel Mack wrote:
>> If the MAX address is given by the environment, write it back to the
>> hardware.
>>
>> Signed-off-by: Daniel Mack <daniel@caiaq.de>
>> Cc: Sascha Hauer <s.hauer@pengutronix.de>
>> ---
>>  drivers/net/smc911x.c |    9 +++++++--
>>  1 files changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
>> index 30f2dc2..8c9a2a8 100644
>> --- a/drivers/net/smc911x.c
>> +++ b/drivers/net/smc911x.c
>> @@ -41,8 +41,13 @@ static int smx911x_handle_mac_address(bd_t *bd)
>>  	unsigned long addrh, addrl;
>>  	uchar m[6];
>>  
>> -	/* if the environment has a valid mac address then use it */
>> -	if (!eth_getenv_enetaddr("ethaddr", m)) {
>> +	if (eth_getenv_enetaddr("ethaddr", m)) {
>> +		/* if the environment has a valid mac address then use it */
>> +		addrl = m[0] | (m[1] << 8) | (m[2] << 16) | (m[3] << 24);
>> +		addrh = m[4] | (m[5] << 8);
>> +		smc911x_set_mac_csr(ADDRL, addrl);
>> +		smc911x_set_mac_csr(ADDRH, addrh);
>> +	} else {
>>  		/* if not, try to get one from the eeprom */
>>  		addrh = smc911x_get_mac_csr(ADDRH);
>>  		addrl = smc911x_get_mac_csr(ADDRL);
> Applied to net/next branch.

Could we get this asap into mainline? Sounds like an urgent bugfix to me:

http://lists.denx.de/pipermail/u-boot/2009-May/053079.html

Many thanks

Dirk

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

* [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address
  2009-05-21  5:03   ` Dirk Behme
@ 2009-06-05 10:02     ` Wolfgang Denk
  0 siblings, 0 replies; 21+ messages in thread
From: Wolfgang Denk @ 2009-06-05 10:02 UTC (permalink / raw)
  To: u-boot

Dear Ben,

In message <4A14E0AB.7010906@googlemail.com> Dirk Behme wrote:
>
> >> If the MAX address is given by the environment, write it back to the
> >> hardware.
> >>
> >> Signed-off-by: Daniel Mack <daniel@caiaq.de>
> >> Cc: Sascha Hauer <s.hauer@pengutronix.de>
...
> > Applied to net/next branch.
> 
> Could we get this asap into mainline? Sounds like an urgent bugfix to me:
> 
> http://lists.denx.de/pipermail/u-boot/2009-May/053079.html

I agree with Dirk here.

Can we pull this into master, please?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The flow chart is a most thoroughly oversold piece of  program  docu-
mentation.              -- Frederick Brooks, "The Mythical Man Month"

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

end of thread, other threads:[~2009-06-05 10:02 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-08 11:23 [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address Daniel Mack
2009-04-08 11:23 ` [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220 Daniel Mack
2009-04-08 11:23   ` [U-Boot] [PATCH 3/3] smc911x: do net reset the chip if no EEPROM is connected Daniel Mack
2009-04-08 22:00     ` Mike Frysinger
2009-04-09  0:08       ` Daniel Mack
2009-04-09  3:57         ` Mike Frysinger
2009-04-21 11:13           ` Daniel Mack
2009-04-27  3:14             ` Mike Frysinger
2009-04-27 14:44               ` Daniel Mack
2009-04-27 15:56                 ` Mike Frysinger
2009-04-27 19:05                   ` Scott Wood
2009-04-23  5:36   ` [U-Boot] [PATCH 2/3] smc911x: add support for LAN9220 Ben Warren
2009-04-21 11:13 ` [U-Boot] [PATCH 1/3] smc911x: write back the manually set MAC address Daniel Mack
2009-04-21 11:38 ` Sascha Hauer
2009-04-21 11:44   ` Daniel Mack
2009-04-21 13:28     ` Ben Warren
2009-04-21 13:30       ` Daniel Mack
2009-04-23  5:36 ` Ben Warren
2009-05-21  5:03   ` Dirk Behme
2009-06-05 10:02     ` Wolfgang Denk
2009-05-05 20:01 ` Mike Frysinger

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.