mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
net: smc911x: Automatically Update ethaddr with MAC
The ethernet controller can read the MAC from EEPROM and display it, but if ethaddr is not set, the ethernet is still unavailable. This patch checks will automatically set the MAC address if it has not already been set. Signed-off-by: Adam Ford <aford173@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
66e036bab5
commit
387cbf096e
1 changed files with 3 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <env.h>
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
#include <net.h>
|
||||
|
@ -185,6 +186,8 @@ static void smc911x_handle_mac_address(struct smc911x_priv *priv)
|
|||
smc911x_set_mac_csr(priv, ADDRH, addrh);
|
||||
|
||||
printf(DRIVERNAME ": MAC %pM\n", m);
|
||||
if (!env_get("ethaddr"))
|
||||
env_set("ethaddr", (const char *)m);
|
||||
}
|
||||
|
||||
static bool smc911x_read_mac_address(struct smc911x_priv *priv)
|
||||
|
|
Loading…
Reference in a new issue