From: Baruch Siach <baruch@tkos.co.il>
To: barebox@lists.infradead.org
Subject: [PATCH v2 2/2] fec: add support for IIM stored mac address
Date: Thu, 12 Aug 2010 11:35:05 +0300 [thread overview]
Message-ID: <ba83c1b01580c57b7ec4ac20722d09331c93515b.1281601710.git.baruch@tkos.co.il> (raw)
In-Reply-To: <20100810070909.GB10920@game.jcrosoft.org>
In-Reply-To: <5a5cd75e51961a57b99c0727faa8b3eaa619b943.1281601710.git.baruch@tkos.co.il>
This patch adds support for i.MX25 only, because that's what I have. Extending
this to other i.MX chip should be trivial, given the right IIM_MAC_ADDR define.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
Changes from v1:
Add mach/generic.h include for the cpu_is_mx25 macro.
arch/arm/mach-imx/include/mach/imx25-regs.h | 1 +
drivers/net/fec_imx.c | 11 +++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-imx/include/mach/imx25-regs.h b/arch/arm/mach-imx/include/mach/imx25-regs.h
index 7c2b5f9..f3da7b5 100644
--- a/arch/arm/mach-imx/include/mach/imx25-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx25-regs.h
@@ -142,6 +142,7 @@
/* IIM fuse definitions */
#define IIM_UID 0x820
+#define IIM_MAC_ADDR 0x868
#endif /* __ASM_ARCH_MX25_REGS_H */
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 40a7543..c29119c 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -32,6 +32,7 @@
#include <mach/imx-regs.h>
#include <clock.h>
#include <mach/clock.h>
+#include <mach/generic.h>
#include <xfuncs.h>
#include "fec_imx.h"
@@ -235,6 +236,16 @@ static void fec_rbd_clean(int last, struct buffer_descriptor *pRbd)
static int fec_get_hwaddr(struct eth_device *dev, unsigned char *mac)
{
+ int i;
+
+ if (cpu_is_mx25()) {
+ /* get MAC address from the IMM fusebox */
+ for (i = 0; i < 6; i++)
+ mac[i] = readb(IMX_IIM_BASE + IIM_MAC_ADDR + i*4);
+
+ return 0;
+ }
+
/* no eeprom */
return -1;
}
--
1.7.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2010-08-12 8:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-10 6:25 [PATCH 1/2] cmd: add fuse_blow/fuse_sense for the i.MX IIM fusebox Baruch Siach
2010-08-10 6:25 ` [PATCH 2/2] fec: add support for IIM stored mac address Baruch Siach
2010-08-10 7:09 ` [PATCH 1/2] cmd: add fuse_blow/fuse_sense for the i.MX IIM fusebox Jean-Christophe PLAGNIOL-VILLARD
2010-08-12 8:34 ` Baruch Siach
2010-08-12 8:35 ` [PATCH v2 " Baruch Siach
2010-08-12 8:35 ` Baruch Siach [this message]
2010-08-12 9:06 ` Sascha Hauer
2010-08-12 9:27 ` Baruch Siach
2010-08-12 12:04 ` Sascha Hauer
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=ba83c1b01580c57b7ec4ac20722d09331c93515b.1281601710.git.baruch@tkos.co.il \
--to=baruch@tkos.co.il \
--cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox