[U-Boot] [PATCH] x86: galileo: Define mac addresses for the on-chip ethernet ports

Bin Meng bmeng.cn at gmail.com
Wed Apr 22 02:20:44 CEST 2015


Hi Joe,

On Wed, Apr 22, 2015 at 3:41 AM, Joe Hershberger
<joe.hershberger at gmail.com> wrote:
> Hi Bin Meng,
>
> On Tue, Apr 21, 2015 at 8:54 AM, Simon Glass <sjg at chromium.org> wrote:
>> Hi Bin,
>>
>> On 20 April 2015 at 23:05, Bin Meng <bmeng.cn at gmail.com> wrote:
>>> Not like other x86 chipset, there is no EEPROM for the ethernet
>>> controller on the Intel Quark SoC to retreive the mac address
>>> after power up. With pre-defined mac addresses, U-Boot boots up
>>> and will not show "Error: dwmac.90006000 address not set" message.
>>>
>>> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
>>> ---
>>>
>>>  include/configs/galileo.h | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/include/configs/galileo.h b/include/configs/galileo.h
>>> index d4d0eb3..961d087 100644
>>> --- a/include/configs/galileo.h
>>> +++ b/include/configs/galileo.h
>>> @@ -62,6 +62,8 @@
>>>  #define CONFIG_DESIGNWARE_ETH
>>>  #define CONFIG_DW_ALTDESCRIPTOR
>>>  #define CONFIG_PHYLIB
>>> +#define CONFIG_ETHADDR         00:02:b3:00:00:00
>>> +#define CONFIG_ETH1ADDR                00:02:b3:00:00:01
>>
>> I recall this coming up before with another board - we are not
>> supposed to set a default MAC address since it may create inexplicable
>> conflicts on the network if an org two boards on the same network one
>> day. Can you just set an environment variable?

There are lots of boards which have CONFIG_ETHADDR defined in the
board configuration files. Do you think we need cleam them up?

include/configs/blackstamp.h:81:/* #define CONFIG_ETHADDR
 02:80:ad:20:31:b8 */
include/configs/grsim.h:254:#define CONFIG_ETHADDR   00:00:7a:cc:00:12
include/configs/bct-brettl2.h:77:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/bf533-stamp.h:72:/* #define CONFIG_ETHADDR
02:80:ad:20:31:b8 */
include/configs/stxgp3.h:16: * search for
CONFIG_ETHADDR,CONFIG_SERVERIP,etc in this file
include/configs/stxgp3.h:348:#define CONFIG_ETHADDR
00:e0:0c:07:9b:8a
include/configs/cobra5272.h:177:#define CONFIG_ETHADDR
00:00:00:00:00:09        /* default ethernet MAC addr. */
include/configs/pb1x00.h:34:#define CONFIG_ETHADDR
DE:AD:BE:EF:01:01    /* Ethernet address */
include/configs/M54418TWR.h:116:#define CONFIG_ETHADDR
00:e0:0c:bc:e5:60
include/configs/dbau1x00.h:40:#define CONFIG_ETHADDR
DE:AD:BE:EF:01:01    /* Ethernet address */
include/configs/bf561-acvilon.h:96:/* #define CONFIG_ETHADDR
                 02:80:ad:20:31:e8 */
include/configs/galileo.h:65:#define CONFIG_ETHADDR
00:02:b3:00:00:00
include/configs/cm-bf527.h:87:/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */
include/configs/M5329EVB.h:91:# define CONFIG_ETHADDR   00:e0:0c:bc:e5:60
include/configs/sbc8641d.h:17: * search for CONFIG_ETHADDR,
CONFIG_SERVERIP, etc in this file.
include/configs/sbc8641d.h:533:#define CONFIG_ETHADDR   02:E0:0C:00:00:01
include/configs/bf527-ezkit.h:87:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/MPC8541CDS.h:421:#define CONFIG_ETHADDR   00:E0:0C:00:00:FD
include/configs/bf537-stamp.h:69:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/zeus.h:299:#define CONFIG_ETHADDR
50:00:00:00:06:00
include/configs/br4.h:73:/* #define CONFIG_ETHADDR      5c:38:1a:80:a7:00 */
include/configs/M5373EVB.h:91:# define CONFIG_ETHADDR   00:e0:0c:bc:e5:60
include/configs/MPC8641HPCN.h:13: * search for CONFIG_ETHADDR,
CONFIG_SERVERIP, etc in this file.
include/configs/MPC8641HPCN.h:683:#define CONFIG_ETHADDR
00:E0:0C:00:00:01
include/configs/MPC8560ADS.h:15: * search for CONFIG_ETHADDR,
CONFIG_SERVERIP, etc in this file.
include/configs/MPC8560ADS.h:450:#define CONFIG_ETHADDR   00:E0:0C:00:00:FD
include/configs/M5272C3.h:93:#  define CONFIG_ETHADDR   00:e0:0c:bc:e5:60
include/configs/gr_xc3s_1500.h:231:#define CONFIG_ETHADDR   00:00:7a:cc:00:12
include/configs/MPC8568MDS.h:441:#define CONFIG_ETHADDR   00:E0:0C:00:00:FD
include/configs/bf537-pnav.h:69:/* #define CONFIG_ETHADDR
02:80:ad:24:21:18 */
include/configs/M54455EVB.h:86:#        define CONFIG_ETHADDR
 00:e0:0c:bc:e5:60
include/configs/blackvme.h:90:/* # define CONFIG_ETHADDR
ff:ee:dd:cc:bb:aa */
include/configs/MPC8548CDS.h:546:#define CONFIG_ETHADDR  00:E0:0C:00:00:FD
include/configs/stxssa.h:16: * search for
CONFIG_ETHADDR,CONFIG_SERVERIP,etc in this file
include/configs/stxssa.h:383:#define CONFIG_ETHADDR      00:e0:0c:07:9b:8a
include/configs/grsim_leon2.h:252:#define CONFIG_ETHADDR   00:00:7a:cc:00:12
include/configs/M5235EVB.h:98:# define CONFIG_ETHADDR   00:e0:0c:bc:e5:60
include/configs/tcm-bf518.h:70:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/sbc405.h:105:#define CONFIG_ETHADDR
DE:AD:BE:EF:01:01       /* Ethernet address     */
include/configs/microblaze-generic.h:353:#define        CONFIG_ETHADDR
         00:E0:0C:00:00:FD
include/configs/uniphier.h:212:#define CONFIG_ETHADDR
 00:21:83:24:00:00
include/configs/bf538f-ezkit.h:67:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/M5208EVBE.h:77:#        define CONFIG_ETHADDR
00:e0:0c:bc:e5:60
include/configs/cm-bf561.h:71:/* #define CONFIG_ETHADDR 02:80:ad:20:31:cf */
include/configs/M54451EVB.h:80:#        define CONFIG_ETHADDR
 00:e0:0c:bc:e5:60
include/configs/MPC8544DS.h:452:#define CONFIG_ETHADDR  00:E0:0C:02:00:FD
include/configs/motionpro.h:88:#define CONFIG_ETHADDR
00:50:C2:40:10:00
include/configs/inka4x0.h:113:#define   CONFIG_ETHADDR
00:a0:a4:03:00:00
include/configs/cm-bf537e.h:75:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/MPC8572DS.h:665:#define CONFIG_ETHADDR  00:E0:0C:02:00:FD
include/configs/cm-bf548.h:80:/* #define CONFIG_ETHADDR 02:80:ad:24:31:91 */
include/configs/MPC8610HPCD.h:303:#define CONFIG_ETHADDR   00:E0:0C:00:00:01
include/configs/tcm-bf537.h:75:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/sbc8548.h:588:#define CONFIG_ETHADDR     02:E0:0C:00:00:FD
include/configs/M5475EVB.h:78:# define CONFIG_ETHADDR   00:e0:0c:bc:e5:60
include/configs/M5475EVB.h:138:#        define CONFIG_ETHADDR
00:e0:0c:bc:e5:60
include/configs/gr_ep2s60.h:272:#define CONFIG_ETHADDR   00:00:7a:cc:00:13
include/configs/xaeniax.h:73:#define CONFIG_ETHADDR
08:00:3e:26:0a:5b
include/configs/pr1.h:73:/* #define CONFIG_ETHADDR      02:80:ad:20:31:e8 */
include/configs/MPC8536DS.h:723:#define CONFIG_ETHADDR  00:E0:0C:02:00:FD
include/configs/bf537-srv1.h:90:/* #define CONFIG_ETHADDR
02:80:ad:20:31:42 */
include/configs/M5282EVB.h:79:# define CONFIG_ETHADDR   00:e0:0c:bc:e5:60
include/configs/bf526-ezbrd.h:89:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/ibf-dsp561.h:68:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/bf561-ezkit.h:68:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/bf548-ezkit.h:77:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/MPC8540ADS.h:15: * search for CONFIG_ETHADDR,
CONFIG_SERVERIP, etc in this file.
include/configs/MPC8540ADS.h:409:#define CONFIG_ETHADDR   00:E0:0C:00:00:FD
include/configs/M5485EVB.h:78:# define CONFIG_ETHADDR   00:e0:0c:bc:e5:60
include/configs/work_92105.h:187:#define CONFIG_ETHADDR
 00:12:B4:00:AF:FE
include/configs/bf533-ezkit.h:79:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/cm-bf537u.h:73:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/MPC8555CDS.h:419:#define CONFIG_ETHADDR   00:E0:0C:00:00:FD
include/configs/sequoia.h:110:#define   CONFIG_ETHADDR
4a:56:49:22:3e:43
include/configs/scb9328.h:53:#define CONFIG_ETHADDR
80:81:82:83:84:85
include/configs/cm-bf533.h:70:/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */
include/configs/gr_cpci_ax2000.h:283:#define CONFIG_ETHADDR   00:00:7a:cc:00:13
include/configs/M53017EVB.h:97:#        define CONFIG_ETHADDR
00:e0:0c:bc:e5:60
include/configs/bf518f-ezbrd.h:91:/* #define CONFIG_ETHADDR
02:80:ad:20:31:e8 */
include/configs/bf537-minotaur.h:90:/* #define CONFIG_ETHADDR
02:80:ad:20:31:42 */
include/env_default.h:52:#ifdef CONFIG_ETHADDR
include/env_default.h:53:       "ethaddr="
__stringify(CONFIG_ETHADDR)     "\0

> Simon is correct here. You should simply set it in your environment on
> your board. Another option that we tend to frown on, but is allowed,
> is to call net_random_ethaddr() from your board init.
>

I see net_random_ethaddr() is not used consistently. Lots of boards
call this API in their borad init but there are two drivers call this
API in the driver. I think we need move them all to board init?

board/bf527-ezkit/bf527-ezkit.c:49:             net_random_ethaddr(mac_addr);
board/bf537-minotaur/bf537-minotaur.c:29:       net_random_ethaddr(mac_addr);
board/tcm-bf537/tcm-bf537.c:34: net_random_ethaddr(enetaddr);
board/bf526-ezbrd/bf526-ezbrd.c:47:             net_random_ethaddr(mac_addr);
board/bct-brettl2/bct-brettl2.c:35:     net_random_ethaddr(mac_addr);
board/buffalo/lsxl/lsxl.c:235:          net_random_ethaddr(enetaddr);
board/bf537-stamp/bf537-stamp.c:50:             net_random_ethaddr(mac_addr);
board/dnp5370/dnp5370.c:57:             net_random_ethaddr(mac_addr);
board/cm-bf537u/cm-bf537u.c:34: net_random_ethaddr(enetaddr);
board/bf518f-ezbrd/bf518f-ezbrd.c:50:           net_random_ethaddr(mac_addr);
board/tcm-bf518/tcm-bf518.c:49:         net_random_ethaddr(mac_addr);
board/bf537-pnav/bf537-pnav.c:29:       net_random_ethaddr(mac_addr);
board/cm-bf527/cm-bf527.c:48:           net_random_ethaddr(mac_addr);
board/cm-bf537e/cm-bf537e.c:34: net_random_ethaddr(enetaddr);
board/bf537-srv1/bf537-srv1.c:29:       net_random_ethaddr(mac_addr);
board/ip04/ip04.c:35:           net_random_ethaddr(enetaddr);
drivers/net/ftmac110.c:428:             net_random_ethaddr(dev->enetaddr);
drivers/net/dm9000x.c:348:              net_random_ethaddr(dev->enetaddr);
include/net.h:767: * net_random_ethaddr - Generate software assigned
random Ethernet address
include/net.h:773:static inline void net_random_ethaddr(uchar *addr)

And there is even one CONFIG_RANDOM_MACADDR used for this purpose.

board/buffalo/lsxl/lsxl.c:233:#ifdef CONFIG_RANDOM_MACADDR
drivers/net/dm9000x.c:346:#ifdef CONFIG_RANDOM_MACADDR
include/configs/lsxl.h:40:#define CONFIG_RANDOM_MACADDR

I think we should clean these all?

Regards,
Bin


More information about the U-Boot mailing list