[U-Boot] [PATCH] Add support Asix's AX88783 ethernet chip v1.00

Mike Frysinger vapier at gentoo.org
Tue Feb 15 09:15:27 CET 2011


On Friday, February 04, 2011 14:56:42 Joe Xue wrote:
> +static int ax88783_init(struct eth_device *dev, bd_t * bd)
> +{
> +	...
> +	/* set mac address*/
> +	mactmp[0] = dev->enetaddr[5];
> +	mactmp[1] = dev->enetaddr[4];
> +	mactmp[2] = dev->enetaddr[3];
> +	mactmp[3] = dev->enetaddr[2];
> +	writel(*mac, &reg->p0mac0);
> +
> +	mactmp[0] = dev->enetaddr[1];
> +	mactmp[1] = dev->enetaddr[0];
> +	writel(*mac, &reg->p0mac1);
> +
> +	/* write mac to forward entry */
> +	mactmp[0] = dev->enetaddr[3];
> +	mactmp[1] = dev->enetaddr[2];
> +	mactmp[2] = dev->enetaddr[1];
> +	mactmp[3] = dev->enetaddr[0];
> +	writel(*mac, &reg->ftdata);
> +
> +	tmp = dev->enetaddr[4] | (dev->enetaddr[5]<<8) | \
> +	      FTCMD_FT_PORT(0x2) | FTCMD_FT_STATIC | \
> +	      FTCMD_WRITE_FT;
> +	writel(tmp, &reg->ftcmd);

implement eth_device->write_hwaddr rather than inlining the code in the init
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110215/5a523bd7/attachment.pgp 


More information about the U-Boot mailing list