From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Mon, 04 Jun 2012 13:16:37 -0700 Subject: [U-Boot] [PATCH 1/3] common/cmd_rsmode.c: add imx reset mode command In-Reply-To: <20120604195259.8CB96204AE4@gemini.denx.de> References: <1338066111-5835-1-git-send-email-troy.kisky@boundarydevices.com> <4FC1C403.6000409@googlemail.com> <4FC26173.9060907@boundarydevices.com> <4FC3B7A5.2080805@googlemail.com> <4FC4DC4E.9030007@boundarydevices.com> <20120604195259.8CB96204AE4@gemini.denx.de> Message-ID: <4FCD17A5.6030705@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/04/2012 12:52 PM, Wolfgang Denk wrote: > Dear Eric Nelson, > > In message<4FC4DC4E.9030007@boundarydevices.com> you wrote: >> >> Writing a 4 to the WDOG_BASE register enables the watchdog with a 1/2s delay. >> I think there should be a delay or while(1) loop afterwards though. It appears >> that the reset_cpu() routine will return. > > I recommend NOT messing with the watchdog for any unrelated functions. > > The function of the watchdog should be reserved for auch systems who > need it to implement security related functions; messing with it in > unrelated places (like setting it into unexpected states and or > timeouts) may cause undefined behaviour on such systems. > > Don't do it. > Hi Wolfgang, My comment is that reset_cpu() should probably not return, and at the moment it will. The minimum WDT timeout value is 1/2 second, so execution will continue for some time less than that. It seems to me that this might be a bad thing, allowing unexpected execution of commands in a script after the execution of the 'reset' command. If I understand your comment, you're saying that reset_cpu() should not be implemented using the watchdog. Is that right? Please advise, Eric