changeset 488:cd900b885eb2

target-utils/flash-boot-test: added wd (watchdog disable) command
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 21 May 2019 20:55:19 +0000
parents 6585c21cc4d4
children 9fce32cc6220
files target-utils/flash-boot-test/Makefile target-utils/flash-boot-test/cmdtab.c target-utils/flash-boot-test/watchdog.c
diffstat 3 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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`
--- 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}
 };
--- /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;
+}