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:
Ralf Corsepius
2008-02-15 07:04:45 +00:00
parent 465b1efc22
commit c961d15254
4 changed files with 43 additions and 38 deletions

View File

@@ -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>
* clock/ckinit.c, include/bsp.h, startup/bspstart.c: Eliminate copies

View File

@@ -67,8 +67,8 @@ rtems_isr Clock_isr(
{
Clock_driver_ticks += 1;
/* acknowledge interrupt
TSR = 1; */
MC68230_WRITE (TSR, 1);
MC68230_TSR = 1; */
MC68230_WRITE (MC68230_TSR, 1);
if ( Clock_isrs == 1 ) {
rtems_clock_tick();
@@ -86,7 +86,7 @@ rtems_isr Clock_isr(
void Disable_clock()
{
/* Disable timer */
MC68230_WRITE (TCR, 0x00);
MC68230_WRITE (MC68230_TCR, 0x00);
}
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 );
/* 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
file in this directory to understand why I use the values that I do */
/* Set up the interrupt vector on the MC68230 chip:
TIVR = CLOCK_VECTOR; */
MC68230_WRITE (TIVR, CLOCK_VECTOR);
MC68230_TIVR = CLOCK_VECTOR; */
MC68230_WRITE (MC68230_TIVR, CLOCK_VECTOR);
/* Set CPRH through CPRL to 193 (not 203) decimal for countdown--see ckisr.c
CPRH = 0x00;
CPRM = 0x00;
CPRL = 0xC1; */
MC68230_WRITE (CPRH, 0x00);
MC68230_WRITE (CPRM, 0x00);
MC68230_WRITE (CPRL, 0xC1);
MC68230_WRITE (MC68230_CPRH, 0x00);
MC68230_WRITE (MC68230_CPRM, 0x00);
MC68230_WRITE (MC68230_CPRL, 0xC1);
/* Enable timer and use it as an external periodic interrupt generator
TCR = 0xA1; */
MC68230_TCR = 0xA1; */
/* 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.
@@ -134,8 +134,8 @@ void Clock_exit( void )
/* disable timer
data = TCR;
TCR = (data & 0xFE); */
MC68230_READ (TCR, data);
MC68230_WRITE (TCR, (data & 0xFE));
MC68230_READ (MC68230_TCR, data);
MC68230_WRITE (MC68230_TCR, (data & 0xFE));
/* do not restore old vector */
}

View File

@@ -58,7 +58,7 @@ void init_pit()
/*
* 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
@@ -70,12 +70,12 @@ void init_pit()
* setup pivr
* turn on all ports
*/
MC68230_WRITE(PGCR, 0x00);
MC68230_WRITE(PSRR, 0x18);
MC68230_WRITE(PBDDR, 0x00);
MC68230_WRITE(PBCR, 0x82);
MC68230_WRITE(PIVR, VECT);
MC68230_WRITE(PGCR, 0x20);
MC68230_WRITE(MC68230_PGCR, 0x00);
MC68230_WRITE(MC68230_PSRR, 0x18);
MC68230_WRITE(MC68230_PBDDR, 0x00);
MC68230_WRITE(MC68230_PBCR, 0x82);
MC68230_WRITE(MC68230_PIVR, MC68230_VECT);
MC68230_WRITE(MC68230_PGCR, 0x20);
/*
* 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.
*/
_addr = (unsigned char *) (PIT_ADDR + PITSR);
_addr = (unsigned char *) (MC68230_PIT_ADDR + MC68230_PITSR);
*_addr = 0x04;
/*

View File

@@ -45,19 +45,19 @@ void Timer_initialize()
/* some PI/T initialization stuff here */
/* Set up the interrupt vector on the MC68230 chip:
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
CPRH = 0xFF;
CPRM = 0xFF;
CPRL = 0xFF; */
MC68230_WRITE (CPRH, 0xFF);
MC68230_WRITE (CPRM, 0xFF);
MC68230_WRITE (CPRL, 0xFF);
MC68230_WRITE (MC68230_CPRH, 0xFF);
MC68230_WRITE (MC68230_CPRM, 0xFF);
MC68230_WRITE (MC68230_CPRL, 0xFF);
/* Enable timer and use it as an external periodic interrupt generator
TCR = 0xA1; */
MC68230_WRITE (TCR, 0xA1);
MC68230_WRITE (MC68230_TCR, 0xA1);
}
@@ -71,26 +71,26 @@ int Read_timer()
uint32_t remaining, total;
/* Disable timer so that timer can be read
data = TCR;
TCR = (data & 0xFE); */
MC68230_READ (TCR, data);
MC68230_WRITE (TCR, (data & 0xFE));
data = MC68230_TCR;
MC68230_TCR = (data & 0xFE); */
MC68230_READ (MC68230_TCR, data);
MC68230_WRITE (MC68230_TCR, (data & 0xFE));
/* Read the counter value
msb = CNTRH;
osb = CNTRM;
lsb = CNTRL; */
MC68230_READ (CNTRH, msb);
MC68230_READ (CNTRM, osb);
MC68230_READ (CNTRL, lsb);
msb = MC68230_CNTRH;
osb = MC68230_CNTRM;
lsb = MC68230_CNTRL; */
MC68230_READ (MC68230_CNTRH, msb);
MC68230_READ (MC68230_CNTRM, osb);
MC68230_READ (MC68230_CNTRL, lsb);
/* Calculate the time so far */
remaining = 0x1000000 - ((msb << 16) + (osb << 8) + lsb);
total = (Ttimer_val * 0x1000000) + remaining;
/* Enable timer so that timer can continue
TCR = 0xA1; */
MC68230_WRITE (TCR, 0xA1);
MC68230_TCR = 0xA1; */
MC68230_WRITE (MC68230_TCR, 0xA1);
/* do not restore old vector */
if ( Timer_driver_Find_average_overhead == 1 )