From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 17 Jun 2012 20:04:00 +0200 Subject: [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() In-Reply-To: <4FDE1A40.40008@denx.de> References: <1339937889-15538-1-git-send-email-otavio@ossystems.com.br> <201206171802.49354.marex@denx.de> <4FDE1A40.40008@denx.de> Message-ID: <201206172004.01180.marex@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 Dear Stefano Babic, > On 17/06/2012 18:02, Marek Vasut wrote: > >> I like that there will be support for i.MX23, too. But I dislike that > >> everything takes the name "MX28". As you suggest in your subject, maybe > >> it is time to rename directories, and use "mxs" (as in kernel) instead > >> of mx28. > > > > We can do that eventually, later ... it depends on the ordering of > > Otavio's patches, I'm fine either way. > > Fine with me - anyway, it is something must be done. > > >>> + > >>> +static u8 get_cpu_rev(void) > >>> +{ > >>> + struct mx28_digctl_regs *digctl_regs = > >>> + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > >>> + > >>> + return readl(&digctl_regs->hw_digctl_chipid) & 0x0000F; > >>> +} > >> > >> Everywhere (i.MX, omap, ...) get_cpu_rev returns u32. The function is > >> currently exported, too. > > > > Correct, but isn't the return value mangled somehow (like having major > > rev. << 16 and minor rev. << 0 )? Or that's only IMX? > > Checking in current implementations for get_cpu_rev() (i.MX / OMAP24 / > OMAP3 / AM33, and even board/apollon/sys_info.c: I do not know why the > cpu detection is inseide this file), none of them requires strictly 32 > bit. However, we should be coherent in all code - for this reason I > dislike if one of the i.MX is implemented differently as for other SOCs. +1 > Best regards, > Stefano Babic Best regards, Marek Vasut