[U-Boot] [PATCH] Blackfin: bfin_mac: hook up new write_hwaddr function

Ben Warren biggerbadderben at gmail.com
Tue Apr 27 20:33:09 CEST 2010


Hi Mike,

On 4/27/2010 11:15 AM, Mike Frysinger wrote:
> Signed-off-by: Mike Frysinger<vapier at gentoo.org>
> ---
>   drivers/net/bfin_mac.c |   28 +++++++++++++++-------------
>   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);
>    
Are you sure you still want to program it on every init() call?  There's 
nothing wrong with that, BTW...

regards,
Ben


More information about the U-Boot mailing list