From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Wed, 27 Mar 2013 08:30:31 -0700 Subject: [U-Boot] [PATCH] mx6: Fix the reading of CPU revision In-Reply-To: <51530B11.3060606@de.bosch.com> References: <1364302440-18457-1-git-send-email-fabio.estevam@freescale.com> <5151C238.6070603@de.bosch.com> <5152A7B2.5010206@de.bosch.com> <5152B476.4080006@de.bosch.com> <5152FB90.8080102@boundarydevices.com> <51530B11.3060606@de.bosch.com> Message-ID: <51531097.6050801@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >>> wrote: >>> >> >> >> 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, ':'); >> >> >> >> 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