diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-12-05 19:23:05 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-12-05 19:23:05 +0000 |
commit | e57b0e23d4781e597299281524f6395dae4a25ad (patch) | |
tree | e38d371378fd92931847deee5076c3b44d23ac83 /c/src/lib/libcpu/powerpc/ppc403/console | |
parent | bug fix in statistics from Tony Bennett (tbennett@divnc.com) (diff) | |
download | rtems-e57b0e23d4781e597299281524f6395dae4a25ad.tar.bz2 |
update from Andy Bray <andy@i-cubed.co.uk>
Diffstat (limited to 'c/src/lib/libcpu/powerpc/ppc403/console')
-rw-r--r-- | c/src/lib/libcpu/powerpc/ppc403/console/console.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c b/c/src/lib/libcpu/powerpc/ppc403/console/console.c index 8677b1fcf1..7a3b1b425a 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/console/console.c +++ b/c/src/lib/libcpu/powerpc/ppc403/console/console.c @@ -1,7 +1,7 @@ /* * This file contains the PowerPC 403GA console IO package. * - * Author: Andrew Bray <andy@i-cubed.demon.co.uk> + * Author: Andrew Bray <andy@i-cubed.co.uk> * * COPYRIGHT (c) 1995 by i-cubed ltd. * @@ -145,19 +145,19 @@ rtems_device_driver console_initialize( register unsigned tmp; /* Initialise the serial port */ - asm volatile ("mfiocr %0" : "=r" (tmp)); + asm volatile ("mfdcr %0, 0xa0" : "=r" (tmp)); /* IOCR */ tmp &= ~3; tmp |= (Cpu_table.serial_external_clock ? 2 : 0) | (Cpu_table.serial_cts_rts ? 1 : 0); - asm volatile ("mtiocr %0" : "=r" (tmp) : "0" (tmp)); + asm volatile ("mtdcr 0xa0, %0" : "=r" (tmp) : "0" (tmp)); /* IOCR */ port->SPLS = (LSRDataReady | LSRFramingError | LSROverrunError | - LSRParityError | LSRBreakInterrupt); + LSRParityError | LSRBreakInterrupt); tmp = Cpu_table.serial_per_sec / Cpu_table.serial_rate; tmp = ((tmp + 8) >> 4) - 1; port->BRDL = tmp & 0x255; port->BRDH = tmp >> 8; port->SPCTL = (CRNormal | CRDtr | CRRts | CRWordLength8 | CRParityDisable | - CRStopBitsOne); + CRStopBitsOne); port->SPRC = (RCREnable | RCRIntDisable | RCRPauseEnable); port->SPTC = (TCREnable | TCRIntDisable); port->SPHS = (HSRDsr | HSRCts); @@ -228,15 +228,15 @@ char inbyte( void ) while (1) { if ((status = port->SPLS) & LSRDataReady) - break; + break; /* Clean any dodgy status */ if ((status & (LSRFramingError | LSROverrunError | LSRParityError | LSRBreakInterrupt)) != 0) - { - port->SPLS = (LSRFramingError | LSROverrunError | LSRParityError | - LSRBreakInterrupt); - } + { + port->SPLS = (LSRFramingError | LSROverrunError | LSRParityError | + LSRBreakInterrupt); + } } return port->SPRB; @@ -269,19 +269,17 @@ void outbyte( if (port->SPHS) port->SPHS = (HSRDsr | HSRCts); else if (status & LSRTxHoldEmpty) - break; + break; } if (Cpu_table.serial_xon_xoff) while (is_character_ready(&status)) - { - if (status == XOFFchar) - do - { - while (!is_character_ready(&status)); - } - while (status != XONchar); - } + { + if (status == XOFFchar) + do { + while (!is_character_ready(&status)); + } while (status != XONchar); + } port->SPTB = ch; } |