smc911x: write back the manually set MAC address
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> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
parent
3bc8556f9b
commit
2c0234fa79
1 changed files with 7 additions and 2 deletions
|
@ -41,8 +41,13 @@ static int smx911x_handle_mac_address(bd_t *bd)
|
||||||
unsigned long addrh, addrl;
|
unsigned long addrh, addrl;
|
||||||
uchar m[6];
|
uchar m[6];
|
||||||
|
|
||||||
|
if (eth_getenv_enetaddr("ethaddr", m)) {
|
||||||
/* if the environment has a valid mac address then use it */
|
/* if the environment has a valid mac address then use it */
|
||||||
if (!eth_getenv_enetaddr("ethaddr", m)) {
|
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 */
|
/* if not, try to get one from the eeprom */
|
||||||
addrh = smc911x_get_mac_csr(ADDRH);
|
addrh = smc911x_get_mac_csr(ADDRH);
|
||||||
addrl = smc911x_get_mac_csr(ADDRL);
|
addrl = smc911x_get_mac_csr(ADDRL);
|
||||||
|
|
Loading…
Reference in a new issue