From: Michael Trimarchi Date: Tue, 15 Mar 2011 13:50:27 +0100 Subject: [U-Boot] [PATCH AT91] Add watchdog reset to the at91samx SOC family In-Reply-To: <4D7F550B.4050302@emk-elektronik.de> References: <20110315112717.GA24904@gandalf.sssup.it> <4D7F550B.4050302@emk-elektronik.de> Message-ID: <4D7F6093.9030802@gandalf.sssup.it> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi On 03/15/2011 01:01 PM, Reinhard Meyer wrote: > Dear Michael Trimarchi, >> This patch add the watchdog reset function to the atmel atsam9x architectures. > > NAK. > > Watchdog already exists at drivers/watchdog/at91sam9_wdt.c :) > I'm getting confused because I have seen other implementation of the watchdog reset function and I was thinking that was the correct location of the function. Some board initialize it in the sturtup. > Maybe its a bit of an obscure location... But it is already invented ;) > >> + int re_enable = disable_interrupts(); >> + >> + writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, &wdt->cr); >> + >> + if (re_enable) >> + enable_interrupts(); > > Besides... why would we need to disable IRQs here, writel() is using one instruction > to write to the address? > :(, Ok, I'm porting a new board and I have done it too fase without checking to much the code but the final result. Anyway I have seen the driver but I don't understand how the HW_WATCHDOG interface match the hw_watchdog_init. Michael Trimarchi > Best Regards, > > Reinhard >