# HG changeset patch # User Mychaela Falconia # Date 1558472119 0 # Node ID cd900b885eb2332c5bea3ead287dffbd825983f4 # Parent 6585c21cc4d41c76ec3a1efccf9eba9ca619ed03 target-utils/flash-boot-test: added wd (watchdog disable) command diff -r 6585c21cc4d4 -r cd900b885eb2 target-utils/flash-boot-test/Makefile --- a/target-utils/flash-boot-test/Makefile Sat Apr 13 04:11:28 2019 +0000 +++ b/target-utils/flash-boot-test/Makefile Tue May 21 20:55:19 2019 +0000 @@ -4,7 +4,8 @@ LD= arm-elf-ld OBJCOPY=arm-elf-objcopy -OBJS= vectors.o crt0.o cmdtab.o main.o mygetchar.o uartbase.o uartinit.o +OBJS= vectors.o crt0.o cmdtab.o main.o mygetchar.o uartbase.o uartinit.o \ + watchdog.o LIBS= ../libcommon/libcommon.a ../libprintf/libprintf.a ../libbase/libbase.a \ ../libc/libc.a LIBGCC= `${CC} -print-file-name=libgcc.a` diff -r 6585c21cc4d4 -r cd900b885eb2 target-utils/flash-boot-test/cmdtab.c --- a/target-utils/flash-boot-test/cmdtab.c Sat Apr 13 04:11:28 2019 +0000 +++ b/target-utils/flash-boot-test/cmdtab.c Tue May 21 20:55:19 2019 +0000 @@ -11,6 +11,7 @@ extern void cmd_w32(); extern void cmd_memdump_human(); +extern void cmd_watchdog_disable(); extern void abb_init(); extern void abb_power_off(); @@ -28,5 +29,6 @@ {"w8", cmd_w8}, {"w16", cmd_w16}, {"w32", cmd_w32}, + {"wd", cmd_watchdog_disable}, {0, 0} }; diff -r 6585c21cc4d4 -r cd900b885eb2 target-utils/flash-boot-test/watchdog.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/target-utils/flash-boot-test/watchdog.c Tue May 21 20:55:19 2019 +0000 @@ -0,0 +1,9 @@ +#include "types.h" + +void +cmd_watchdog_disable() +{ + /* stop/disable the watchdog timer */ + *(volatile u16 *)0xFFFFF804 = 0xF5; + *(volatile u16 *)0xFFFFF804 = 0xA0; +}