All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] mx6: Read silicon revision from register
Date: Tue, 13 Mar 2012 16:49:15 +0100	[thread overview]
Message-ID: <4F5F6C7B.5010903@denx.de> (raw)
In-Reply-To: <4F5F6A64.9070603@boundarydevices.com>

On 13/03/2012 16:40, Eric Nelson wrote:
> On 03/13/2012 07:18 AM, Fabio Estevam wrote:
>> Instead of hardcoding the mx6 silicon revision, read it from the
>> proper register.
>>
>> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
>> ---
>> Changes since v1:
>> - Fix typo on Subject
>>   arch/arm/cpu/armv7/mx6/soc.c |    3 ++-
>>   1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
>> index 2ac74b5..639bf30 100644
>> --- a/arch/arm/cpu/armv7/mx6/soc.c
>> +++ b/arch/arm/cpu/armv7/mx6/soc.c
>> @@ -32,7 +32,8 @@
>>
>>   u32 get_cpu_rev(void)
>>   {
>> -    int system_rev = 0x61000 | CHIP_REV_1_0;
>> +    int reg = readl(ANATOP_BASE_ADDR + 0x260)&  0xFF;
>> +    int system_rev = 0x61000 | 0x10 + reg;
>>
>>       return system_rev;
>>   }
> 
> Nice!
>     MX6Q SABRELITE U-Boot > md 0x20C8260 1
>     020c8260: 00630000    ..c.
> 
> This beats the heck out of my hack:
>     http://lists.denx.de/pipermail/u-boot/2012-March/120102.html
> 
> Now the question is how get_cpu_rev() relates to get_board_rev().

Really they should be unrelated.....I know, we have several cases where
the board revision contains the cpu, but in u-boot they are unrelated.
get_board_rev() should only have the revision of the board, if any.

> 
> We had a discussion a while back about reserving some space in OTP
> to allow per-board revision information.
> 
> Fabio, do you have any guidance about how/whether the system_rev
> should be updated to include a board revision?

Do you mean which is the version to be put to make the imxlib happy ?

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:[~2012-03-13 15:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 14:18 [U-Boot] [PATCH v2] mx6: Read silicon revision from register Fabio Estevam
2012-03-13 14:37 ` Dirk Behme
2012-03-13 15:40 ` Eric Nelson
2012-03-13 15:49   ` Stefano Babic [this message]
2012-03-13 18:01     ` Eric Nelson
2012-03-13 17:04   ` Fabio Estevam

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=4F5F6C7B.5010903@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.