forked from Imagelibrary/rtems
2000-11-27 Joel Sherrill <joel@OARcorp.com>
* README, sim68000.setup, clock/clockdrv.c: Modified to add support for timer as clock tick source. Compiles but untested.
This commit is contained in:
@@ -4,7 +4,10 @@
|
||||
|
||||
BSP for the BSVC 68000 simulator. This is definitely under construction.
|
||||
The initialization/setup script for BSVC is the part that likely needs
|
||||
work.
|
||||
work. I have written the timer based on the timer sample included with
|
||||
bsvc 2.1.
|
||||
|
||||
At this point, hello does not even print.
|
||||
|
||||
--joel
|
||||
1 August 2000
|
||||
|
||||
@@ -6,17 +6,50 @@
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
#define CLOCK_VECTOR 0
|
||||
#define CLOCK_VECTOR 84
|
||||
|
||||
#define Clock_driver_support_install_isr( _new, _old ) \
|
||||
do { _old = (rtems_isr_entry) set_vector( _new, CLOCK_VECTOR, 1 ); } while(0)
|
||||
|
||||
|
||||
#define Clock_driver_support_initialize_hardware()
|
||||
typedef struct {
|
||||
volatile unsigned8 cr; /* 0 - 0 : Timer Control Register */
|
||||
volatile unsigned8 pad0; /* 1 - 1 : pad */
|
||||
volatile unsigned8 ivr; /* 2 - 2 : Timer Interrupt Vector Register */
|
||||
volatile unsigned8 pad1; /* 3 - 3 : pad */
|
||||
volatile unsigned32 cpr; /* 4 - 7 : Timer Counter Preload Register */
|
||||
volatile unsigned8 pad2[12]; /* 8 - 19 : pad */
|
||||
volatile unsigned32 sr; /* 20 - 23 : Timer Status Register */
|
||||
} timer_hw_t;
|
||||
|
||||
#define Clock_driver_support_at_tick() \
|
||||
Clock_driver_support_initialize_hardware()
|
||||
#define TIMER_BASE (timer_hw_t *)0x72001
|
||||
|
||||
#define Clock_driver_support_shutdown_hardware()
|
||||
/* 8 microseconds per click, 125,000 per second */
|
||||
|
||||
/* XXX should check that microseconds_per_tick is >= 8 */
|
||||
void Clock_driver_support_initialize_hardware()
|
||||
{
|
||||
timer_hw_t *t = TIMER_BASE;
|
||||
|
||||
t->ivr = CLOCK_VECTOR;
|
||||
t->cpr = rtems_configuration_get_microseconds_per_tick() / 8;
|
||||
t->cr = 0xA0; /* initialize with timer disabled */
|
||||
t->cr = 0xA1; /* enable timer */
|
||||
}
|
||||
|
||||
void Clock_driver_support_at_tick()
|
||||
{
|
||||
timer_hw_t *t = TIMER_BASE;
|
||||
|
||||
t->sr = 0xA0; /* Negate timer interrupt request */
|
||||
}
|
||||
|
||||
|
||||
void Clock_driver_support_shutdown_hardware()
|
||||
{
|
||||
timer_hw_t *t = TIMER_BASE;
|
||||
|
||||
t->cr = 0xA0; /* initialize with timer disabled */
|
||||
}
|
||||
|
||||
#include "../../../shared/clockdrv_shell.c"
|
||||
|
||||
@@ -5,3 +5,4 @@ SIMULATOR {sim68000}
|
||||
COMMAND {AttachDevice 0 RAM {BaseAddress = 0 Size = 40000}}
|
||||
COMMAND {AttachDevice 0 RAM {BaseAddress = 40000 Size = 20000}}
|
||||
COMMAND {AttachDevice 0 M68681 {BaseAddress = 71001 OffsetToFirstRegister = 0 OffsetBetweenRegisters = 2 InterruptLevel = 4 PortAStandardInputOutputFlag = 0 PortBStandardInputOutputFlag = 0 PortACommand = xterm -T "M68681 Port A" -132 -fn fixed -e /usr3/tmp/bsvc-2.1/bin/xtermpipe PortBCommand = }}
|
||||
COMMAND {AttachDevice 0 Timer {BaseAddress = 72001 IRQ = 5}}
|
||||
|
||||
Reference in New Issue
Block a user