Skip to contentSkip to conversation

drivers/net/fec_mxc.c: write mac address in init

PATCH New John Rigby 8 participants 15 messages Sep 8, 2010 – Oct 22, 2010 Network drivers

lore
Share & tools
lore

John Rigby

author
#0 lore raw

PATCH 1/1 drivers/net/fec_mxc.c: write mac address in init

call fec_set_hwaddr in init routine to setup MAC address so when ethaddr is set late the change will propagate to the hw

---
 drivers/net/fec_mxc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/fec_mxc.c +2 -0
index 2d4ffed..050c0e1 100644
@@ -414,6 +414,8 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
 	uint32_t base;
 	struct fec_priv *fec = (struct fec_priv *)dev->priv;
 
+	/* Initialize MAC address */
+	fec_set_hwaddr(dev);
 	/*
 	 * reserve memory for both buffer descriptor chains at once
 	 * Datasheet forces the startaddress of each chain is 16 byte
Signature · 1 line
1.7.0.4
author
#1 lore raw

PATCH 1/1 drivers/net/fec_mxc.c: write mac address in init

Quoted 4 lines · John Rigby

call fec_set_hwaddr in init routine to setup MAC address so when ethaddr is set late the change will propagate to the hw

Ben, can this fix go into the next release?

#2 lore raw

PATCH 1/1 drivers/net/fec_mxc.c: write mac address in init

In reply to John Rigby

Dear John Rigby,

Quoted 2 lines · In message <[email protected]> you wrote:

call fec_set_hwaddr in init routine to setup MAC address so when ethaddr is set late the change will propagate to the hw

s/late/later/ ?

Quoted 10 lines
---
 drivers/net/fec_mxc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/fec_mxc.c +0 -0
index 2d4ffed..050c0e1 100644

drivers/net/fec_mxc.c static int fec_init(struct eth_device *dev, bd_t* bd) · line 421

Quoted 8 lines
drivers/net/fec_mxc.c +2 -0
@@ -414,6 +414,8 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
 	uint32_t base;
 	struct fec_priv *fec = (struct fec_priv *)dev->priv;
 
+	/* Initialize MAC address */
+	fec_set_hwaddr(dev);
 	/*
 	 * reserve memory for both buffer descriptor chains at once
 	 * Datasheet forces the startaddress of each chain is 16 byte

Please insert blank line before comment.

Best regards,

Wolfgang Denk

Signature · 6 lines
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
It became apparent that one reason why the Ice Giants were  known  as
the  Ice  Giants  was  because they were, well, giants. The other was
that they were made of ice.              -Terry Pratchett, _Sourcery_
author
#3 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address in init

In reply to John Rigby

Call fec_set_hwaddr in init routine to setup MAC address so when ethaddr is set late via setenv the change will propagate to the hw.

---
v2 - add blank line as requested
better commit message
added CC

 drivers/net/fec_mxc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/fec_mxc.c +3 -0
index 2d4ffed..3f09c2b 100644
@@ -414,6 +414,9 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
 	uint32_t base;
 	struct fec_priv *fec = (struct fec_priv *)dev->priv;
 
+	/* Initialize MAC address */
+	fec_set_hwaddr(dev);
+
 	/*
 	 * reserve memory for both buffer descriptor chains at once
 	 * Datasheet forces the startaddress of each chain is 16 byte
Signature · 1 line
1.7.1
#4 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address in init

Dear John Rigby,

Quoted 11 lines · In message <[email protected]> you wrote:

Call fec_set_hwaddr in init routine to setup MAC address so when ethaddr is set late via setenv the change will propagate to the hw.

---
v2 - add blank line as requested
better commit message
added CC

 drivers/net/fec_mxc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Applied, thanks.

Ben, I hope this is OK with you.

Best regards,

Wolfgang Denk

Signature · 5 lines
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
There are three ways to get something  done:  do  it  yourself,  hire
someone, or forbid your kids to do it.
#5 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address ininit

Hi, John & Wolfgang,

Quoted 2 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de

[mailto:u-boot-bounces at lists.denx.de]

Quoted 5 lines

On Behalf Of Wolfgang Denk
Sent: Wednesday, October 20, 2010 5:28 AM
To: John Rigby
Cc: u-boot at lists.denx.de; Ben Warren
Subject: Re: [U-Boot] [PATCH v2] drivers/net/fec_mxc.c: write mac

address

Quoted 5 lines

ininit

Dear John Rigby,

In message <[email protected]>

you

Quoted 14 lines
Quoted 1 line · wrote:

Call fec_set_hwaddr in init routine to setup MAC address so when

ethaddr is set

Quoted 10 lines

late via setenv the change will propagate to the hw.

---
v2 - add blank line as requested
better commit message
added CC

 drivers/net/fec_mxc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Quoted 3 lines

Applied, thanks.

Ben, I hope this is OK with you.

In fact, I don't think it's a good fix to fec-mac-address-not-set issue, it's just a hack. This is the output from bootup log,

Warning: FEC MAC addresses don't match:
Address in SROM is 75:6e:20:62:6f:6f
Address in environment is 00:01:02:04:05:06

It will give one confused warning that the FEC MAC has been set in the SROM, but actually, this the float value which induced by this patch.

In fact, we need read the mac address from FUSE(IIM), all the MAC address has burned into fuse after the chip has been shipped out.

I will send out one patch to fix this issue soon.

Quoted 15 lines

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 There are three ways to get something done: do it yourself, hire someone, or forbid your kids to do it.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#6 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address ininit

For current mx51 support in u-boot where we have no fuse support the patch is useful. I don't recall what the general policy is in u-boot for env vs eeprom mac addresses but I do remember discussions about it.

Quoted 72 lines · On Tue, Oct 19, 2010 at 11:21 PM, Liu Hui-R64343 <[email protected]> wrote:

Hi, John & Wolfgang,

Quoted 2 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de

[mailto:u-boot-bounces at lists.denx.de]

Quoted 5 lines

On Behalf Of Wolfgang Denk
Sent: Wednesday, October 20, 2010 5:28 AM
To: John Rigby
Cc: u-boot at lists.denx.de; Ben Warren
Subject: Re: [U-Boot] [PATCH v2] drivers/net/fec_mxc.c: write mac

address

Quoted 5 lines

ininit

Dear John Rigby,

In message <[email protected]>

you

Quoted 14 lines
Quoted 1 line · wrote:

Call fec_set_hwaddr in init routine to setup MAC address so when

ethaddr is set

Quoted 10 lines

late via setenv the change will propagate to the hw.

---
v2 - add blank line as requested
? ? ?better commit message
? ? ?added CC
?drivers/net/fec_mxc.c | ? ?3 +++
?1 files changed, 3 insertions(+), 0 deletions(-)

Quoted 3 lines

Applied, thanks.

Ben, I hope this is OK with you.

In fact, I don't think it's a good fix to fec-mac-address-not-set issue, it's just a hack. This is the output from bootup log,

Warning: FEC MAC addresses don't match:
Address in SROM is ? ? ? ? 75:6e:20:62:6f:6f
Address in environment is ?00:01:02:04:05:06

It will give one confused warning that the FEC MAC has been set in the SROM, but actually, this the float value which induced by this patch.

In fact, we need read the mac address from FUSE(IIM), all the MAC address has burned into fuse after the chip has been shipped out.

I will send out one patch to fix this issue soon.

Quoted 5 lines

Best regards,

Wolfgang Denk

Quoted 10 lines

--
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 There are three ways to get something ?done: ?do ?it ?yourself, ?hire someone, or forbid your kids to do it.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#7 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address ininit

Hi, John

2010/10/22 John Rigby <[email protected]>:

Quoted 4 lines

For current mx51 support in u-boot where we have no fuse support the patch is useful. ?I don't recall what the general policy is in u-boot for env vs eeprom mac addresses but I do remember discussions about it.

Geting mac address from FUSE is the right way for mx51 and it's not difficult to add FUSE read function due to the FUSE read is simple as the memory read. I have seen that Shawn has posted the patches to Linaro-uboot git there.

Quoted 79 lines · On Tue, Oct 19, 2010 at 11:21 PM, Liu Hui-R64343 <[email protected]> wrote:
Quoted 67 lines

Hi, John & Wolfgang,

Quoted 2 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de

[mailto:u-boot-bounces at lists.denx.de]

Quoted 5 lines

On Behalf Of Wolfgang Denk
Sent: Wednesday, October 20, 2010 5:28 AM
To: John Rigby
Cc: u-boot at lists.denx.de; Ben Warren
Subject: Re: [U-Boot] [PATCH v2] drivers/net/fec_mxc.c: write mac

address

Quoted 5 lines

ininit

Dear John Rigby,

In message <[email protected]>

you

Quoted 14 lines
Quoted 1 line · wrote:

Call fec_set_hwaddr in init routine to setup MAC address so when

ethaddr is set

Quoted 10 lines

late via setenv the change will propagate to the hw.

---
v2 - add blank line as requested
? ? ?better commit message
? ? ?added CC
?drivers/net/fec_mxc.c | ? ?3 +++
?1 files changed, 3 insertions(+), 0 deletions(-)

Quoted 3 lines

Applied, thanks.

Ben, I hope this is OK with you.

In fact, I don't think it's a good fix to fec-mac-address-not-set issue, it's just a hack. This is the output from bootup log,

Warning: FEC MAC addresses don't match:
Address in SROM is ? ? ? ? 75:6e:20:62:6f:6f
Address in environment is ?00:01:02:04:05:06

It will give one confused warning that the FEC MAC has been set in the SROM, but actually, this the float value which induced by this patch.

In fact, we need read the mac address from FUSE(IIM), all the MAC address has burned into fuse after the chip has been shipped out.

I will send out one patch to fix this issue soon.

Quoted 5 lines

Best regards,

Wolfgang Denk

Quoted 10 lines

--
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 There are three ways to get something ?done: ?do ?it ?yourself, ?hire someone, or forbid your kids to do it.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Quoted 5 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#8 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address ininit

Dear Jason Liu,

Quoted 5 lines · In message <[email protected]> you…

Geting mac address from FUSE is the right way for mx51 and it's not difficult to add FUSE read function due to the FUSE read is simple as the memory read. I have seen that Shawn has posted the patches to Linaro-uboot git there.

It's a pity that Linaro does it's development out-of-tree, but it's their decision, and we cannot help it.

If you think it's so easy, then why don't you adapt their code and submit it as patches here?

Best regards,

Wolfgang Denk

Signature · 5 lines
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
"A complex system that works is invariably found to have evolved from
a simple system that worked."             - John Gall, _Systemantics_
#9 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address ininit

Hi, Wolfgang,

2010/10/22 Wolfgang Denk <[email protected]>:

Quoted 9 lines

Dear Jason Liu,

Quoted 5 lines · In message <[email protected]> you…

Geting mac address from FUSE is the right way for mx51 and it's not difficult to add FUSE read function due to the FUSE read is simple as the memory read. I have seen that Shawn has posted the patches to Linaro-uboot git there.

Quoted 5 lines

It's a pity that Linaro does it's development out-of-tree, but it's their decision, and we cannot help it.

If you think it's so easy, then why don't you adapt their code and submit it as patches here?

I will submit the patch soon. Thanks,

Quoted 12 lines

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 "A complex system that works is invariably found to have evolved from a simple system that worked." ? ? ? ? ? ? - John Gall, _Systemantics_

#10 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address ininit

In reply to Wolfgang Denk
Quoted 11 lines · Wolfgang Denk

Dear Jason Liu,

Quoted 5 lines · In message <[email protected]> you…

Geting mac address from FUSE is the right way for mx51 and it's not difficult to add FUSE read function due to the FUSE read is simple as the memory read. I have seen that Shawn has posted the patches to Linaro-uboot git there.

It's a pity that Linaro does it's development out-of-tree, but it's their decision, and we cannot help it.

Hmmm . . . I'm doing OMAP3 & 4 u-boot work for Linaro and *all* of my work is based on current mainline!

So I think that this is probably not a good blanket assumption.

Steve

#11 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address ininit

Dear Steve Sakoman,

Quoted 8 lines · In message <[email protected]> you…
Quoted 3 lines

It's a pity that Linaro does it's development out-of-tree, but it's their decision, and we cannot help it.

Hmmm . . . I'm doing OMAP3 & 4 u-boot work for Linaro and *all* of my work is based on current mainline!

So I think that this is probably not a good blanket assumption.

You are right, I should be more careful with such generalizations. Sorry.

Best regards,

Wolfgang Denk

Signature · 4 lines
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
God is real, unless declared integer.
#12 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address ininit

In reply to Steve Sakoman
Quoted 7 lines · On Friday, October 22, 2010 11:00:37 Steve Sakoman wrote:
Quoted 6 lines · Wolfgang Denk
Quoted 4 lines · Jason Liu

Geting mac address from FUSE is the right way for mx51 and it's not difficult to add FUSE read function due to the FUSE read is simple as the memory read. I have seen that Shawn has posted the patches to Linaro-uboot git there.

Quoted 5 lines
Quoted 2 lines

It's a pity that Linaro does it's development out-of-tree, but it's their decision, and we cannot help it.

Hmmm . . . I'm doing OMAP3 & 4 u-boot work for Linaro and *all* of my work is based on current mainline!

technically speaking, *everyone* is doing work "based on mainline". but if you're maintaining a fork without getting merged, then Wolfgang's statement is still pretty correct. if i cant checkout current mainline from Wolfgang and get stuff working, then something is wrong.
-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/20101022/90da9b61/attachment.pgp

#13 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address ininit

Quoted 11 lines · Mike Frysinger
Quoted 10 lines · On Friday, October 22, 2010 11:00:37 Steve Sakoman wrote:
Quoted 8 lines · Wolfgang Denk
Quoted 4 lines · Jason Liu

Geting mac address from FUSE is the right way for mx51 and it's not difficult to add FUSE read function due to the FUSE read is simple as the memory read. I have seen that Shawn has posted the patches to Linaro-uboot git there.

It's a pity that Linaro does it's development out-of-tree, but it's their decision, and we cannot help it.

Quoted 7 lines
Quoted 2 lines

Hmmm . . . I'm doing OMAP3 & 4 u-boot work for Linaro and *all* of my work is based on current mainline!

technically speaking, *everyone* is doing work "based on mainline". ?but if you're maintaining a fork without getting merged, then Wolfgang's statement is still pretty correct. ?if i cant checkout current mainline from Wolfgang and get stuff working, then something is wrong.

I can't speak for others, but the lifetime of a patch in my working branch is just a few days before it gets posted to the list.

Frankly I can't imagine working any closer to top of tree. I do daily merges and builds and send fix patches as soon as I have them.

Steve

#14 lore raw

PATCH v2 1/1 drivers/net/fec_mxc.c: write mac address ininit

Quoted 9 lines
Quoted 4 lines · Jason Liu

Geting mac address from FUSE is the right way for mx51 and it's not difficult to add FUSE read function due to the FUSE read is simple as the memory read. I have seen that Shawn has posted the patches to Linaro-uboot git there.

It's a pity that Linaro does it's development out-of-tree, but it's their decision, and we cannot help it.

I'm new to community, not Linaro person, but just a Linaro player. And I did not intend to do any out-of-tree u-boot patch. I'm sorry for this, and will make sure all the future u-boot patches will be sent to this list.

PS. I just subscribed the list 10 minutes back.

Signature · 2 lines
Regards,
Shawn