forked from Imagelibrary/rtems
2008-02-15 Ralf Corsépius <ralf.corsepius@rtems.org>
* clock/ckinit.c, console/duart.c, timer/timer.c: Reflect changes to rtems/motorola/*.h.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2008-02-15 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
|
* clock/ckinit.c, console/duart.c, timer/timer.c: Reflect changes
|
||||||
|
to rtems/motorola/*.h.
|
||||||
|
|
||||||
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
|
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* clock/ckinit.c, include/bsp.h, startup/bspstart.c: Eliminate copies
|
* clock/ckinit.c, include/bsp.h, startup/bspstart.c: Eliminate copies
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ rtems_isr Clock_isr(
|
|||||||
{
|
{
|
||||||
Clock_driver_ticks += 1;
|
Clock_driver_ticks += 1;
|
||||||
/* acknowledge interrupt
|
/* acknowledge interrupt
|
||||||
TSR = 1; */
|
MC68230_TSR = 1; */
|
||||||
MC68230_WRITE (TSR, 1);
|
MC68230_WRITE (MC68230_TSR, 1);
|
||||||
|
|
||||||
if ( Clock_isrs == 1 ) {
|
if ( Clock_isrs == 1 ) {
|
||||||
rtems_clock_tick();
|
rtems_clock_tick();
|
||||||
@@ -86,7 +86,7 @@ rtems_isr Clock_isr(
|
|||||||
void Disable_clock()
|
void Disable_clock()
|
||||||
{
|
{
|
||||||
/* Disable timer */
|
/* Disable timer */
|
||||||
MC68230_WRITE (TCR, 0x00);
|
MC68230_WRITE (MC68230_TCR, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Install_clock( clock_isr )
|
void Install_clock( clock_isr )
|
||||||
@@ -99,26 +99,26 @@ rtems_isr_entry clock_isr;
|
|||||||
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
|
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
|
||||||
|
|
||||||
/* Disable timer for initialization */
|
/* Disable timer for initialization */
|
||||||
MC68230_WRITE (TCR, 0x00);
|
MC68230_WRITE (MC68230_TCR, 0x00);
|
||||||
|
|
||||||
/* some PI/T initialization stuff here -- see comment in the ckisr.c
|
/* some PI/T initialization stuff here -- see comment in the ckisr.c
|
||||||
file in this directory to understand why I use the values that I do */
|
file in this directory to understand why I use the values that I do */
|
||||||
/* Set up the interrupt vector on the MC68230 chip:
|
/* Set up the interrupt vector on the MC68230 chip:
|
||||||
TIVR = CLOCK_VECTOR; */
|
MC68230_TIVR = CLOCK_VECTOR; */
|
||||||
MC68230_WRITE (TIVR, CLOCK_VECTOR);
|
MC68230_WRITE (MC68230_TIVR, CLOCK_VECTOR);
|
||||||
|
|
||||||
/* Set CPRH through CPRL to 193 (not 203) decimal for countdown--see ckisr.c
|
/* Set CPRH through CPRL to 193 (not 203) decimal for countdown--see ckisr.c
|
||||||
CPRH = 0x00;
|
CPRH = 0x00;
|
||||||
CPRM = 0x00;
|
CPRM = 0x00;
|
||||||
CPRL = 0xC1; */
|
CPRL = 0xC1; */
|
||||||
MC68230_WRITE (CPRH, 0x00);
|
MC68230_WRITE (MC68230_CPRH, 0x00);
|
||||||
MC68230_WRITE (CPRM, 0x00);
|
MC68230_WRITE (MC68230_CPRM, 0x00);
|
||||||
MC68230_WRITE (CPRL, 0xC1);
|
MC68230_WRITE (MC68230_CPRL, 0xC1);
|
||||||
|
|
||||||
/* Enable timer and use it as an external periodic interrupt generator
|
/* Enable timer and use it as an external periodic interrupt generator
|
||||||
TCR = 0xA1; */
|
MC68230_TCR = 0xA1; */
|
||||||
/* led_putnum('a'); * for debugging purposes */
|
/* led_putnum('a'); * for debugging purposes */
|
||||||
MC68230_WRITE (TCR, 0xA1);
|
MC68230_WRITE (MC68230_TCR, 0xA1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Schedule the clock cleanup routine to execute if the application exits.
|
* Schedule the clock cleanup routine to execute if the application exits.
|
||||||
@@ -134,8 +134,8 @@ void Clock_exit( void )
|
|||||||
/* disable timer
|
/* disable timer
|
||||||
data = TCR;
|
data = TCR;
|
||||||
TCR = (data & 0xFE); */
|
TCR = (data & 0xFE); */
|
||||||
MC68230_READ (TCR, data);
|
MC68230_READ (MC68230_TCR, data);
|
||||||
MC68230_WRITE (TCR, (data & 0xFE));
|
MC68230_WRITE (MC68230_TCR, (data & 0xFE));
|
||||||
|
|
||||||
/* do not restore old vector */
|
/* do not restore old vector */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ void init_pit()
|
|||||||
/*
|
/*
|
||||||
* install ISR for ports A and B
|
* install ISR for ports A and B
|
||||||
*/
|
*/
|
||||||
set_vector(C_Receive_ISR, (VECT+H3VECT), 1);
|
set_vector(C_Receive_ISR, (MC68230_VECT+MC68230_H3VECT), 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize pit
|
* initialize pit
|
||||||
@@ -70,12 +70,12 @@ void init_pit()
|
|||||||
* setup pivr
|
* setup pivr
|
||||||
* turn on all ports
|
* turn on all ports
|
||||||
*/
|
*/
|
||||||
MC68230_WRITE(PGCR, 0x00);
|
MC68230_WRITE(MC68230_PGCR, 0x00);
|
||||||
MC68230_WRITE(PSRR, 0x18);
|
MC68230_WRITE(MC68230_PSRR, 0x18);
|
||||||
MC68230_WRITE(PBDDR, 0x00);
|
MC68230_WRITE(MC68230_PBDDR, 0x00);
|
||||||
MC68230_WRITE(PBCR, 0x82);
|
MC68230_WRITE(MC68230_PBCR, 0x82);
|
||||||
MC68230_WRITE(PIVR, VECT);
|
MC68230_WRITE(MC68230_PIVR, MC68230_VECT);
|
||||||
MC68230_WRITE(PGCR, 0x20);
|
MC68230_WRITE(MC68230_PGCR, 0x20);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For some reason, the reset of receiver/transmitter only works for
|
* For some reason, the reset of receiver/transmitter only works for
|
||||||
@@ -186,7 +186,7 @@ rtems_isr C_Receive_ISR(rtems_vector_number vector)
|
|||||||
/*
|
/*
|
||||||
* Clear pit interrupt.
|
* Clear pit interrupt.
|
||||||
*/
|
*/
|
||||||
_addr = (unsigned char *) (PIT_ADDR + PITSR);
|
_addr = (unsigned char *) (MC68230_PIT_ADDR + MC68230_PITSR);
|
||||||
*_addr = 0x04;
|
*_addr = 0x04;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -45,19 +45,19 @@ void Timer_initialize()
|
|||||||
/* some PI/T initialization stuff here */
|
/* some PI/T initialization stuff here */
|
||||||
/* Set up the interrupt vector on the MC68230 chip:
|
/* Set up the interrupt vector on the MC68230 chip:
|
||||||
TIVR = TIMER_VECTOR; */
|
TIVR = TIMER_VECTOR; */
|
||||||
MC68230_WRITE (TIVR, TIMER_VECTOR);
|
MC68230_WRITE (MC68230_TIVR, TIMER_VECTOR);
|
||||||
|
|
||||||
/* Set CPRH through CPRL to maximum count to reduce interrupt overhead
|
/* Set CPRH through CPRL to maximum count to reduce interrupt overhead
|
||||||
CPRH = 0xFF;
|
CPRH = 0xFF;
|
||||||
CPRM = 0xFF;
|
CPRM = 0xFF;
|
||||||
CPRL = 0xFF; */
|
CPRL = 0xFF; */
|
||||||
MC68230_WRITE (CPRH, 0xFF);
|
MC68230_WRITE (MC68230_CPRH, 0xFF);
|
||||||
MC68230_WRITE (CPRM, 0xFF);
|
MC68230_WRITE (MC68230_CPRM, 0xFF);
|
||||||
MC68230_WRITE (CPRL, 0xFF);
|
MC68230_WRITE (MC68230_CPRL, 0xFF);
|
||||||
|
|
||||||
/* Enable timer and use it as an external periodic interrupt generator
|
/* Enable timer and use it as an external periodic interrupt generator
|
||||||
TCR = 0xA1; */
|
TCR = 0xA1; */
|
||||||
MC68230_WRITE (TCR, 0xA1);
|
MC68230_WRITE (MC68230_TCR, 0xA1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,26 +71,26 @@ int Read_timer()
|
|||||||
uint32_t remaining, total;
|
uint32_t remaining, total;
|
||||||
|
|
||||||
/* Disable timer so that timer can be read
|
/* Disable timer so that timer can be read
|
||||||
data = TCR;
|
data = MC68230_TCR;
|
||||||
TCR = (data & 0xFE); */
|
MC68230_TCR = (data & 0xFE); */
|
||||||
MC68230_READ (TCR, data);
|
MC68230_READ (MC68230_TCR, data);
|
||||||
MC68230_WRITE (TCR, (data & 0xFE));
|
MC68230_WRITE (MC68230_TCR, (data & 0xFE));
|
||||||
|
|
||||||
/* Read the counter value
|
/* Read the counter value
|
||||||
msb = CNTRH;
|
msb = MC68230_CNTRH;
|
||||||
osb = CNTRM;
|
osb = MC68230_CNTRM;
|
||||||
lsb = CNTRL; */
|
lsb = MC68230_CNTRL; */
|
||||||
MC68230_READ (CNTRH, msb);
|
MC68230_READ (MC68230_CNTRH, msb);
|
||||||
MC68230_READ (CNTRM, osb);
|
MC68230_READ (MC68230_CNTRM, osb);
|
||||||
MC68230_READ (CNTRL, lsb);
|
MC68230_READ (MC68230_CNTRL, lsb);
|
||||||
|
|
||||||
/* Calculate the time so far */
|
/* Calculate the time so far */
|
||||||
remaining = 0x1000000 - ((msb << 16) + (osb << 8) + lsb);
|
remaining = 0x1000000 - ((msb << 16) + (osb << 8) + lsb);
|
||||||
total = (Ttimer_val * 0x1000000) + remaining;
|
total = (Ttimer_val * 0x1000000) + remaining;
|
||||||
|
|
||||||
/* Enable timer so that timer can continue
|
/* Enable timer so that timer can continue
|
||||||
TCR = 0xA1; */
|
MC68230_TCR = 0xA1; */
|
||||||
MC68230_WRITE (TCR, 0xA1);
|
MC68230_WRITE (MC68230_TCR, 0xA1);
|
||||||
|
|
||||||
/* do not restore old vector */
|
/* do not restore old vector */
|
||||||
if ( Timer_driver_Find_average_overhead == 1 )
|
if ( Timer_driver_Find_average_overhead == 1 )
|
||||||
|
|||||||
Reference in New Issue
Block a user