public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6 1/1] imx: Get fec mac address from fuse
Date: Thu, 18 Nov 2010 14:38:01 +0100	[thread overview]
Message-ID: <4CE52C39.3050406@denx.de> (raw)
In-Reply-To: <1290080989-9101-1-git-send-email-r64343@freescale.com>

On 11/18/2010 12:49 PM, Jason Liu wrote:
> The patch is to support getting FEC MAC address from fuse bank.
> 
> Signed-off-by: Jason Liu <r64343@freescale.com>
> 

Hi Jason,

> diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h
> index 0b6249a..d618bca 100644
> --- a/arch/arm/include/asm/arch-mx5/imx-regs.h
> +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
> @@ -205,9 +205,13 @@
>  #define BOARD_REV_1_0           0x0
>  #define BOARD_REV_2_0           0x1
>  
> +#define IMX_IIM_BASE            (IIM_BASE_ADDR)
> +
>  #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
>  #include <asm/types.h>
>  
> +extern void imx_get_mac_from_fuse(unsigned char *mac);
> +
>  #define __REG(x)	(*((volatile u32 *)(x)))
>  #define __REG16(x)	(*((volatile u16 *)(x)))
>  #define __REG8(x)	(*((volatile u8 *)(x)))
> @@ -275,6 +279,36 @@ struct src {
>  	u32	sisr;
>  	u32	simr;
>  };
> +
> +struct iim_regs {
> +	u32 	stat;

Space before tabs:

+^Iu32 ^Istat;$

You should run checkpatch on your patch. It checks for such kind of
problems.

> +	u32 	statm;
           ^--- Space before tabs

The same for all fields in the structure.

I applied your patch and I tested on a i.MX27 Lite board. The result
does not seem correct. According to the manual, the mac address is store
at address 0x10028814. Rather there is no stored MAC at this address on
my board, but your patch read the MAC from address 0x10028810 (I traced
the address of fuse->mac_addr).

The reported address is what we can see at 0x10028810 (Word 4 of
fusebank 0):

md 0x10028804
10028804: 00000020 00000081 00000040 00000010     ....... at .......
10028814: 00000000 00000000 00000000 00000000    ................

And u-boot reports :
Address in SROM is         00:00:00:00:00:10
Address in environment is  00:aa:dd:cc:11:22

It seems you read at a wrong address.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2010-11-18 13:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 11:49 [U-Boot] [PATCH v6 1/1] imx: Get fec mac address from fuse Jason Liu
2010-11-18 13:38 ` Stefano Babic [this message]
2010-11-19  2:55   ` Jason Liu
2010-11-19  6:44     ` Jason Liu
2010-11-19  7:28       ` Stefano Babic
2010-11-19  8:10         ` Jason Liu
2010-11-19  8:18           ` Stefano Babic

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=4CE52C39.3050406@denx.de \
    --to=sbabic@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox