[U-Boot] [PATCH] mx6: Fix the reading of CPU revision

Dirk Behme
2013-03-27T13:51:55Z

On 27.03.2013 14:37, Fabio Estevam wrote:
> On Wed, Mar 27, 2013 at 5:57 AM, Dirk Behme <dirk.behme@de.bosch.com> wrote:
>
>> Some additional rethinking: I missed that we have a Linux kernel, too ;)
>>
>> c) It's the job of the Linux kernel to export the CPU revision to the VPU
>> library. In case the Linux kernel completely ignores what we are doing in
>> U-Boot and calculates the CPU revision itself (*), e.g. by something like
>>
>> 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
>>
>> we can do anything in U-Boot. Independent of the VPU library.
>
> Unfortunately VPU library relies on the bootloader to pass the correct
> silicon revision.

I don't think so, at least this depends on the kernel. To my
understanding the VPU library relies on the kernel to pass the correct
silicon revision. And where the kernel gets this information from seems
to depend on the kernel version:

a) get it from U-Boot via ATAGs

b) calculate the value in the kernel independent of U-Boot

About which kernel are you talking? To my understanding, using a recent
kernel with device tree there is no revision information passed from the
boot loader to the kernel?

Instead of hacking U-Boot for these (old) kernels, I'd propose to fix
the kernel to pass the 0x61/0x63 correctly to the VPU library. Or as
Wolfgang mentioned, even better, fix the VPU library.

I really like Troys existing code and see no reason to change it just
due to the VPU library. Do the change in the kernel or the VPU library.

Best regards

Dirk

> Eric's tested passing 0 as get_cpu_rev and showed that VPU simply
> cannot work on this case.
>
>> In this case I'd propose to just keep Troy's version of get_cpu_rev() as it
>> is [1].
>
> This is proven to not to work with mx6solo and VPU, so we need the fix
> I proposed.
>
> Here is what I am planning to do:
>
> 1. Send a v2 of this patch with the small correction pointed out by Eric
> 2. Include a weak function to pass get_cpu_rev in common mx6 code
>
> Then on top of that, one can send a patch that prints the mx6 silicon
> strings by differentiating between a mx6dual-lite and mx6solo, if it
> is worth.
>
> Regards,
>
> Fabio Estevam

--
======================================================================
Dirk Behme Robert Bosch Car Multimedia GmbH
CM-AI/PJ-CF32
Phone: +49 5121 49-3274 Dirk Behme
Fax: +49 711 811 5053274 PO Box 77 77 77
mailto:dirk.behme at de.bosch.com D-31132 Hildesheim - Germany

Bosch Group, Car Multimedia (CM)
Automotive Navigation and Infotainment Systems (AI)
ProJect - CoreFunctions (PJ-CF)

Robert Bosch Car Multimedia GmbH - Ein Unternehmen der Bosch Gruppe
Sitz: Hildesheim
Registergericht: Amtsgericht Hildesheim HRB 201334
Aufsichtsratsvorsitzender: Volkmar Denner
Gesch?ftsf?hrung: Uwe Thomas, Michael Bolle, Robby Drave, Egbert Hellwig
======================================================================