From: Alexander Stein Date: Thu, 22 Jul 2010 08:17:17 +0200 Subject: [U-Boot] [PATCH] at91: Don't initialize watchdog if CONFIG_SYS_WDTC_WDMR_VAL is undefined In-Reply-To: <20100721182048.076B3153780@gemini.denx.de> References: <1279713664-20353-1-git-send-email-alexander.stein@systec-electronic.com> <20100721182048.076B3153780@gemini.denx.de> Message-ID: <201007220817.17441.alexander.stein@systec-electronic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, Am Mittwoch, 21. Juli 2010, 20:20:48 schrieb Wolfgang Denk: > > --- a/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S > > +++ b/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S > > > > @@ -186,8 +186,10 @@ SDRAM_setup_end: > > .ltorg > > > > SMRDATA: > > +#if defined(CONFIG_SYS_WDTC_WDMR_VAL) > > > > .word AT91_ASM_WDT_MR > > .word CONFIG_SYS_WDTC_WDMR_VAL > > > > +#endif > > This seems the wrong approach to me - when CONFIG_HW_WATCHDOG is > defined and requires CONFIG_SYS_WDTC_WDMR_VAL, but the latter is > missing, than this should raise n error condition. We must not > silently ignore errors. Well, my problem is, that CONFIG_SYS_WDTC_WDMR_VAL is used to program the internal watchdog. But this watchdog can only be programmed once until a reset occurs. So there is no possibility for linux to reprogram it. So, if CONFIG_SYS_WDTC_WDMR_VAL is not defined and the watchdog is not programed using my patch, the watchdog still runs with default settings (timeout of 16s). So a user may choose to trigger the watchdog from u-boot (define CONFIG_AT91SAM9_WATCHDOG and CONFIG_HW_WATCHDOG) or let it run silently. To summarize, CONFIG_SYS_WDTC_WDMR_VAL is not needed to use CONFIG_AT91SAM9_WATCHDOG and CONFIG_HW_WATCHDOG. Best regards, Alexander Stein