Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/ChangeLog,v
retrieving revision 1.147
diff -u -5 -p -r1.147 ChangeLog
--- ChangeLog	25 Sep 2004 09:49:11 -0000	1.147
+++ ChangeLog	5 Oct 2004 07:09:51 -0000
@@ -1,5 +1,9 @@
+2004-10-4  Andrea Michelotti <amichelotti@atmel.com> 
+
+	* ecos.db: Added atmel jtst watchdog support
+
 2004-09-16  Andrea Michelotti <amichelotti@atmel.com> 
 
 	* ecos.db: Added atmel jtst board support, based on atmel Diopsis 
 	chip which is an at91 plus a dsp.
 	
Index: ecos.db
===================================================================
RCS file: /cvs/ecos/ecos/packages/ecos.db,v
retrieving revision 1.133
diff -u -5 -p -r1.133 ecos.db
--- ecos.db	25 Sep 2004 09:49:11 -0000	1.133
+++ ecos.db	5 Oct 2004 07:10:02 -0000
@@ -3957,10 +3957,11 @@ target jtst {
                    CYGPKG_HAL_ARM_AT91
                    CYGPKG_HAL_ARM_AT91_JTST
                    CYGPKG_IO_SERIAL_ARM_AT91
                    CYGPKG_DEVS_FLASH_JTST
                    CYGPKG_DEVS_FLASH_ATMEL_AT49XXXX
+		   CYGPKG_DEVICES_WATCHDOG_ARM_AT91
         }
         description "
         The jtst target provides the packages needed to run eCos on an Atmel
         Diospsis evaluation board (jtst)."
 }
Index: hal/arm/at91/jtst/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/jtst/current/ChangeLog,v
retrieving revision 1.1
diff -u -5 -p -r1.1 ChangeLog
--- hal/arm/at91/jtst/current/ChangeLog	25 Sep 2004 09:46:18 -0000	1.1
+++ hal/arm/at91/jtst/current/ChangeLog	5 Oct 2004 07:10:02 -0000
@@ -1,5 +1,9 @@
+2004-10-4  Andrea Michelotti  <amichelotti@atmel.com>
+	* include/hal_platform_setup.h: 
+	added generation of three different clocks for watchdog
+	
 2004-06-6  Andrea Michelotti  <amichelotti@atmel.com>
 
 	* cdl/hal_arm_at91_jtst.cdl: 
 	* include/plf_io.h: 
 	* include/hal_platform_setup.h: 
Index: hal/arm/at91/jtst/current/include/hal_platform_setup.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/jtst/current/include/hal_platform_setup.h,v
retrieving revision 1.1
diff -u -5 -p -r1.1 hal_platform_setup.h
--- hal/arm/at91/jtst/current/include/hal_platform_setup.h	25 Sep 2004 09:46:19 -0000	1.1
+++ hal/arm/at91/jtst/current/include/hal_platform_setup.h	5 Oct 2004 07:10:02 -0000
@@ -56,25 +56,32 @@
 #include <cyg/hal/var_io.h>
 #include <cyg/hal/hal_misc.h>
 
         .macro __pio_clkgen_init
         ldr     r0,=AT91_PIO
-        ldr     r1,=BIT21|BIT22|BIT23|BIT24|BIT25|BIT26|BIT27|BIT3
+        ldr     r1,=BIT21|BIT22|BIT23|BIT24|BIT25|BIT26|BIT27
         str     r1,[r0,#AT91_PIO_SODR] // set this bit must be always 1, 
                                  // otherwise resets
-        ldr     r1,=BIT21|BIT22|BIT23|BIT24|BIT25|BIT26|BIT27|BIT3
+        ldr     r1,=BIT21|BIT22|BIT23|BIT24|BIT25|BIT26|BIT27
         str     r1,[r0,#AT91_PIO_OER]  // set to output
         str     r1,[r0,#AT91_PIO_PER]  // software control
         ldr     r1,=BIT21|BIT22|BIT23|BIT24|BIT25|BIT26|BIT27
         str     r1,[r0,#AT91_PIO_CODR] // leds all on
-        ldr     r1,=BIT30
-        ldr     r1,[r0,#AT91_PIO_PDR]  // usb interrupt line in
-  // clockgen 1 is connected to timer ext clk 2
+        ldr     r1,=BIT30|BIT3
+        ldr     r1,[r0,#AT91_PIO_PDR]  // (BIT30) usb interrupt line in
+                                       // (BIT3) active watchdog reset line
         ldr     r0,=AT91_CLKGEN
         ldr     r1,=32
         str 	r1,[r0,#AT91_CLKGEN_CPTMAX0]
         str     r1,[r0,#AT91_CLKGEN_CPTMAX1]
+	ldr     r1,=128
+	str     r1,[r0,#AT91_CLKGEN_CPTMAX2] //watch dog divider1
+	ldr     r1,=1024
+	str     r1,[r0,#AT91_CLKGEN_CPTMAX3] //watch dog divider2
+	ldr     r1,=2046
+	str     r1,[r0,#AT91_CLKGEN_CPTMAX4] //watch dog divider3 (max accepted value)
+
         ldr     r1,=1
         str     r1,[r0,#AT91_CLKGEN_CLKENABLE]
 
 #if defined(CYG_HAL_STARTUP_RAM)
   // set internal ram as interrupt stack and other
Index: devs/watchdog/arm/at91/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/watchdog/arm/at91/current/ChangeLog,v
retrieving revision 1.2
diff -u -5 -p -r1.2 ChangeLog
--- devs/watchdog/arm/at91/current/ChangeLog	13 May 2003 18:34:08 -0000	1.2
+++ devs/watchdog/arm/at91/current/ChangeLog	5 Oct 2004 07:10:02 -0000
@@ -1,5 +1,10 @@
+2004-10-4  Andrea Michelotti  <amichelotti@atmel.com>
+
+	* src/watchdog_at91.cxx: 
+	* cdl/watchdog_at91.cdl: added JTST support
+
 2003-05-12  Nick Garnett  <nickg@balti.calivar.com>
 
 	* src/watchdog_at91.cxx: 
 	* cdl/watchdog_at91.cdl: Modified driver to work for EB40, EB40A
 	and EB55 boards. Generally tidied up a little.
Index: devs/watchdog/arm/at91/current/src/watchdog_at91.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/watchdog/arm/at91/current/src/watchdog_at91.cxx,v
retrieving revision 1.2
diff -u -5 -p -r1.2 watchdog_at91.cxx
--- devs/watchdog/arm/at91/current/src/watchdog_at91.cxx	13 May 2003 18:34:09 -0000	1.2
+++ devs/watchdog/arm/at91/current/src/watchdog_at91.cxx	5 Oct 2004 07:10:03 -0000
@@ -111,11 +111,26 @@
 #define DIVIDER 3
 #define DIV_FACTOR 4096
 #else
 #error Desired resolution beyond hardware capabilities
 #endif
-
+#elif defined(CYGHWR_HAL_ARM_AT91_JTST)
+#if   BASE_TICKS / 32 <= MAX_TICKS
+#define DIVIDER 0
+#define DIV_FACTOR 32
+#elif BASE_TICKS / 128 <= MAX_TICKS
+#define DIVIDER 1
+#define DIV_FACTOR 128
+#elif BASE_TICKS / 1024 <= MAX_TICKS
+#define DIVIDER 2
+#define DIV_FACTOR 1024
+#elif BASE_TICKS / 2046 <= MAX_TICKS
+#define DIVIDER 3
+#define DIV_FACTOR 2046
+#else
+#error Desired resolution beyond hardware capabilities
+#endif
 
 #endif
 
 #define TICKS 	    ((BASE_TICKS / DIV_FACTOR) | 0xfff)
 #define RESOLUTION  ((cyg_uint64) (TICKS * DIV_FACTOR ) * 1000000 / MCLK_FREQUENCY_KHZ)
Index: devs/watchdog/arm/at91/current/cdl/watchdog_at91.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/watchdog/arm/at91/current/cdl/watchdog_at91.cdl,v
retrieving revision 1.2
diff -u -5 -p -r1.2 watchdog_at91.cdl
--- devs/watchdog/arm/at91/current/cdl/watchdog_at91.cdl	13 May 2003 18:34:08 -0000	1.2
+++ devs/watchdog/arm/at91/current/cdl/watchdog_at91.cdl	5 Oct 2004 07:10:03 -0000
@@ -63,12 +63,12 @@ cdl_package CYGPKG_DEVICES_WATCHDOG_ARM_
     description   "
       This package uses the watchdog device integrated
       in the AT91 to execute a predefined action if the
       application fails to call the reset function for
       longer than a given timeout interval. This package
-      currently only supports the AT91x408xx and AT91M55800A
-      devices found on the Atmel EB40, EB40A and EB55 evaluation
+      currently only supports the AT91x408xx, AT91M55800A and Diopsis
+      devices found on the Atmel EB40, EB40A, EB55 and JTST evaluation
       boards. The AT91M42800 found on the EB42 is not supported
       since it uses a totally different watchdog device."
 
     cdl_option CYGIMP_WATCHDOG_HARDWARE {
         parent	      CYGPKG_IO_WATCHDOG_IMPLEMENTATION
