[imx51evk ] no ethN device if ethaddr is not set in u-boot

Bug #652426 reported by John Stultz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro U-Boot
Fix Released
Medium
Unassigned
u-boot-linaro (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When installing u-boot on my imx51evk board (following the instructions here: http://www.imxdev.org/wiki/index.php?title=I.MX51EVK_u-boot ), I ran into an odd behavior. Where as with redboot, the kernel would load and ethernet would work fine, when booting the same kernel with u-boot, the fec driver would load and find the device, but no ethN device would show up.

After talking with AmitK, he suggested setting the ethaddr value before building u-boot, as seen here: http://paste.ubuntu.com/503446/

Once ethaddr is set in u-boot, the kernel boots and the ethN device is present. So linaro u-boot builds will need to make sure ethaddr value is set.

The complication here would be, if ethaddr is statically set in u-boot, it would cause problems if there are multiple boards on the same network with the same MAC addr. Either some unique value from the board itself should be used, or the linaro-media-create may need to have some way of providing a unique value that u-boot can use.

Tags: imx51evk
John Stultz (jstultz)
affects: linaro → u-boot-linaro
Revision history for this message
Shawn Guo (shawnguo) wrote :
Download full text (3.8 KiB)

The following patch is verified working on mx51evk to read FEC MAC address from i.mx fuse bank.

It consolidated the definition of iim_bank_area in iim_regs across i.mx family. As different i.mx SoC could have MAC bits defined in different fuse bank, it may be reasonable to consolidate iim_bank_area as one and use IIM_MAC as offset to address the MAC field, so that the same fec_get_hwaddr code can be shared across i.mx family.

From e68670542d01825006fa0eb3e11b22086f327eb3 Mon Sep 17 00:00:00 2001
From: Shawn Guo <email address hidden>
Date: Fri, 8 Oct 2010 19:11:48 +0800
Subject: [PATCH] Consolidate the ethaddr read from i.MX fuse

Signed-off-by: Shawn Guo <email address hidden>
---
 arch/arm/include/asm/arch-mx25/imx-regs.h | 10 +++-------
 arch/arm/include/asm/arch-mx27/imx-regs.h | 4 ++--
 arch/arm/include/asm/arch-mx51/imx-regs.h | 23 +++++++++++++++++++++++
 drivers/net/fec_mxc.c | 10 +---------
 4 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx25/imx-regs.h b/arch/arm/include/asm/arch-mx25/imx-regs.h
index f709bd8..35eb303 100644
--- a/arch/arm/include/asm/arch-mx25/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx25/imx-regs.h
@@ -128,12 +128,8 @@ struct iim_regs {
  u32 iim_prev;
  u32 iim_srev;
  u32 iim_prog_p;
- u32 res1[0x1f5];
- u32 iim_bank_area0[0x20];
- u32 res2[0xe0];
- u32 iim_bank_area1[0x20];
- u32 res3[0xe0];
- u32 iim_bank_area2[0x20];
+ u32 res[0x1f5];
+ u32 iim_bank_area[0x100 * 3];
 };
 #endif

@@ -311,6 +307,6 @@ struct iim_regs {
 #define WCR_WDE 0x04

 /* FUSE bank offsets */
-#define IIM0_MAC 0x1a
+#define IIM_MAC 0x1a

 #endif /* _IMX_REGS_H */
diff --git a/arch/arm/include/asm/arch-mx27/imx-regs.h b/arch/arm/include/asm/arch-mx27/imx-regs.h
index 6ecddaa..9fdd5c5 100644
--- a/arch/arm/include/asm/arch-mx27/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx27/imx-regs.h
@@ -203,7 +203,7 @@ struct iim_regs {
  u32 iim_scs2;
  u32 iim_scs3;
  u32 res[0x1F0];
- u32 iim_bank_area0[0x100];
+ u32 iim_bank_area[0x100 * 2];
 };
 #endif

@@ -513,7 +513,7 @@ struct iim_regs {
 #define IIM_ERR_PARITYE (1 << 1)

 /* Definitions for i.MX27 TO2 */
-#define IIM0_MAC 5
+#define IIM_MAC 5
 #define IIM0_SCC_KEY 11
 #define IIM1_SUID 1

diff --git a/arch/arm/include/asm/arch-mx51/imx-regs.h b/arch/arm/include/asm/arch-mx51/imx-regs.h
index 3887d3c..07a6e6d 100644
--- a/arch/arm/include/asm/arch-mx51/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx51/imx-regs.h
@@ -207,6 +207,10 @@
 #define BOARD_REV_1_0 0x0
 #define BOARD_REV_2_0 0x1

+/* FUSE */
+#define IMX_IIM_BASE (IIM_BASE_ADDR)
+#define IIM_MAC 0x109
+
 #ifndef __ASSEMBLY__

 struct clkctl {
@@ -256,6 +260,25 @@ struct weim {
  u32 cswcr2;
 };

+struct iim_regs {
+ u32 stat;
+ u32 statm;
+ u32 err;
+ u32 emask;
+ u32 fctl;
+ u32 ua;
+ u32 la;
+ u32 sdat;
+ u32 prev;
+ u32 srev;
+ u32 preg_p;
+ u32 scs0;
+ u32 scs1;
+ u32 scs2;
+ u32 scs3;
+ u32 res[0x1f1];
+ u32 iim_bank_area[0x100 * 4];
+};
 #endif /* __ASSEMBLER__*/

 #endif /* __ASM_ARCH_MXC_MX51_H__ */
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 050c0e1..e5a2376 100644
--- a/drivers/net/fec_mxc...

Read more...

Revision history for this message
John Stultz (jstultz) wrote :

This issue is still present in hwpack_linaro-imx51_20101115-0_armel_unsupported.tar.gz

Revision history for this message
Jason Liu (r64343) wrote : Re: [Bug 652426] Re: [imx51evk ] no ethN device if ethaddr is not set in u-boot

On Tue, Nov 16, 2010 at 5:43 AM, John Stultz <email address hidden> wrote:
> This issue is still present in hwpack_linaro-
> imx51_20101115-0_armel_unsupported.tar.gz
>
> --
> [imx51evk ] no ethN device if ethaddr is not set in u-boot
> https://bugs.launchpad.net/bugs/652426
> You received this bug notification because you are a member of Linaro
> Kernel Working Group, which is the registrant for Linaro U-Boot.
>
> Status in Linaro U-Boot: New
>
> Bug description:
> When installing u-boot on my imx51evk board (following the instructions here: http://www.imxdev.org/wiki/index.php?title=I.MX51EVK_u-boot ), I ran into an odd behavior.  Where as with redboot, the kernel would load and ethernet would work fine, when booting the same kernel with u-boot, the fec driver would load and find the device, but no ethN device would show up.
>
> After talking with AmitK, he suggested setting the ethaddr value before building u-boot, as seen here: http://paste.ubuntu.com/503446/
>
> Once ethaddr is set in u-boot, the kernel boots and the ethN device is present.  So linaro u-boot builds will need to make sure ethaddr value is set.
>
> The complication here would be, if ethaddr is statically set in u-boot, it would cause problems if there are multiple boards on >the same network with the same MAC addr.  Either some unique value from the board itself should be used, or the linaro->media-create may need to have some way of providing a unique value that u-boot can use.

The best solution is to get the MAC ADDR from FUSE. I have pushed on
fix for it and the patch is on u-boot-imx and awaiting for being
pulled by Wolfgang later.

commit 565e39c57769a45a5eaed5e4c86357e817cf64e1
Author: Liu Hui-R64343 <email address hidden>
Date: Thu Nov 18 23:45:55 2010 +0000

    imx: Get fec mac address from fuse

    The patch is to support getting FEC MAC address from fuse bank.

    Signed-off-by: Jason Liu <email address hidden>
    Tested-by: Stefano Babic <email address hidden>

>
>
>

Loïc Minier (lool)
affects: ubuntu → u-boot-linaro (Ubuntu)
tags: added: imx51evk
Changed in u-boot-linaro:
status: New → Incomplete
status: Incomplete → In Progress
importance: Undecided → Medium
Revision history for this message
John Rigby (jcrigby) wrote :

fixed in upstream v2010.12-rc3

Changed in u-boot-linaro:
status: In Progress → Fix Released
Changed in u-boot-linaro (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.