[U-Boot] [PATCH v3 03/11] net: add Faraday FTMAC110 10/100Mbps ethernet support

Tom Rini trini at ti.com
Thu May 2 18:03:39 CEST 2013


On Fri, Apr 26, 2013 at 04:02:32PM +0800, Kuo-Jung Su wrote:

> From: Kuo-Jung Su <dantesu at faraday-tech.com>
[snip]
> +		| (phyaddr << PHYCR_ADDR_SHIFT)
> +		| (phyreg  << PHYCR_REG_SHIFT)
> +		| 0x30000000;

Magic number.

> +
> +	writel(tmp, &regs->phycr);
> +
> +	for (ts = get_timer(0); get_timer(ts) < 1000; ) {

Please define a TIMEOUT and use that insteadof 1000 all the time.

[snip]
> +	/* interrupt at every packet transmit/receive */
> +	writel(0x00001010, &regs->itc);
> +	/* tx/rx poll interval=5.12us; rx_poll_cnt=1 */
> +	writel(0x00000001, &regs->aptc);
> +	/* rx fifo: high=1536, low=512 */
> +	writel(0x00000390, &regs->dblac);
> +	/* clear all interrupt status */
> +	writel(0x000003FF, &regs->isr);

More magic numbers.  Please fix globally.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130502/4b731b9a/attachment.pgp>


More information about the U-Boot mailing list