1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /***************************************************************************
4 * Copyright (C) 2015 Tomas Vanek *
6 ***************************************************************************/
9 Disable watchdog for Kinetis Kx and KVx
13 Used instruction set should work on both Cortex-M4 and M0+
21 /* WDOG registers offsets */
30 /* WDOG_UNLOCK = 0xC520 */
32 strh r2, [r0, WDOG_UNLOCK]
33 /* WDOG_UNLOCK = 0xD928 */
35 strh r2, [r0, WDOG_UNLOCK]
36 /* WDOG_STCTRLH clear bit 0 */
38 ldrh r2, [r0, WDOG_STCTRLH]
40 strh r2, [r0, WDOG_STCTRLH]
41 /* OpenOCD checks exit point address. Jump to the very end. */
46 /* Avoid padding at .text segment end. Otherwise exit point check fails. */
47 .skip ( . - start + 2) & 2, 0