From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support
Date: Mon, 11 May 2009 17:29:25 -0700 [thread overview]
Message-ID: <4A08C2E5.9000709@gmail.com> (raw)
In-Reply-To: <1242023969-13542-2-git-send-email-plagnioj@jcrosoft.com>
Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Ben Warren <biggerbadderben@gmail.com>
> Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
> ---
> drivers/net/macb.c | 23 +++++++++++++++++------
> 1 files changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 6de0a04..a339730 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -404,12 +404,25 @@ static int macb_phy_init(struct macb_device *macb)
> }
> }
>
> -static int macb_init(struct eth_device *netdev, bd_t *bd)
> +static int macb_set_hw_enetaddr(struct eth_device *netdev, bd_t *bd)
> {
> struct macb_device *macb = to_macb(netdev);
> - unsigned long paddr;
> u32 hwaddr_bottom;
> u16 hwaddr_top;
> +
> + /* set hardware address */
> + hwaddr_bottom = cpu_to_le32(*((u32 *)netdev->enetaddr));
> + macb_writel(macb, SA1B, hwaddr_bottom);
> + hwaddr_top = cpu_to_le16(*((u16 *)(netdev->enetaddr + 4)));
> + macb_writel(macb, SA1T, hwaddr_top);
> +
> + return 0;
> +}
> +
> +static int macb_init(struct eth_device *netdev, bd_t *bd)
> +{
> + struct macb_device *macb = to_macb(netdev);
> + unsigned long paddr;
> int i;
>
> /*
> @@ -439,10 +452,7 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
> macb_writel(macb, TBQP, macb->tx_ring_dma);
>
> /* set hardware address */
> - hwaddr_bottom = cpu_to_le32(*((u32 *)netdev->enetaddr));
> - macb_writel(macb, SA1B, hwaddr_bottom);
> - hwaddr_top = cpu_to_le16(*((u16 *)(netdev->enetaddr + 4)));
> - macb_writel(macb, SA1T, hwaddr_top);
> + macb_set_hw_enetaddr(netdev, bd);
>
> /* choose RMII or MII mode. This depends on the board */
> #ifdef CONFIG_RMII
> @@ -521,6 +531,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr)
> netdev->halt = macb_halt;
> netdev->send = macb_send;
> netdev->recv = macb_recv;
> + netdev->set_hw_enetaddr = macb_set_hw_enetaddr;
>
NAK, since this function pointer doesn't exist due to NAK'ing of part 1
regards,
Ben
next prev parent reply other threads:[~2009-05-12 0:29 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-11 6:39 [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 6:39 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 6:39 ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 6:39 ` [U-Boot] [PATCH 4/4] at91/macb: remove reset_phy callback Jean-Christophe PLAGNIOL-VILLARD
2009-05-12 0:31 ` Ben Warren
2009-05-11 18:02 ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Mike Frysinger
2009-05-11 23:58 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-12 0:37 ` Mike Frysinger
2009-05-12 0:30 ` Ben Warren
2009-05-11 9:13 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Haavard Skinnemoen
2009-05-12 0:29 ` Ben Warren [this message]
2009-05-11 7:48 ` [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Mike Frysinger
2009-05-11 12:08 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 13:26 ` Wolfgang Denk
2009-05-11 14:24 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 16:01 ` Wolfgang Denk
2009-05-11 16:30 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 16:24 ` Mike Frysinger
2009-05-11 16:37 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 16:56 ` Mike Frysinger
2009-05-12 0:04 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-12 0:36 ` Mike Frysinger
2009-05-12 8:48 ` Detlev Zundel
2009-05-12 12:26 ` Mike Frysinger
2009-05-12 14:18 ` Detlev Zundel
2009-05-12 16:21 ` Daniel Stenberg
2009-05-12 22:06 ` Mike Frysinger
2009-05-13 8:41 ` Detlev Zundel
2009-05-13 18:07 ` Mike Frysinger
2009-05-15 14:42 ` Detlev Zundel
2009-05-12 16:59 ` Scott Wood
2009-05-13 8:39 ` Detlev Zundel
2009-05-12 17:02 ` Scott Wood
2009-05-11 17:49 ` Wolfgang Denk
2009-05-11 17:24 ` Mike Frysinger
2009-05-11 17:54 ` Wolfgang Denk
2009-05-12 0:28 ` Ben Warren
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=4A08C2E5.9000709@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.