From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Fri, 02 Sep 2011 09:38:44 +0200 Subject: [U-Boot] [PATCH 1/2] ARM: mx25: Print the silicon revison In-Reply-To: <1314712450-571-1-git-send-email-fabio.estevam@freescale.com> References: <1314712450-571-1-git-send-email-fabio.estevam@freescale.com> Message-ID: <4E608804.2050804@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 08/30/2011 03:54 PM, Fabio Estevam wrote: > Print the silicon revison during boot. > > Signed-off-by: Fabio Estevam > --- Hi Fabio, > > + > +u32 get_cpu_rev(void) > +{ > + u32 srev; > + u32 system_rev = 0x25000; > + > + /* read SREV register from IIM module */ > + struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE; > + srev = readl(&iim->iim_srev); > + > + switch (srev) { > + case 0x00: > + system_rev |= CHIP_REV_1_0; > + break; > + case 0x01: > + system_rev |= CHIP_REV_1_1; > + break; > + default: > + system_rev |= CHIP_REV_UNKNOWN; > + break; > + } > + > + return system_rev; > +} > + > #if defined(CONFIG_DISPLAY_CPUINFO) > int print_cpuinfo (void) > { > char buf[32]; > + u32 cpurev; > + > + cpurev = get_cpu_rev(); > > - printf ("CPU: Freescale i.MX25 at %s MHz\n\n", > + printf("CPU: Freescale i.MX25 rev%d.%d at %s MHz\n\n", > + (cpurev & 0x000F0) >> 4, > + (cpurev & 0x0000F) >> 0, I see that we did different for other i.MX processor - if you check in the MX31 processor, we print the "unknown" string if the revision number does not match a known value instead of printing an arbitrary value as here. Can we stick with the same behavior ? 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 =====================================================================