Re: [U-Boot] [PATCH V3 1/2] MX5: factor out boot cause funciton to common code

2011-04-20 Thread Stefano Babic
On 04/18/2011 11:19 AM, Detlev Zundel wrote: Hi Stefano, 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

Re: [U-Boot] [PATCH V3 1/2] MX5: factor out boot cause funciton to common code

2011-04-20 Thread Jason Liu
Hi, Stefano, 2011/4/20 Stefano Babic sba...@denx.de: On 04/18/2011 11:19 AM, Detlev Zundel wrote: Hi Stefano, 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 =

Re: [U-Boot] [PATCH V3 1/2] MX5: factor out boot cause funciton to common code

2011-04-18 Thread Detlev Zundel
Hi Stefano, 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

[U-Boot] [PATCH V3 1/2] MX5: factor out boot cause funciton to common code

2011-04-15 Thread Jason Liu
From: Liu Hui-R64343 r64...@freescale.com factor out boot cause funciton to common code to avoid the duplicate code in each board support package Signed-off-by: Jason Liu r64...@freescale.com --- arch/arm/cpu/armv7/mx5/soc.c | 18 ++

Re: [U-Boot] [PATCH V3 1/2] MX5: factor out boot cause funciton to common code

2011-04-15 Thread Stefano Babic
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