davinci_emac: davinci_eth_set_mac_addr to ->write_hwaddr
authorBen Gardiner <bengardiner@nanometrics.ca>
Thu, 23 Sep 2010 13:58:43 +0000 (09:58 -0400)
committerBen Warren <biggerbadderben@gmail.com>
Tue, 12 Oct 2010 06:07:17 +0000 (23:07 -0700)
commit7b37a27e14975f32528552deed453b56a4149818
tree97b76f279c64ac3be9b186060e4aab0e969fcc53
parent042272a6f2fce3bf610a84cbfde3676b53c0d8dd
davinci_emac: davinci_eth_set_mac_addr to ->write_hwaddr

This patch proposes to migrate the davinci_emac driver to using the
eth_device->write_hwaddr function pointer as suggested by Ben Warren.

All the davinci boards had the behaviour, prior to this patch, of
sync'ing the environment variable enetaddr with the MAC address read
from non-volatile storage on boot -- when the two locations disagreed,
the environment variable value took precendence. This patch keeps the
same behaviour but lets eth_initialize take care of it.

This patch refactors davinci_emac setup in the boards so that the MAC
address is read from non-volatile storage into the environment variable
and then the environment variable value is use in eth_intialize. The
only exception is the direct call to davinci_eth_set_mac_addr made by
the da830evm board init which was changed into an assignment of the
enetaddr field.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Tested-by: Nick Thompson <nick.thompson@ge.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
arch/arm/include/asm/arch-davinci/emac_defs.h
arch/arm/lib/board.c
board/davinci/common/misc.c
board/davinci/common/misc.h
board/davinci/da8xxevm/da830evm.c
board/davinci/dm365evm/dm365evm.c
board/davinci/dvevm/dvevm.c
board/davinci/sffsdr/sffsdr.c
board/davinci/sonata/sonata.c
drivers/net/davinci_emac.c