public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] setting Ethernet address
@ 2014-03-14 18:29 Benedict Hewson
  2014-03-14 18:52 ` Fabio Estevam
  0 siblings, 1 reply; 7+ messages in thread
From: Benedict Hewson @ 2014-03-14 18:29 UTC (permalink / raw)
  To: u-boot

I am trying to get network support working on the Embest imx6 Marsboard.
I have been reading through the various imx6 boards and it appears that some 
at least store a MAC address in the fuse memory. 

This does not appear to be set on the MarSboard - the fuse memory contains 0.
The original 2009 version used the ethaddr environment variable.
If I try to include this in the config header file either as part of the 
CONFIG_EXTRA_ENV_SETTINGS - 

#define CONFIG_ETHADDR 00:01:02:03:04:05

#define	CONFIG_EXTRA_ENV_SETTINGS \
"ethaddr="__stringify(CONFIG_ETHADDR)"\0" \

or more simply as in the original version

"ethaddr=00:01:02:03:04:05\0" \

everything compiles, but when booting I get "Warning: failed to set MAC 
address"  and when listing the environment variables ethhaddr is missing.
If I manually set ethaddr and ipaddr the networking seems to work as I can 
ping the board successfully.

I assume I am missing something somewhere and I expect if I go through the 
source I will eventually find it, but it is probably going to be quicker to 
ask.


many thanks
Ben

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

* [U-Boot] setting Ethernet address
  2014-03-14 18:29 [U-Boot] setting Ethernet address Benedict Hewson
@ 2014-03-14 18:52 ` Fabio Estevam
  2014-03-15  7:08   ` Benedict Hewson
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2014-03-14 18:52 UTC (permalink / raw)
  To: u-boot

On Fri, Mar 14, 2014 at 3:29 PM, Benedict Hewson
<benedict@hewson-venieri.com> wrote:
> I am trying to get network support working on the Embest imx6 Marsboard.
> I have been reading through the various imx6 boards and it appears that some
> at least store a MAC address in the fuse memory.
>
> This does not appear to be set on the MarSboard - the fuse memory contains 0.
> The original 2009 version used the ethaddr environment variable.
> If I try to include this in the config header file either as part of the
> CONFIG_EXTRA_ENV_SETTINGS -

I would suggest you to add support for this board in mainline U-boot
and the MAC address will be read from fuse without problems.

Regards,

Fabio Estevam

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

* [U-Boot] setting Ethernet address
  2014-03-14 18:52 ` Fabio Estevam
@ 2014-03-15  7:08   ` Benedict Hewson
  2014-03-15 19:59     ` Fabio Estevam
  0 siblings, 1 reply; 7+ messages in thread
From: Benedict Hewson @ 2014-03-15  7:08 UTC (permalink / raw)
  To: u-boot

On Friday 14 Mar 2014 15:52:29 Fabio Estevam wrote:
> On Fri, Mar 14, 2014 at 3:29 PM, Benedict Hewson
> 
> <benedict@hewson-venieri.com> wrote:
> > I am trying to get network support working on the Embest imx6 Marsboard.
> > I have been reading through the various imx6 boards and it appears that
> > some at least store a MAC address in the fuse memory.
> > 
> > This does not appear to be set on the MarSboard - the fuse memory contains
> > 0. The original 2009 version used the ethaddr environment variable.
> > If I try to include this in the config header file either as part of the
> > CONFIG_EXTRA_ENV_SETTINGS -
> 
> I would suggest you to add support for this board in mainline U-boot
> and the MAC address will be read from fuse without problems.
> 

I am in the process of adding this to the mainline . I did submit a patch a 
few days ago, but much too early and it needed a lot of work as there was a 
lot of dead code, wrongly formatted comments and out of date CONFIG options as 
it was mostly based on 2009 uboot.

I have cleaned it up and removed the various CONFIG options which do not 
appear anywhere else in uboot. Just a few things left to sort out with 
networking.

Based on the mx6sabre configs I have tried inlcuding the config options

#define CONFIG_CMD_FUSE
#ifdef CONFIG_CMD_FUSE
#define CONFIG_MXC_OCOTP
#endif

and also 

#define CONFIG_CMD_PING
#define CONFIG_CMD_DHCP
#define CONFIG_CMD_MII
#define CONFIG_CMD_NET
#define CONFIG_FEC_MXC
#define CONFIG_MII
#define IMX_FEC_BASE			ENET_BASE_ADDR
#define CONFIG_FEC_XCV_TYPE		RGMII
#define CONFIG_ETHPRIME			"FEC"
#define CONFIG_FEC_MXC_PHYADDR		4

Anyway I get a can't set MAC address warning when booting.

In the fec_get_hwaddr() function I have printed out the values returned by 
imx_get_mac_from_fuse() and they are all 0.

I have read in the README.imx6 file that the MAC address is stored in the fuse 
bank. The default reset value according to the datasheet is 0, so is this 
programmed by Freescale or the board vendor ?  


Do I need to add anything more than CONFIG_CMD_FUSE & CONFIG_MXC_OCOTP to make 
the reading of the fuse memory work ?

regards
Ben

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

* [U-Boot] setting Ethernet address
  2014-03-15  7:08   ` Benedict Hewson
@ 2014-03-15 19:59     ` Fabio Estevam
  2014-03-16  7:00       ` Benedict Hewson
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2014-03-15 19:59 UTC (permalink / raw)
  To: u-boot

On Sat, Mar 15, 2014 at 4:08 AM, Benedict Hewson
<benedict@hewson-venieri.com> wrote:

> In the fec_get_hwaddr() function I have printed out the values returned by
> imx_get_mac_from_fuse() and they are all 0.
>
> I have read in the README.imx6 file that the MAC address is stored in the fuse
> bank. The default reset value according to the datasheet is 0, so is this
> programmed by Freescale or the board vendor ?

Looks like the vendor did not program the MAC address in the fuses then.

Does it work if you pass 'setenv ethaddr <macaddr>'?

Regards,

Fabio Estevam

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

* [U-Boot] setting Ethernet address
  2014-03-15 19:59     ` Fabio Estevam
@ 2014-03-16  7:00       ` Benedict Hewson
  2014-03-16  8:06         ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Benedict Hewson @ 2014-03-16  7:00 UTC (permalink / raw)
  To: u-boot

On Saturday 15 Mar 2014 16:59:05 Fabio Estevam wrote:
> On Sat, Mar 15, 2014 at 4:08 AM, Benedict Hewson
> 
> <benedict@hewson-venieri.com> wrote:
> > In the fec_get_hwaddr() function I have printed out the values returned by
> > imx_get_mac_from_fuse() and they are all 0.
> > 
> > I have read in the README.imx6 file that the MAC address is stored in the
> > fuse bank. The default reset value according to the datasheet is 0, so is
> > this programmed by Freescale or the board vendor ?
> 
> Looks like the vendor did not program the MAC address in the fuses then.
> 
> Does it work if you pass 'setenv ethaddr <macaddr>'?
> 
> Regards,
> 
> Fabio Estevam

yes using setenv ethaddr and setenv ipaddr allows me to ping other computers 
and to ping the board. 
I was wondering why if I try to set ethaddr as part of 
CONFIG_EXTRA_ENV_SETTINGS it is not there when I boot the board.

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

* [U-Boot] setting Ethernet address
  2014-03-16  7:00       ` Benedict Hewson
@ 2014-03-16  8:06         ` Wolfgang Denk
  2014-03-16  8:35           ` Benedict Hewson
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2014-03-16  8:06 UTC (permalink / raw)
  To: u-boot

Dear Benedict Hewson,

In message <4458778.Fr6NCEssuz@desktop1> you wrote:
>
> yes using setenv ethaddr and setenv ipaddr allows me to ping other computers 
> and to ping the board. 

Good.

> I was wondering why if I try to set ethaddr as part of 
> CONFIG_EXTRA_ENV_SETTINGS it is not there when I boot the board.

This would define it only in the default environment (and doing this is
strongly deprecated and will never be accepted for mainline), but it
does not influence your current environment settings.

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
Cigarette, n.: A fire at one end, a fool at the other, and a  bit  of
tobacco in between.

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

* [U-Boot] setting Ethernet address
  2014-03-16  8:06         ` Wolfgang Denk
@ 2014-03-16  8:35           ` Benedict Hewson
  0 siblings, 0 replies; 7+ messages in thread
From: Benedict Hewson @ 2014-03-16  8:35 UTC (permalink / raw)
  To: u-boot

On Sunday 16 Mar 2014 09:06:10 Wolfgang Denk wrote:


> 
> > I was wondering why if I try to set ethaddr as part of
> > CONFIG_EXTRA_ENV_SETTINGS it is not there when I boot the board.
> 
> This would define it only in the default environment (and doing this is
> strongly deprecated and will never be accepted for mainline), but it
> does not influence your current environment settings.

Ok, good. I was just wondering if I was doing something wrong. I will go 
through the rest of the code and check to make sure it is suitable and then 
submit a patch for the board.

many thanks
Ben

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

end of thread, other threads:[~2014-03-16  8:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14 18:29 [U-Boot] setting Ethernet address Benedict Hewson
2014-03-14 18:52 ` Fabio Estevam
2014-03-15  7:08   ` Benedict Hewson
2014-03-15 19:59     ` Fabio Estevam
2014-03-16  7:00       ` Benedict Hewson
2014-03-16  8:06         ` Wolfgang Denk
2014-03-16  8:35           ` Benedict Hewson

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