diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2014-11-18 11:34:58 +0100 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2014-11-18 12:37:44 +0100 |
commit | 5ce377d42e14fc2e7d9bbb1156697d9dbc3d664e (patch) | |
tree | 1d415eb11ace597f76bb544200740fb898563274 /board | |
parent | 7031ed747021815dd8303d8a70b8c070ba709c56 (diff) |
colibri_vf: calculate and set secondary MAC address
In order to support dual ethernet configurations, a second MAC
address is needed. Toradex assignes two addresses for each module,
one address is the serial number, and the second is the serial
number with an offset of 0x100000.
Diffstat (limited to 'board')
-rw-r--r-- | board/toradex/common/configblock.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/board/toradex/common/configblock.c b/board/toradex/common/configblock.c index bd76b845a83..825cb0c10f2 100644 --- a/board/toradex/common/configblock.c +++ b/board/toradex/common/configblock.c @@ -163,6 +163,17 @@ int read_trdx_cfg_block(void) if (!eth_getenv_enetaddr("ethaddr", ethaddr)) eth_setenv_enetaddr("ethaddr", cfg_block_ethaddr); +#ifdef CONFIG_TRDX_CFG_BLOCK_2ND_ETHADDR + if (!eth_getenv_enetaddr("eth1addr", ethaddr)) { + /* + * Secondary MAC address is allocated from a block + * 0x100000 higher then the first MAC address + */ + cfg_block_ethaddr[3] += 0x10; + eth_setenv_enetaddr("eth1addr", cfg_block_ethaddr); + } +#endif + return 0; } #endif /* CONFIG_TRDX_CFG_BLOCK */ |