From c961d15254b41bb567965245b59670f11b8ee8b0 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Fri, 15 Feb 2008 07:04:45 +0000 Subject: =?UTF-8?q?2008-02-15=09Ralf=20Cors=C3=A9pius=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * clock/ckinit.c, console/duart.c, timer/timer.c: Reflect changes to rtems/motorola/*.h. --- c/src/lib/libbsp/m68k/idp/ChangeLog | 5 +++++ c/src/lib/libbsp/m68k/idp/clock/ckinit.c | 26 +++++++++++------------ c/src/lib/libbsp/m68k/idp/console/duart.c | 16 +++++++-------- c/src/lib/libbsp/m68k/idp/timer/timer.c | 34 +++++++++++++++---------------- 4 files changed, 43 insertions(+), 38 deletions(-) (limited to 'c/src/lib/libbsp/m68k') diff --git a/c/src/lib/libbsp/m68k/idp/ChangeLog b/c/src/lib/libbsp/m68k/idp/ChangeLog index 37ea65c3b2..ff77855442 100644 --- a/c/src/lib/libbsp/m68k/idp/ChangeLog +++ b/c/src/lib/libbsp/m68k/idp/ChangeLog @@ -1,3 +1,8 @@ +2008-02-15 Ralf Corsépius + + * clock/ckinit.c, console/duart.c, timer/timer.c: Reflect changes + to rtems/motorola/*.h. + 2007-12-11 Joel Sherrill * clock/ckinit.c, include/bsp.h, startup/bspstart.c: Eliminate copies diff --git a/c/src/lib/libbsp/m68k/idp/clock/ckinit.c b/c/src/lib/libbsp/m68k/idp/clock/ckinit.c index 603a382edf..435442422f 100644 --- a/c/src/lib/libbsp/m68k/idp/clock/ckinit.c +++ b/c/src/lib/libbsp/m68k/idp/clock/ckinit.c @@ -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 */ } diff --git a/c/src/lib/libbsp/m68k/idp/console/duart.c b/c/src/lib/libbsp/m68k/idp/console/duart.c index 6249a5fb88..8e4304f880 100644 --- a/c/src/lib/libbsp/m68k/idp/console/duart.c +++ b/c/src/lib/libbsp/m68k/idp/console/duart.c @@ -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; /* diff --git a/c/src/lib/libbsp/m68k/idp/timer/timer.c b/c/src/lib/libbsp/m68k/idp/timer/timer.c index 934bdc9db4..d721fbb348 100644 --- a/c/src/lib/libbsp/m68k/idp/timer/timer.c +++ b/c/src/lib/libbsp/m68k/idp/timer/timer.c @@ -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 ) -- cgit v1.2.3