summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-12-13 22:16:28 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-12-13 22:16:28 +0000
commit7a677fd7d3127d3fd93e32140532d4bad637bb71 (patch)
tree7634c790b2317c921145dbceca93824a5d875a18
parent2000-12-13 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-7a677fd7d3127d3fd93e32140532d4bad637bb71.tar.bz2
2000-12-13 Joel Sherrill <joel@OARcorp.com>
* README: Updated. We are now vectoring a clock tick ISR handler. But RTEMS is not returning from the ISR properly. * clock/clockdrv.c: Now causes interrupts but has not been calibrated. * include/bsp.h: Use <libcpu/tx3904.h> * startup/Makefile.am: Add setvec.c from shared. * startup/bspstart.c: Initialize the status register (SR) so no interrupts are masked but global interrupts (SR_IEC) are off. Added call to install the ISR prologue code. * wrapup/Makefile.am: Pick up more pieces from libcpu.
-rw-r--r--c/src/lib/libbsp/mips/jmr3904/ChangeLog12
-rw-r--r--c/src/lib/libbsp/mips/jmr3904/README11
-rw-r--r--c/src/lib/libbsp/mips/jmr3904/clock/clockdrv.c18
-rw-r--r--c/src/lib/libbsp/mips/jmr3904/include/bsp.h1
-rw-r--r--c/src/lib/libbsp/mips/jmr3904/startup/Makefile.am2
-rw-r--r--c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c4
-rw-r--r--c/src/lib/libbsp/mips/jmr3904/wrapup/Makefile.am2
7 files changed, 46 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/mips/jmr3904/ChangeLog b/c/src/lib/libbsp/mips/jmr3904/ChangeLog
index cbd4f075a9..0354a4354e 100644
--- a/c/src/lib/libbsp/mips/jmr3904/ChangeLog
+++ b/c/src/lib/libbsp/mips/jmr3904/ChangeLog
@@ -1,3 +1,15 @@
+2000-12-13 Joel Sherrill <joel@OARcorp.com>
+
+ * README: Updated. We are now vectoring a clock tick ISR handler.
+ But RTEMS is not returning from the ISR properly.
+ * clock/clockdrv.c: Now causes interrupts but has not been calibrated.
+ * include/bsp.h: Use <libcpu/tx3904.h>
+ * startup/Makefile.am: Add setvec.c from shared.
+ * startup/bspstart.c: Initialize the status register (SR) so
+ no interrupts are masked but global interrupts (SR_IEC) are off.
+ Added call to install the ISR prologue code.
+ * wrapup/Makefile.am: Pick up more pieces from libcpu.
+
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* startup/bspclean.c: New file to explicitly invoke _sys_exit().
diff --git a/c/src/lib/libbsp/mips/jmr3904/README b/c/src/lib/libbsp/mips/jmr3904/README
index ab1685973b..446d6af50e 100644
--- a/c/src/lib/libbsp/mips/jmr3904/README
+++ b/c/src/lib/libbsp/mips/jmr3904/README
@@ -14,12 +14,21 @@ GDB must be configured with a target like "tx39-rtems". Otherwise,
the simulator will not be built for the correct instruction
and peripheral set.
+Simulator Information
+=====================
+The simulated system clock counts instructions. Setting the clock
+source to "clock" and the divider to 1 results in the timer directly
+counting the number of instructions executed.
+
Status
======
+ hello.exe locks up while running the global destructors. This almost
has to be a linkcmds issue.
-+ There is no clock tick device driver.
++ Workaround: bspclean.c actually explicits invokes _sys_exit() BEFORE
+ letting the global destructors run.
+
++ There is a clock tick device driver which has not been calibrated.
+ There is no timer device driver.
diff --git a/c/src/lib/libbsp/mips/jmr3904/clock/clockdrv.c b/c/src/lib/libbsp/mips/jmr3904/clock/clockdrv.c
index c49150fba6..7436f1676a 100644
--- a/c/src/lib/libbsp/mips/jmr3904/clock/clockdrv.c
+++ b/c/src/lib/libbsp/mips/jmr3904/clock/clockdrv.c
@@ -7,12 +7,26 @@
* $Id$
*/
-#define CLOCK_VECTOR 0
+#include <rtems.h>
+#include <libcpu/tx3904.h>
+
+#define CLOCK_VECTOR TX3904_IRQ_TMR0
#define Clock_driver_support_at_tick()
+/* XXX */
+#define CLICKS 10000
#define Clock_driver_support_install_isr( _new, _old ) \
- do { _old = 0; } while(0)
+ do { \
+ unsigned32 _clicks = CLICKS; \
+ _old = (rtems_isr_entry) set_vector( _new, CLOCK_VECTOR, 1 ); \
+ TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CCDR, 0x3 ); \
+ TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CPRA, _clicks ); \
+ TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TISR, 0x00 ); \
+ TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_ITMR, 0x8001 ); \
+ TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TCR, 0xC0 ); \
+ *((volatile unsigned32 *) 0xFFFFC01C) = 0x00000700; \
+ } while(0)
#define Clock_driver_support_initialize_hardware()
diff --git a/c/src/lib/libbsp/mips/jmr3904/include/bsp.h b/c/src/lib/libbsp/mips/jmr3904/include/bsp.h
index e2e9c0fb57..b66a5c5cc1 100644
--- a/c/src/lib/libbsp/mips/jmr3904/include/bsp.h
+++ b/c/src/lib/libbsp/mips/jmr3904/include/bsp.h
@@ -24,6 +24,7 @@ extern "C" {
#include <iosupp.h>
#include <console.h>
#include <clockdrv.h>
+#include <libcpu/tx3904.h>
/*
* Define the time limits for RTEMS Test Suite test durations.
diff --git a/c/src/lib/libbsp/mips/jmr3904/startup/Makefile.am b/c/src/lib/libbsp/mips/jmr3904/startup/Makefile.am
index 4dd270fbea..21e282917b 100644
--- a/c/src/lib/libbsp/mips/jmr3904/startup/Makefile.am
+++ b/c/src/lib/libbsp/mips/jmr3904/startup/Makefile.am
@@ -9,7 +9,7 @@ VPATH = @srcdir@:@srcdir@/../../../shared
PGM = $(ARCH)/startup.rel
C_FILES = bspclean.c bsplibc.c bsppost.c bspstart.c bootcard.c main.c sbrk.c \
- gnatinstallhandler.c
+ gnatinstallhandler.c setvec.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
OBJS = $(C_O_FILES)
diff --git a/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c b/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c
index 1143386ada..2a5bc13e91 100644
--- a/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c
+++ b/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c
@@ -90,6 +90,10 @@ void bsp_start( void )
_sys_exit( 1 );
BSP_Configuration.work_space_start = (void *) &WorkspaceBase;
+
+ mips_set_sr( 0xff00 ); /* all interrupts unmasked but globally off */
+ /* depend on the IRC to take care of things */
+ mips_install_isr_entries();
}
/* XXX */
diff --git a/c/src/lib/libbsp/mips/jmr3904/wrapup/Makefile.am b/c/src/lib/libbsp/mips/jmr3904/wrapup/Makefile.am
index 81b4604e8a..f5c532a23f 100644
--- a/c/src/lib/libbsp/mips/jmr3904/wrapup/Makefile.am
+++ b/c/src/lib/libbsp/mips/jmr3904/wrapup/Makefile.am
@@ -12,6 +12,8 @@ include $(top_srcdir)/../../../../../../automake/lib.am
# bummer; have to use $foreach since % pattern subst rules only replace 1x
OBJS = $(foreach piece, $(BSP_FILES), $(wildcard ../$(piece)/$(ARCH)/*.o)) \
+ $(wildcard ../../../../libcpu/$(RTEMS_CPU)/shared/*/$(ARCH)/*.o) \
+ $(wildcard ../../../../libcpu/$(RTEMS_CPU)/tx39/*/$(ARCH)/*.o) \
$(wildcard ../../../../libcpu/$(RTEMS_CPU)/$(RTEMS_CPU_MODEL)/$(ARCH)/*.o) \
$(foreach piece, $(GENERIC_FILES), ../../../$(piece)/$(ARCH)/$(piece).rel)