From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1OkvJd-0000gR-58 for barebox@lists.infradead.org; Mon, 16 Aug 2010 08:45:10 +0000 Date: Mon, 16 Aug 2010 10:45:06 +0200 From: Sascha Hauer Message-ID: <20100816084506.GJ27749@pengutronix.de> References: <1da6b4f3c4cf5edd1634d6ea7e0516b981fb7613.1281877781.git.baruch@tkos.co.il> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1da6b4f3c4cf5edd1634d6ea7e0516b981fb7613.1281877781.git.baruch@tkos.co.il> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 5/5] fec: add support for IIM stored mac address To: Baruch Siach Cc: barebox@lists.infradead.org On Sun, Aug 15, 2010 at 04:39:28PM +0300, Baruch Siach wrote: > 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. This needs to be ifdeffed because this define is not present for !i.MX25. Sascha > > Signed-off-by: Baruch Siach > --- > 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 f8908f2..ddd3e04 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 > > #define IIM_BANK_SIZE 32 /* excluding alignment padding for each row */ > #define IIM_BANK0_BASE (IMX_IIM_BASE + 0x800) > 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 > #include > #include > +#include > #include > > #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 > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox