public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Eric Nelson <eric.nelson@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mx6: Fix the reading of CPU revision
Date: Wed, 27 Mar 2013 08:30:31 -0700	[thread overview]
Message-ID: <51531097.6050801@boundarydevices.com> (raw)
In-Reply-To: <51530B11.3060606@de.bosch.com>

Hi Dirk,

On 03/27/2013 08:06 AM, Dirk Behme wrote:
> Hi Eric,
>
> On 27.03.2013 15:00, Eric Nelson wrote:
>> Hi Fabio,
>>
>> On 03/27/2013 06:37 AM, Fabio Estevam wrote:
>>> On Wed, Mar 27, 2013 at 5:57 AM, Dirk Behme <dirk.behme@de.bosch.com>
>>> wrote:
>>>
 >> <snip>
>>
>> The VPU library relies on the output of /proc/cpuinfo (specifically
>> the line beginning with "Revision".
>>
>> The snippet (from vpu_io.h) is:
>>
>>     tmp = strstr(buf, "Revision");
>>     if (tmp != NULL) {
>>         rev = index(tmp, ':');
>>
 >> <snip>
 >>
>> This code should really be changed,
>
> Yes :)
>

And this whole thing is really off-topic on the U-Boot list
except as a weak requirement on U-Boot.

>> so we don't have to carry this
>> data all the way from boot loader to /proc/cpuinfo.
>
> As mentioned in my previous mail, I have some doubts that *all* kernels
> pick the version from the boot loader. It's my understanding that this
> strongly depends on the kernel? I.e. there are kernels which get the
> version from the boot loader, e.g. via ATAGs. But there are kernels
> which are independent from the boot loader and calculate it on their
> own? E.g.
>
> http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/mach-mx6/mm.c?h=imx_3.0.35_1.1.0&id=207f80453c77bc32e04b5fef863f6fe50a7fd1a8#n60
>

You're right of course. I believe only non-DT kernels are at issue here,
and it's just the ATAG callback get_board_rev() is at issue, not
get_cpu_rev().

Note that this is supposed to carry **board** revision, which lends
more weight to fixing it.

The kernel knows the proper CPU revision in all cases but publishes
the content of ATAG_REVISION in /proc/cpuinfo
	http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/kernel/setup.c?h=imx_3.0.35_1.1.0#n655
	http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/kernel/setup.c?h=imx_3.0.35_1.1.0#n1041

It seems straightforward to simply over-write 'system_rev' on those
kernels which need the hack.

Regards,


Eric

  reply	other threads:[~2013-03-27 15:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 12:54 [U-Boot] [PATCH] mx6: Fix the reading of CPU revision Fabio Estevam
2013-03-26 15:19 ` Eric Nelson
2013-03-26 15:43 ` Dirk Behme
2013-03-26 17:04   ` Fabio Estevam
2013-03-27  8:02     ` Dirk Behme
2013-03-27  8:57       ` Dirk Behme
2013-03-27 13:37         ` Fabio Estevam
2013-03-27 13:51           ` Dirk Behme
2013-03-27 14:00           ` Eric Nelson
2013-03-27 15:06             ` Dirk Behme
2013-03-27 15:30               ` Eric Nelson [this message]
2013-03-27 13:25       ` 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=51531097.6050801@boundarydevices.com \
    --to=eric.nelson@boundarydevices.com \
    --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