From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Thu, 10 Mar 2011 16:07:49 +0100 Subject: [U-Boot] [PATCH 1/2] ARM: MX31: print WRSR to indicate the source of the last reset In-Reply-To: <1299754388-31648-1-git-send-email-agust@denx.de> References: <1299754388-31648-1-git-send-email-agust@denx.de> Message-ID: <4D78E945.1080407@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 03/10/2011 11:53 AM, Anatolij Gustschin wrote: > Add output of the WRSR register content while booting so that > we can see the source of the last reset. > > Signed-off-by: Anatolij Gustschin Hi Antolij, > --- > arch/arm/cpu/arm1136/mx31/generic.c | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/cpu/arm1136/mx31/generic.c b/arch/arm/cpu/arm1136/mx31/generic.c > index 1415d6c..788faed 100644 > --- a/arch/arm/cpu/arm1136/mx31/generic.c > +++ b/arch/arm/cpu/arm1136/mx31/generic.c > @@ -93,8 +93,10 @@ void mx31_gpio_mux(unsigned long mode) > #if defined(CONFIG_DISPLAY_CPUINFO) > int print_cpuinfo (void) > { > - printf("CPU: Freescale i.MX31 at %d MHz\n", > - mx31_get_mcu_main_clk() / 1000000); > + struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE; > + > + printf("CPU: Freescale i.MX31 at %d MHz (WRSR=0x%04x)\n", > + mx31_get_mcu_main_clk() / 1000000, wdog->wrsr); Why is it better to use the wrsr register instead of the rcsr register ? We are actually using the rcsr register for other i.MX processors (MX51/MX53/MX35). And if we want to print the reset cause, I think it should be better to write directly the cause as string instead of the register value. I do not think printing the reset cause should be implemented in print_cpuinfo(), because it manages a different issue (reset cause against CPU information). The print_cpuinfo() should have only CPU related values, as clock values, and so on, as it is implemented now for this and other processors. Better to add a different function for the reset cause. 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 =====================================================================