From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Blackfin: bfin_mac: hook up new write_hwaddr function
Date: Tue, 27 Apr 2010 11:33:09 -0700 [thread overview]
Message-ID: <4BD72DE5.9030808@gmail.com> (raw)
In-Reply-To: <1272392128-13333-1-git-send-email-vapier@gentoo.org>
Hi Mike,
On 4/27/2010 11:15 AM, Mike Frysinger wrote:
> Signed-off-by: Mike Frysinger<vapier@gentoo.org>
> ---
> drivers/net/bfin_mac.c | 28 +++++++++++++++-------------
> drivers/net/bfin_mac.h | 3 +--
> 2 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
> index ec45b63..720e126 100644
> --- a/drivers/net/bfin_mac.c
> +++ b/drivers/net/bfin_mac.c
> @@ -106,6 +106,7 @@ int bfin_EMAC_initialize(bd_t *bis)
> dev->halt = bfin_EMAC_halt;
> dev->send = bfin_EMAC_send;
> dev->recv = bfin_EMAC_recv;
> + dev->write_hwaddr = bfin_EMAC_setup_addr;
>
> eth_register(dev);
>
> @@ -303,6 +304,19 @@ static int bfin_miiphy_init(struct eth_device *dev, int *opmode)
> return 0;
> }
>
> +static int bfin_EMAC_setup_addr(struct eth_device *dev)
> +{
> + *pEMAC_ADDRLO =
> + dev->enetaddr[0] |
> + dev->enetaddr[1]<< 8 |
> + dev->enetaddr[2]<< 16 |
> + dev->enetaddr[3]<< 24;
> + *pEMAC_ADDRHI =
> + dev->enetaddr[4] |
> + dev->enetaddr[5]<< 8;
> + return 0;
> +}
> +
> static int bfin_EMAC_init(struct eth_device *dev, bd_t *bd)
> {
> u32 opmode;
> @@ -318,7 +332,7 @@ static int bfin_EMAC_init(struct eth_device *dev, bd_t *bd)
> return -1;
>
> /* Initialize EMAC address */
> - bfin_EMAC_setup_addr(dev->enetaddr);
> + bfin_EMAC_setup_addr(dev);
>
Are you sure you still want to program it on every init() call? There's
nothing wrong with that, BTW...
regards,
Ben
next prev parent reply other threads:[~2010-04-27 18:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-27 18:15 [U-Boot] [PATCH] Blackfin: bfin_mac: hook up new write_hwaddr function Mike Frysinger
2010-04-27 18:33 ` Ben Warren [this message]
2010-04-27 18:42 ` Mike Frysinger
2010-04-27 18:46 ` Ben Warren
2010-04-27 19:32 ` Mike Frysinger
2010-04-27 20:07 ` Ben Warren
2010-04-27 20:24 ` Mike Frysinger
2010-04-30 12:40 ` Detlev Zundel
2010-04-30 13:10 ` Mike Frysinger
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=4BD72DE5.9030808@gmail.com \
--to=biggerbadderben@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.