From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] sh: mac address through private data for sh_eth on ms7724se
Date: Tue, 27 Oct 2009 10:47:34 +0000 [thread overview]
Message-ID: <20091027104734.26330.25913.sendpatchset@rxone.opensource.se> (raw)
In-Reply-To: <20091026104437.25084.57539.sendpatchset@rxone.opensource.se>
From: Magnus Damm <damm@opensource.se>
Convert the ms7724se board code to pass the mac
address to the sh_eth driver using platform data.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
This depends on the sh_eth platform data mac patch.
arch/sh/boards/mach-se/7724/setup.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
--- 0001/arch/sh/boards/mach-se/7724/setup.c
+++ work/arch/sh/boards/mach-se/7724/setup.c 2009-10-27 18:07:05.000000000 +0900
@@ -507,7 +507,7 @@ static int __init sh_eth_is_eeprom_ready
static void __init sh_eth_init(void)
{
int i;
- u16 mac[3];
+ u16 mac;
/* check EEPROM status */
if (!sh_eth_is_eeprom_ready())
@@ -521,16 +521,10 @@ static void __init sh_eth_init(void)
if (!sh_eth_is_eeprom_ready())
return;
- mac[i] = ctrl_inw(EEPROM_DATA);
- mac[i] = ((mac[i] & 0xFF) << 8) | (mac[i] >> 8); /* swap */
+ mac = ctrl_inw(EEPROM_DATA);
+ sh_eth_plat.mac_addr[i << 1] = mac & 0xff;
+ sh_eth_plat.mac_addr[(i << 1) + 1] = mac >> 8;
}
-
- /* reset sh-eth */
- ctrl_outl(0x1, SH_ETH_ADDR + 0x0);
-
- /* set MAC addr */
- ctrl_outl(((mac[0] << 16) | (mac[1])), SH_ETH_MAHR);
- ctrl_outl((mac[2]), SH_ETH_MALR);
}
#define SW4140 0xBA201000
next prev parent reply other threads:[~2009-10-27 10:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-26 10:44 [PATCH] sh: mac address through private data for sh_eth on ecovec24 Magnus Damm
2009-10-27 10:47 ` Magnus Damm [this message]
2009-10-28 0:20 ` [PATCH] sh: mac address through private data for sh_eth on ms7724se Paul Mundt
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=20091027104734.26330.25913.sendpatchset@rxone.opensource.se \
--to=magnus.damm@gmail.com \
--cc=linux-sh@vger.kernel.org \
/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.