From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] CONFIG_REVISION (was i.MX6: mx6qsabrelite: allow use with Freescale 2.6.38 kernels)
Date: Wed, 07 Mar 2012 17:32:31 +0100 [thread overview]
Message-ID: <4F578D9F.6060606@denx.de> (raw)
In-Reply-To: <4F578465.6030503@boundarydevices.com>
On 07/03/2012 16:53, Eric Nelson wrote:
> Hi Stefano,
>
Hi Eric,
>
> I did the same search but was apparently not as persistent as you were.
> The symptom is simple: Video won't play back on Android (R13.1 ICS)
> without the system revision but play nicely with it.
Ok, we know the symptoms...
> I think I just found the culprit, and it's in userspace, not in the
> kernel. In package imx-lib-11.11.01, file vpu/vpu.c, there's this
> routine that sets a global system_rev based on /proc/cpuinfo:
>
> static int get_system_rev(void)
> {
> FILE *fp;
> char buf[1024];
> int nread;
> char *tmp, *rev;
> int ret = -1;
>
> fp = fopen("/proc/cpuinfo", "r");
> if (fp == NULL) {
> perror("/proc/cpuinfo\n");
> return ret;
> }
>
> nread = fread(buf, 1, sizeof(buf), fp);
> fclose(fp);
> if ((nread == 0) || (nread == sizeof(buf))) {
> fclose(fp);
> return ret;
> }
>
> buf[nread] = '\0';
>
> tmp = strstr(buf, "Revision");
> if (tmp != NULL) {
> rev = index(tmp, ':');
> if (rev != NULL) {
> rev++;
> system_rev = strtoul(rev, NULL, 16);
> ret = 0;
> }
> }
>
> return ret;
> }
>
> The global is then exported via macros:
> vpu/vpu_io.c:unsigned int system_rev;
> vpu/vpu_io.c:static int get_system_rev(void)
> vpu/vpu_io.c: system_rev = strtoul(rev, NULL, 16);
> vpu/vpu_io.c: ret = get_system_rev();
> vpu/vpu_lib.h:extern unsigned int system_rev;
> vpu/vpu_lib.h:#define mxc_cpu() (system_rev >> 12)
> vpu/vpu_lib.h:#define mxc_cpu_rev() (system_rev & 0xFF)
>
> and used to find the firmware file:
> vpu/vpu_util.c: sprintf(temp_str, "vpu_fw_imx%2x.bin", mxc_cpu());
>
> ...all to support the userspace I/O for the VPU.
Understood - this is really crappy, because it makes so absurd
dependencies that is very easy to break - and when it happens, nobody
knows why, as we find now. Really this is a problem neither in u-boot
nor in kernel...
>
> We are way off topic here,
Well, we have now the cause...
> but I certainly hope we can address this in the
> future and get a real driver written for the VPU.
..in the mainline kernel...
>
>> Anyway, the ATAG is supported and as I already said quite common for
>> U-Boot boards. The commit message " Freescale 2.6.38 (Non-DT) kernels
>> require the revision atag to enable the VPU." should be extended
>> explaining the real cause (if known) or changed dropping VPU because
>> there is no clear relationship between the ATAG and the issue.
>>
>
> How about something more generic like this?
> "Freescale Linux distributions depend on system_rev".
Because you deeply investigated and found the reason, I propose you add
a full description indicating that the imx lib libraries depend on the
system_rev in kernel to transfer the correct firmware. So we know it is
neither a problem in u-boot nor in kernel, but we as u-bootlers are fair
with some bad implemented libraries....
Normally I would say that the fix should be done where the bug is - we
are introducing a work-around for a problem in user space. But as I
stated previously, the revision tag is used on a lot of ARM boards, and
there is no reason to reject it only on this board.
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
=====================================================================
next prev parent reply other threads:[~2012-03-07 16:32 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 22:55 [U-Boot] i.MX6: mx6qsabrelite: allow use with Freescale 2.6.38 kernels Eric Nelson
2012-03-02 22:55 ` [U-Boot] [PATCH 1/3] i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG Eric Nelson
2012-03-02 22:59 ` Marek Vasut
2012-03-04 20:35 ` Eric Nelson
2012-03-04 20:59 ` Marek Vasut
2012-03-04 21:04 ` Eric Nelson
2012-03-04 21:18 ` Marek Vasut
2012-03-04 22:06 ` Wolfgang Denk
2012-03-04 22:41 ` Eric Nelson
2012-03-03 10:26 ` Stefano Babic
2012-03-02 22:55 ` [U-Boot] [PATCH 2/3] i.MX6: mx6qsabrelite: add MACH_TYPE_MX6Q_SABRELITE Eric Nelson
2012-03-02 23:00 ` Marek Vasut
2012-03-03 10:28 ` Stefano Babic
2012-03-02 22:55 ` [U-Boot] [PATCH 3/3] i.MX6: mx6qsabrelite: add ext2 support Eric Nelson
2012-03-07 9:36 ` Stefano Babic
2012-03-02 23:01 ` [U-Boot] i.MX6: mx6qsabrelite: allow use with Freescale 2.6.38 kernels Marek Vasut
2012-03-02 23:25 ` Wolfgang Denk
2012-03-02 23:46 ` Eric Nelson
2012-03-02 23:50 ` Fabio Estevam
2012-03-03 9:33 ` Wolfgang Denk
2012-03-03 6:35 ` Dirk Behme
2012-03-03 9:38 ` Wolfgang Denk
2012-03-03 10:43 ` mailander
2012-03-03 11:32 ` Dirk Behme
2012-03-03 13:30 ` Wolfgang Denk
2012-03-04 1:19 ` Troy Kisky
2012-03-04 8:39 ` Wolfgang Denk
2012-03-07 9:37 ` Albert ARIBAUD
2012-03-04 11:09 ` Stefano Babic
2012-03-04 14:14 ` Igor Grinberg
2012-03-04 19:45 ` [U-Boot] CONFIG_REVISION (was i.MX6: mx6qsabrelite: allow use with Freescale 2.6.38 kernels) Eric Nelson
2012-03-07 8:43 ` Stefano Babic
2012-03-07 15:53 ` Eric Nelson
2012-03-07 16:32 ` Stefano Babic [this message]
2012-03-03 10:33 ` [U-Boot] i.MX6: mx6qsabrelite: allow use with Freescale 2.6.38 kernels 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=4F578D9F.6060606@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