public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net: ll_temac: Add LL TEMAC driver to u-boot
Date: Mon, 29 Aug 2011 15:33:02 -0400	[thread overview]
Message-ID: <201108291533.03038.vapier@gentoo.org> (raw)
In-Reply-To: <1314617652-19292-1-git-send-email-monstr@monstr.eu>

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 ?

> +#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 "]"

> +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(&regs->lsw0)
and you don't need these two helpers

> +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

> +int xilinx_ll_temac_initialize(bd_t *bis, int base_addr)

the register base address really should be "unsigned long" and not "int"
-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/20110829/063fce3d/attachment.pgp 

  reply	other threads:[~2011-08-29 19:33 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 [this message]
2011-08-31  6:26   ` Michal Simek

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=201108291533.03038.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --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