From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Wed, 03 Apr 2013 11:36:53 +0200 Subject: [U-Boot] [PATCH v2] mx6: Fix get_board_rev() for the mx6 solo case In-Reply-To: <1364405816-14085-1-git-send-email-fabio.estevam@freescale.com> References: <1364405816-14085-1-git-send-email-fabio.estevam@freescale.com> Message-ID: <515BF835.30409@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 27/03/2013 18:36, Fabio Estevam wrote: > When booting a Freescale kernel 3.0.35 on a Wandboard solo, the get_board_rev() > returns 0x62xxx, which is not a value understood by the VPU > (Video Processing Unit) library in the kernel and causes the video playback to > fail. > > The expected values for get_board_rev are: > 0x63xxx: For mx6quad/dual > 0x61xxx: For mx6dual-lite/solo > > So adjust get_board_rev() accordingly and make it as weak function, so that we > do not need to define it in every mx6 board file. > > Signed-off-by: Fabio Estevam > --- Hi Fabio, > Changes since v1: > - Avoid extra call to get_cpu_rev() > > arch/arm/cpu/armv7/mx6/soc.c | 12 ++++++++++++ > board/boundary/nitrogen6x/nitrogen6x.c | 5 ----- > board/freescale/mx6qsabrelite/mx6qsabrelite.c | 5 ----- > board/freescale/mx6qsabresd/mx6qsabresd.c | 5 ----- > board/wandboard/wandboard.c | 5 ----- > 5 files changed, 12 insertions(+), 20 deletions(-) > > diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c > index 193ba12..4f3cd14 100644 > --- a/arch/arm/cpu/armv7/mx6/soc.c > +++ b/arch/arm/cpu/armv7/mx6/soc.c > @@ -61,6 +61,18 @@ u32 get_cpu_rev(void) > return (type << 12) | (reg + 0x10); > } > > +#ifdef CONFIG_REVISION_TAG > +u32 __weak get_board_rev(void) > +{ > + u32 cpurev = get_cpu_rev(); > + u32 type = ((cpurev >> 12) & 0xff); > + if (type == MXC_CPU_MX6SOLO) > + cpurev = (MXC_CPU_MX6DL) << 12 | (cpurev & 0xFFF); > + > + return cpurev; > +} > +#endif > + We use a cpu revision as board revision, and this seems quite perverse. Anyway, I understand the reasons, and this seems a good way to work around bugs in other (FSL) code without breaking U-Boot. Applied to u-boot-imx, thanks. 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-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================