wdenk | affae2b | 2002-08-17 09:36:01 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com. |
| 4 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame^] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | affae2b | 2002-08-17 09:36:01 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * W7O board level hardware watchdog. |
| 10 | */ |
| 11 | #include <common.h> |
| 12 | #include <config.h> |
| 13 | |
| 14 | #ifdef CONFIG_HW_WATCHDOG |
| 15 | #include <watchdog.h> |
| 16 | |
| 17 | void hw_watchdog_reset(void) |
| 18 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 19 | volatile ushort *hwd = (ushort *)(CONFIG_SYS_W7O_EBC_PB7CR & 0xfff00000); |
wdenk | affae2b | 2002-08-17 09:36:01 +0000 | [diff] [blame] | 20 | |
| 21 | /* |
| 22 | * Read the LMG's hwd register and toggle the |
| 23 | * watchdog bit to reset it. On the LMC, just |
| 24 | * reading it is enough, but toggling the bit |
| 25 | * doen't hurt either. |
| 26 | */ |
| 27 | *hwd = *hwd ^ 0x8000; |
| 28 | |
| 29 | } /* hw_watchdog_reset() */ |
| 30 | |
| 31 | #endif /* CONFIG_HW_WATCHDOG */ |