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 v5 1/1] imx: Get fec mac address from fuse
Date: Thu, 18 Nov 2010 10:06:31 +0100	[thread overview]
Message-ID: <4CE4EC97.4040802@denx.de> (raw)
In-Reply-To: <1290067754-28200-1-git-send-email-r64343@freescale.com>

On 11/18/2010 09:09 AM, 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,

> +	for (i = 0; i < 6; i++)
> +		mac[i] = readl(&fuse->mac_addr[i]);

This works, but implicitely converts the integer to a char. Should we
add a mask to make clear that only the LSB of the read value is taken ?

> +	for (i = 0; i < 6; i++)
> +		mac[6-1-i] = readl(&fuse->mac_addr[i]);
                     ^
                     |--- missing spaces

> +
> +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 	res0[0x1f1];
> +	struct fuse_bank {
> +		u32 	fuse_regs[0x20];
> +		u32 	fuse_rsvd[0xe0];
> +	} bank[4];

I see a discrepancy between i.mx27 and i.mx51 and it is not clear to me
if it is correct. Both processor has the same register map (at least as
meaning) until scs3. The offset for this register is for both processors
0x3c. The fuse bank0 starts for both processor at the offset 0x804, as I
see in manuals. However, you reserved in one case 0x1f0 integers and in
the other case 0x1f1. Is it correct ?

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  9:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18  8:09 [U-Boot] [PATCH v5 1/1] imx: Get fec mac address from fuse Jason Liu
2010-11-18  9:06 ` Stefano Babic [this message]
2010-11-18 10:33   ` Jason Liu
2010-11-18 10:55     ` 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=4CE4EC97.4040802@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