diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-04-27 14:15:28 -0400 |
---|---|---|
committer | Ben Warren <biggerbadderben@gmail.com> | 2010-05-03 14:52:50 -0700 |
commit | 4324dc72df5879e5b614c4a3f326884723ede9b7 (patch) | |
tree | 7f485b3f8066bf54fa9b391fba276930ab9e317a | |
parent | 3ac9d6c650d94c51645efa446c1d914c5440990d (diff) | |
download | u-boot-imx-4324dc72df5879e5b614c4a3f326884723ede9b7.zip u-boot-imx-4324dc72df5879e5b614c4a3f326884723ede9b7.tar.gz u-boot-imx-4324dc72df5879e5b614c4a3f326884723ede9b7.tar.bz2 |
Blackfin: bfin_mac: hook up new write_hwaddr function
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
-rw-r--r-- | drivers/net/bfin_mac.c | 28 | ||||
-rw-r--r-- | drivers/net/bfin_mac.h | 3 |
2 files changed, 16 insertions, 15 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index ec45b63..720e126 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c @@ -106,6 +106,7 @@ int bfin_EMAC_initialize(bd_t *bis) dev->halt = bfin_EMAC_halt; dev->send = bfin_EMAC_send; dev->recv = bfin_EMAC_recv; + dev->write_hwaddr = bfin_EMAC_setup_addr; eth_register(dev); @@ -303,6 +304,19 @@ static int bfin_miiphy_init(struct eth_device *dev, int *opmode) return 0; } +static int bfin_EMAC_setup_addr(struct eth_device *dev) +{ + *pEMAC_ADDRLO = + dev->enetaddr[0] | + dev->enetaddr[1] << 8 | + dev->enetaddr[2] << 16 | + dev->enetaddr[3] << 24; + *pEMAC_ADDRHI = + dev->enetaddr[4] | + dev->enetaddr[5] << 8; + return 0; +} + static int bfin_EMAC_init(struct eth_device *dev, bd_t *bd) { u32 opmode; @@ -318,7 +332,7 @@ static int bfin_EMAC_init(struct eth_device *dev, bd_t *bd) return -1; /* Initialize EMAC address */ - bfin_EMAC_setup_addr(dev->enetaddr); + bfin_EMAC_setup_addr(dev); /* Initialize TX and RX buffer */ for (i = 0; i < PKTBUFSRX; i++) { @@ -376,18 +390,6 @@ static void bfin_EMAC_halt(struct eth_device *dev) } -void bfin_EMAC_setup_addr(uchar *enetaddr) -{ - *pEMAC_ADDRLO = - enetaddr[0] | - enetaddr[1] << 8 | - enetaddr[2] << 16 | - enetaddr[3] << 24; - *pEMAC_ADDRHI = - enetaddr[4] | - enetaddr[5] << 8; -} - ADI_ETHER_BUFFER *SetupRxBuffer(int no) { ADI_ETHER_FRAME_BUFFER *frmbuf; diff --git a/drivers/net/bfin_mac.h b/drivers/net/bfin_mac.h index 8f467a3..c731c17 100644 --- a/drivers/net/bfin_mac.h +++ b/drivers/net/bfin_mac.h @@ -60,7 +60,6 @@ static int bfin_EMAC_init(struct eth_device *dev, bd_t *bd); static void bfin_EMAC_halt(struct eth_device *dev); static int bfin_EMAC_send(struct eth_device *dev, volatile void *packet, int length); static int bfin_EMAC_recv(struct eth_device *dev); - -void bfin_EMAC_setup_addr(uchar *enetaddr); +static int bfin_EMAC_setup_addr(struct eth_device *dev); #endif |