From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Fri, 15 Apr 2011 20:35:08 +0200 Subject: [U-Boot] [PATCH V3 1/2] MX5: factor out boot cause funciton to common code In-Reply-To: <850655.14650.qm@web39423.mail.mud.yahoo.com> References: <850655.14650.qm@web39423.mail.mud.yahoo.com> Message-ID: <4DA88FDC.2010407@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 04/15/2011 02:47 PM, Fabio Estevam wrote: >> +char *get_reset_cause(void) >> +{ >> + u32 cause; >> + struct src *src_regs = (struct src >> *)SRC_BASE_ADDR; >> + >> + cause = readl(&src_regs->srsr); > > You need to mask the 7 LSB of SRSR register. > > If you don?t bit 16 can still affect its result. Why ? As this becomes a general function for i.MX5, should we not provide a way to check all significant bits ? Why should we exclude the "warm boot" bit to be checked and printed out ? 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 =====================================================================