[U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot
Michal Simek
monstr at monstr.eu
Thu Sep 1 08:52:02 CEST 2011
Mike Frysinger wrote:
> On Tuesday, August 30, 2011 08:05:19 Michal Simek wrote:
>> +static void setup_mac(struct eth_device *dev)
>> +{
>> + /* Set the MAC address */
>> + int val = ((dev->enetaddr[3] << 24) | (dev->enetaddr[2] << 16) |
>> + (dev->enetaddr[1] << 8) | (dev->enetaddr[0]));
>> + aximac_out32(dev->iobase, XAE_UAW0_OFFSET, val);
>> +
>> + val = (dev->enetaddr[5] << 8) | dev->enetaddr[4] ;
>> + val |= aximac_in32(dev->iobase, XAE_UAW1_OFFSET) &
>> + ~XAE_UAW1_UNICASTADDR_MASK;
>> + aximac_out32(dev->iobase, XAE_UAW1_OFFSET, val);
>> +}
>> +
>> +static int axiemac_init(struct eth_device *dev, bd_t * bis)
>> +{
>> + setup_mac(dev);
>
> pretty sure this should be dev->write_hwaddr
I expected it. The point is where dev->write_hwaddr is called.
I mean sequence is:
dev->write_hwaddr
u-boot network command
dev->init
If init reset device include setup mac then this sequence can't work.
But not case for my MAC - I can use it.
>
>> +int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr, int
>> dma_addr)
>
> you got base_addr right, but forgot to change dma_addr to unsigned long too ;)
Fixed.
Michal
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
More information about the U-Boot
mailing list