[U-Boot] [PATCH] net: ll_temac: Add LL TEMAC driver to u-boot
Michal Simek
monstr at monstr.eu
Wed Aug 31 08:26:30 CEST 2011
Mike Frysinger wrote:
> On Monday, August 29, 2011 07:34:12 Michal Simek wrote:
>> --- /dev/null
>> +++ b/drivers/net/xilinx_ll_temac.c
>>
>> +#include <asm/processor.h>
>
> what do you need from this header ?
dcr for ppc.
>
>> +#ifdef SDMA_MODE
>> +static unsigned char tx_buffer[PKTSIZE_ALIGN ] __attribute((aligned(32)));
>> +#endif
>> +static unsigned char rx_buffer[PKTSIZE_ALIGN ] __attribute((aligned(32)));
>
> no space before that "]"
done.
>
>> +static inline void temac_out_be32(u32 addr, u32 offset, u32 val)
>> +{
>> + out_be32((u32 *)(addr + offset), val);
>> +}
>> +
>> +static inline u32 temac_in_be32(u32 addr, u32 offset)
>> +{
>> + return in_be32((u32 *)(addr + offset));
>> +}
>
> write a C struct describing the register layout, then your code can simply do:
> in_be32(®s->lsw0)
> and you don't need these two helpers
Agree that there is elegant way to fix it. Look at my v2.
>
>> +static int xps_ll_temac_addr_setup(struct eth_device *dev)
>> +{
>> + int val;
>> +
>> + /* set up unicast MAC address filter */
>> + val = ((dev->enetaddr[3] << 24) | (dev->enetaddr[2] << 16) |
>> + (dev->enetaddr[1] << 8) | (dev->enetaddr[0]));
>> + xps_ll_temac_indirect_set(dev, 0, UAW0, val);
>> + val = (dev->enetaddr[5] << 8) | dev->enetaddr[4] ;
>> + xps_ll_temac_indirect_set(dev, 0, UAW1, val);
>> +
>> + return 0;
>> +}
>
> this should be set to dev->write_hwaddr in the initialize func
done. Have to look at axi_ethernet version if possible to use it.
>
>> +int xilinx_ll_temac_initialize(bd_t *bis, int base_addr)
>
> the register base address really should be "unsigned long" and not "int"
Agree. Probably good to fix all network devices too.
Have sent v2 for ll_temac and the first version for axi_emac.
Thanks,
Michal
P.S.: Forget to send it yesterday.
--
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