From: Michal Simek <monstr@monstr.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net: ll_temac: Add LL TEMAC driver to u-boot
Date: Wed, 31 Aug 2011 08:26:30 +0200 [thread overview]
Message-ID: <4E5DD416.4060300@monstr.eu> (raw)
In-Reply-To: <201108291533.03038.vapier@gentoo.org>
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
prev parent reply other threads:[~2011-08-31 6:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 11:34 [U-Boot] [PATCH] net: ll_temac: Add LL TEMAC driver to u-boot Michal Simek
2011-08-29 19:33 ` Mike Frysinger
2011-08-31 6:26 ` Michal Simek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E5DD416.4060300@monstr.eu \
--to=monstr@monstr.eu \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox