From patchwork Tue Aug 21 05:27:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,11/13] Blackfin: Bf60x: add hw watchdog support Date: Mon, 20 Aug 2012 19:27:11 -0000 From: Bob Liu X-Patchwork-Id: 178961 Message-Id: <1345526833-10804-11-git-send-email-lliubbo@gmail.com> To: , , Cc: u-boot-devel@blackfin.uclinux.org, sonic.zhang@analog.com Signed-off-by: Bob Liu --- arch/blackfin/cpu/initcode.c | 13 +++++++++++++ arch/blackfin/cpu/start.S | 2 ++ include/configs/bf609-ezkit.h | 1 + 3 files changed, 16 insertions(+) diff --git a/arch/blackfin/cpu/initcode.c b/arch/blackfin/cpu/initcode.c index c4f1764..fc6e77b 100644 --- a/arch/blackfin/cpu/initcode.c +++ b/arch/blackfin/cpu/initcode.c @@ -458,8 +458,21 @@ program_early_devices(ADI_BOOT_DATA *bs, uint *sdivB, uint *divB, uint *vcoB) */ if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS) { serial_putc('e'); +#ifdef __ADSPBF60x__ + bfin_write_SEC_GCTL(0x2); + SSYNC(); + bfin_write_SEC_FCTL(0xc1); + bfin_write_SEC_SCTL(2, bfin_read_SEC_SCTL(2) | 0x6); + + bfin_write_SEC_CCTL(0x2); + SSYNC(); + bfin_write_SEC_GCTL(0x1); + bfin_write_SEC_CCTL(0x1); +#endif bfin_write_WDOG_CNT(MSEC_TO_SCLK(CONFIG_HW_WATCHDOG_TIMEOUT_INITCODE)); +#if CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_UART bfin_write_WDOG_CTL(0); +#endif serial_putc('f'); } #endif diff --git a/arch/blackfin/cpu/start.S b/arch/blackfin/cpu/start.S index 90b4d1a..7155fc8 100644 --- a/arch/blackfin/cpu/start.S +++ b/arch/blackfin/cpu/start.S @@ -65,6 +65,7 @@ ENTRY(_start) p5.h = HI(COREMMR_BASE); #ifdef CONFIG_HW_WATCHDOG +#ifndef __ADSPBF60x__ # ifndef CONFIG_HW_WATCHDOG_TIMEOUT_START # define CONFIG_HW_WATCHDOG_TIMEOUT_START 5000 # endif @@ -78,6 +79,7 @@ ENTRY(_start) /* fire up the watchdog - R0.L above needs to be 0x0000 */ W[p4 + (WDOG_CTL - SYSMMR_BASE)] = r0; #endif +#endif /* Turn on the serial for debugging the init process */ serial_early_init diff --git a/include/configs/bf609-ezkit.h b/include/configs/bf609-ezkit.h index 722ba62..7de65e9 100644 --- a/include/configs/bf609-ezkit.h +++ b/include/configs/bf609-ezkit.h @@ -73,6 +73,7 @@ #define CONFIG_SYS_MONITOR_LEN (512 * 1024) #define CONFIG_SYS_MALLOC_LEN (256 * 1024) +#define CONFIG_HW_WATCHDOG /* * Network Settings */