2000-10-18 Charles-Antoine Gauthier <charles.gauthier@nrc.ca>

* console/console.c, console/serial_mouse.c, include/bsp.h:
	Add the ability to set parity, number of data bits and
	number of stop bits to the existing i386 serial drivers.
This commit is contained in:
Joel Sherrill
2000-10-18 15:51:41 +00:00
parent 1fc2292d35
commit 664db30bd3
4 changed files with 80 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
2000-10-18 Charles-Antoine Gauthier <charles.gauthier@nrc.ca>
* console/console.c, console/serial_mouse.c, include/bsp.h:
Add the ability to set parity, number of data bits and
number of stop bits to the existing i386 serial drivers.
2000-10-17 Joel Sherrill <joel@OARcorp.com> 2000-10-17 Joel Sherrill <joel@OARcorp.com>
* startup/Makefile.am: Added idt.c since it has been moved libcpu/i386 * startup/Makefile.am: Added idt.c since it has been moved libcpu/i386

View File

@@ -226,7 +226,7 @@ console_initialize(rtems_device_major_number major,
* Do device-specific initialization * Do device-specific initialization
*/ */
/* 9600-8-N-1 */ /* 9600-8-N-1 */
BSP_uart_init(BSPConsolePort, 9600, 0); BSP_uart_init(BSPConsolePort, 9600, CHR_8_BITS, 0, 0, 0);
/* Set interrupt handler */ /* Set interrupt handler */
@@ -454,7 +454,7 @@ console_control(rtems_device_major_number major,
static int static int
conSetAttr(int minor, const struct termios *t) conSetAttr(int minor, const struct termios *t)
{ {
int baud; unsigned long baud, databits, parity, stopbits;
switch (t->c_cflag & CBAUD) switch (t->c_cflag & CBAUD)
{ {
@@ -510,12 +510,43 @@ conSetAttr(int minor, const struct termios *t)
baud = 115200; baud = 115200;
break; break;
default: default:
baud = 0;
rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR); rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
return 0; return 0;
} }
BSP_uart_set_baud(BSPConsolePort, baud); if (t->c_cflag & PARENB) {
/* Parity is enabled */
if (t->c_cflag & PARODD) {
/* Parity is odd */
parity = PEN;
}
else {
/* Parity is even */
parity = PEN | EPS;
}
}
else {
/* No parity */
parity = 0;
}
switch (t->c_cflag & CSIZE) {
case CS5: databits = CHR_5_BITS; break;
case CS6: databits = CHR_6_BITS; break;
case CS7: databits = CHR_7_BITS; break;
case CS8: databits = CHR_8_BITS; break;
}
if (t->c_cflag & CSTOPB) {
/* 2 stop bits */
stopbits = STB;
}
else {
/* 1 stop bit */
stopbits = 0;
}
BSP_uart_set_attributes(BSPConsolePort, baud, databits, parity, stopbits);
return 0; return 0;
} }

View File

@@ -18,6 +18,39 @@
* MODIFICATION/HISTORY: * MODIFICATION/HISTORY:
* *
* $Log$ * $Log$
* Revision 1.1 2000/08/30 08:15:30 joel
* 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
*
* * Major rework of the "/dev/console" driver.
* * Added termios support for stdin ( keyboard ).
* * Added ioctls() to support modes similar to Linux( XLATE,
* RAW, MEDIUMRAW ).
* * Added Keyboard mapping and handling of the keyboard's leds.
* * Added Micro FrameBuffer driver ( "/dev/fb0" ) for bare VGA
* controller ( 16 colors ).
* * Added PS/2 and Serial mouse support for PC386 BSP.
* * console/defkeymap.c: New file.
* * console/fb_vga.c: New file.
* * console/fb_vga.h: New file.
* * console/i386kbd.h: New file.
* * console/kd.h: New file.
* * console/keyboard.c: New file.
* * console/keyboard.h: New file.
* * console/mouse_parser.c: New file.
* * console/mouse_parser.h: New file.
* * console/pc_keyb.c: New file.
* * console/ps2_drv.h: New file.
* * console/ps2_mouse.c: New file.
* * console/ps2_mouse.h: New file.
* * console/serial_mouse.c: New file.
* * console/serial_mouse.h: New file.
* * console/vgainit.c: New file.
* * console/vt.c: New file.
* * console/Makefile.am: Reflect new files.
* * console/console.c, console/inch.c, console/outch.c: Console
* functionality modifications.
* * startup/Makefile.am: Pick up tty_drv.c and gdb_glue.c
*
****************************************************************************/ ****************************************************************************/
#include <stdio.h> #include <stdio.h>
@@ -126,7 +159,7 @@ serial_mouse_initialize(rtems_device_major_number major,
* Do device-specific initialization * Do device-specific initialization
*/ */
/* 9600-8-N-1, without hardware flow control */ /* 9600-8-N-1, without hardware flow control */
BSP_uart_init( BSP_UART_PORT, 1200, 0 ); BSP_uart_init( BSP_UART_PORT, 1200, CHR_8_BITS, 0, 0, 0 );
status = BSP_install_rtems_irq_handler( &serial_mouse_isr_data ); status = BSP_install_rtems_irq_handler( &serial_mouse_isr_data );
if( !status ) if( !status )
{ {

View File

@@ -60,7 +60,12 @@ extern "C" {
*/ */
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1 #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1
#if STACK_MINIMUM_SIZE < (4 * 1024)
#define CONFIGURE_INTERRUPT_STACK_MEMORY (4 * 1024) #define CONFIGURE_INTERRUPT_STACK_MEMORY (4 * 1024)
#else
#define CONFIGURE_INTERRUPT_STACK_MEMORY STACK_MINIMUM_SIZE
#endif
/* /*
* Network driver configuration * Network driver configuration