-
From d9c4799c16abb6ff38a10cf6ced37b7ad3ba9049 Mon Sep 17 00:00:00 2001
From: Kevin Kirspel <kevin-kirspel@idexx.com>
Date: Thu, 2 Feb 2017 14:17:33 -0500
Subject: [PATCH 1/4] Adding new files for inclusion of FREEBSD termios
features. This will synchronize RTEMS with FREEBSD termios
---
c/src/lib/libbsp/arm/csb336/console/uart.c | 2 +-
c/src/lib/libbsp/arm/lpc32xx/console/hsu.c | 2 +-
c/src/lib/libbsp/i386/shared/comm/tty_drv.c | 2 +-
.../libbsp/lm32/shared/milkymist_console/console.c | 2 +-
c/src/lib/libbsp/m68k/av5282/console/console.c | 6 ++---
c/src/lib/libbsp/m68k/gen68340/console/console.c | 18 ++++----------
c/src/lib/libbsp/m68k/gen68360/console/console.c | 2 +-
c/src/lib/libbsp/m68k/genmcf548x/console/console.c | 2 +-
c/src/lib/libbsp/m68k/mcf52235/console/console.c | 8 ++++---
c/src/lib/libbsp/m68k/mcf5225x/console/console.c | 24 ++++++++++---------
c/src/lib/libbsp/m68k/mcf5235/console/console.c | 8 ++++---
c/src/lib/libbsp/m68k/mcf5329/console/console.c | 8 ++++---
c/src/lib/libbsp/m68k/mrm332/console/sci.c | 2 +-
c/src/lib/libbsp/m68k/mvme167/console/console.c | 8 +++----
c/src/lib/libbsp/m68k/uC5282/console/console.c | 4 ++--
c/src/lib/libbsp/powerpc/acinclude.m4 | 4 ++--
c/src/lib/libbsp/powerpc/gen5200/console/console.c | 2 +-
c/src/lib/libbsp/powerpc/shared/console/console.c | 2 +-
c/src/lib/libbsp/powerpc/tqm8xx/console/console.c | 2 +-
c/src/lib/libbsp/shared/console.c | 4 ++--
c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c | 8 +++----
c/src/lib/libcpu/arm/at91rm9200/usart/usart.c | 2 +-
c/src/lib/libcpu/bfin/serial/uart.c | 4 ++--
c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c | 2 +-
.../mpc5xx/console-generic/console-generic.c | 2 +-
.../mpc8260/console-generic/console-generic.c | 4 ++--
.../mpc8xx/console-generic/console-generic.c | 4 ++--
c/src/lib/libcpu/powerpc/ppc403/console/console.c | 2 +-
.../lib/libcpu/powerpc/ppc403/console/console405.c | 2 +-
c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c | 2 +-
c/src/lib/libcpu/sh/sh7032/sci/sci.c | 8 +++----
c/src/lib/libcpu/sh/sh7045/sci/sci.c | 6 ++---
c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c | 8 +++----
c/src/libchip/serial/mc68681.c | 2 +-
c/src/libchip/serial/mc68681_baud.c | 28 ++++++++++++++++++----
c/src/libchip/serial/z85c30.c | 2 +-
36 files changed, 108 insertions(+), 90 deletions(-)
mode change 100644 => 100755 c/src/lib/libbsp/arm/csb336/console/uart.c
mode change 100644 => 100755 c/src/lib/libbsp/arm/lpc32xx/console/hsu.c
mode change 100644 => 100755 c/src/lib/libbsp/i386/shared/comm/tty_drv.c
mode change 100644 => 100755 c/src/lib/libbsp/lm32/shared/milkymist_console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/av5282/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/gen68340/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/gen68360/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/genmcf548x/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/mcf52235/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/mcf5225x/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/mcf5235/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/mcf5329/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/mrm332/console/sci.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/mvme167/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/m68k/uC5282/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/powerpc/gen5200/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/powerpc/shared/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
mode change 100644 => 100755 c/src/lib/libbsp/shared/console.c
mode change 100644 => 100755 c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
mode change 100644 => 100755 c/src/lib/libcpu/arm/at91rm9200/usart/usart.c
mode change 100644 => 100755 c/src/lib/libcpu/bfin/serial/uart.c
mode change 100644 => 100755 c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c
mode change 100644 => 100755 c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c
mode change 100644 => 100755 c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c
mode change 100644 => 100755 c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c
mode change 100644 => 100755 c/src/lib/libcpu/powerpc/ppc403/console/console.c
mode change 100644 => 100755 c/src/lib/libcpu/powerpc/ppc403/console/console405.c
mode change 100644 => 100755 c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c
mode change 100644 => 100755 c/src/lib/libcpu/sh/sh7032/sci/sci.c
mode change 100644 => 100755 c/src/lib/libcpu/sh/sh7045/sci/sci.c
mode change 100644 => 100755 c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c
mode change 100644 => 100755 c/src/libchip/serial/mc68681.c
mode change 100644 => 100755 c/src/libchip/serial/mc68681_baud.c
mode change 100644 => 100755 c/src/libchip/serial/z85c30.c
diff --git a/c/src/lib/libbsp/arm/csb336/console/uart.c b/c/src/lib/libbsp/arm/csb336/console/uart.c
old mode 100644
new mode 100755
index 1f3a4a1..e2e6bc2
a
|
b
|
static int imx_uart_set_attrs(int minor, const struct termios *t) |
322 | 322 | { |
323 | 323 | int baud; |
324 | 324 | |
325 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 325 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
326 | 326 | imx_uart_set_baud(minor, baud); |
327 | 327 | |
328 | 328 | return 0; |
-
diff --git a/c/src/lib/libbsp/arm/lpc32xx/console/hsu.c b/c/src/lib/libbsp/arm/lpc32xx/console/hsu.c
old mode 100644
new mode 100755
index 8beeeef..b2044e0
a
|
b
|
static bool lpc32xx_hsu_set_attributes( |
178 | 178 | { |
179 | 179 | lpc32xx_hsu_context *ctx = (lpc32xx_hsu_context *) base; |
180 | 180 | volatile lpc32xx_hsu *hsu = ctx->hsu; |
181 | | int baud_flags = term->c_cflag & CBAUD; |
| 181 | int baud_flags = term->c_ospeed; |
182 | 182 | |
183 | 183 | if (baud_flags != 0) { |
184 | 184 | int32_t baud = rtems_termios_baud_to_number(baud_flags); |
-
diff --git a/c/src/lib/libbsp/i386/shared/comm/tty_drv.c b/c/src/lib/libbsp/i386/shared/comm/tty_drv.c
old mode 100644
new mode 100755
index 2152dec..e15edbd
a
|
b
|
conSetAttr(int port, int minor, const struct termios *t) |
227 | 227 | { |
228 | 228 | unsigned long baud, databits, parity, stopbits; |
229 | 229 | |
230 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 230 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
231 | 231 | if ( baud > 115200 ) |
232 | 232 | rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR); |
233 | 233 | |
-
diff --git a/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c b/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c
old mode 100644
new mode 100755
index 3558e33..de87233
a
|
b
|
static int mmconsole_set_attributes(int minor, const struct termios *t) |
41 | 41 | { |
42 | 42 | int baud; |
43 | 43 | |
44 | | switch (t->c_cflag & CBAUD) { |
| 44 | switch (t->c_ospeed) { |
45 | 45 | case B0: |
46 | 46 | baud = 0; |
47 | 47 | break; |
-
diff --git a/c/src/lib/libbsp/m68k/av5282/console/console.c b/c/src/lib/libbsp/m68k/av5282/console/console.c
old mode 100644
new mode 100755
index 07a1569..f56305a
a
|
b
|
static int IntUartSetAttributes( |
179 | 179 | /* check to see if input is valid */ |
180 | 180 | if ( t != (const struct termios *)0 ) { |
181 | 181 | /* determine baud rate index */ |
182 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 182 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
183 | 183 | |
184 | 184 | /* determine data bits */ |
185 | 185 | switch ( t->c_cflag & CSIZE ) { |
… |
… |
static int IntUartSetAttributes( |
240 | 240 | * Description : This is the interrupt handler for the internal uart. It |
241 | 241 | * determines which channel caused the interrupt before queueing any received |
242 | 242 | * chars and dequeueing chars waiting for transmission. |
243 | | */ |
| 243 | */ |
244 | 244 | static rtems_isr IntUartInterruptHandler(rtems_vector_number v) |
245 | 245 | { |
246 | 246 | unsigned int chan = v - UART_INTC0_IRQ_VECTOR(0); |
… |
… |
static rtems_isr IntUartInterruptHandler(rtems_vector_number v) |
303 | 303 | * Description : This initialises the internal uart hardware for all |
304 | 304 | * internal uarts. If the internal uart is to be interrupt driven then the |
305 | 305 | * interrupt vectors are hooked. |
306 | | */ |
| 306 | */ |
307 | 307 | static void IntUartInitialize(void) |
308 | 308 | { |
309 | 309 | unsigned int chan; |
-
diff --git a/c/src/lib/libbsp/m68k/gen68340/console/console.c b/c/src/lib/libbsp/m68k/gen68340/console/console.c
old mode 100644
new mode 100755
index dd38559..5bf2c5b
a
|
b
|
SetAttributes (int minor, const struct termios *t) |
474 | 474 | { |
475 | 475 | rtems_interrupt_level level; |
476 | 476 | float ispeed, ospeed; |
477 | | int isp, osp; |
478 | | |
479 | | /* output speed */ |
480 | | if (t->c_cflag & CBAUDEX) |
481 | | osp = (t->c_cflag & CBAUD) + CBAUD + 1; |
482 | | else |
483 | | osp = t->c_cflag & CBAUD; |
484 | | |
485 | | /* input speed */ |
486 | | isp = (t->c_cflag / (CIBAUD / CBAUD)) & CBAUD; |
487 | 477 | |
488 | 478 | /* convert it */ |
489 | | ispeed = rtems_termios_baud_to_number(isp); |
490 | | ospeed = rtems_termios_baud_to_number(osp); |
| 479 | ispeed = rtems_termios_baud_to_number(t->c_ispeed); |
| 480 | ospeed = rtems_termios_baud_to_number(t->c_ospeed); |
491 | 481 | |
492 | 482 | if (ispeed || ospeed) { |
493 | 483 | /* update config table */ |
… |
… |
SetAttributes (int minor, const struct termios *t) |
515 | 505 | } |
516 | 506 | |
517 | 507 | /* if serial module configuration has been changed */ |
518 | | if (t->c_cflag & (CBAUD | CIBAUD | CSIZE | PARENB)) { |
| 508 | if (t->c_cflag & (CSIZE | PARENB)) { |
519 | 509 | rtems_interrupt_disable(level); |
520 | 510 | /* reinit the UART */ |
521 | 511 | dbugInitialise(); |
… |
… |
rtems_device_driver console_control( |
693 | 683 | { |
694 | 684 | rtems_libio_ioctl_args_t *args = arg; |
695 | 685 | |
696 | | if (args->command == RTEMS_IO_SET_ATTRIBUTES) |
| 686 | if (args->command == TIOCSETA) |
697 | 687 | SetAttributes (minor, (struct termios *)args->buffer); |
698 | 688 | |
699 | 689 | return rtems_termios_ioctl (arg); |
-
diff --git a/c/src/lib/libbsp/m68k/gen68360/console/console.c b/c/src/lib/libbsp/m68k/gen68360/console/console.c
old mode 100644
new mode 100755
index 1a8ed00..36d8470
a
|
b
|
smc1SetAttributes (int minor, const struct termios *t) |
86 | 86 | { |
87 | 87 | int baud; |
88 | 88 | |
89 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 89 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
90 | 90 | if (baud > 0) |
91 | 91 | m360.brgc1 = smc1BRGC (baud); |
92 | 92 | return 0; |
-
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/console/console.c b/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
old mode 100644
new mode 100755
index 6891e76..23186fc
a
|
b
|
IntUartSetAttributes(int minor, const struct termios *t) |
307 | 307 | if ( t != (const struct termios *)0 ) |
308 | 308 | { |
309 | 309 | /* determine baud rate index */ |
310 | | baud = GetBaud( t->c_cflag & CBAUD ); |
| 310 | baud = GetBaud( t->c_ospeed ); |
311 | 311 | |
312 | 312 | /* determine data bits */ |
313 | 313 | switch ( t->c_cflag & CSIZE ) |
-
diff --git a/c/src/lib/libbsp/m68k/mcf52235/console/console.c b/c/src/lib/libbsp/m68k/mcf52235/console/console.c
old mode 100644
new mode 100755
index 50c642a..c2b6e36
a
|
b
|
static int IntUartSetAttributes(int minor, const struct termios *t) |
152 | 152 | /* check to see if input is valid */ |
153 | 153 | if (t != (const struct termios *) 0) { |
154 | 154 | /* determine baud rate index */ |
155 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 155 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
156 | 156 | |
157 | 157 | /* determine data bits */ |
158 | 158 | switch (t->c_cflag & CSIZE) { |
… |
… |
rtems_device_driver console_open(rtems_device_major_number major, |
598 | 598 | struct termios term; |
599 | 599 | |
600 | 600 | if (tcgetattr(STDIN_FILENO, &term) >= 0) { |
601 | | term.c_cflag &= ~(CBAUD | CSIZE); |
602 | | term.c_cflag |= CS8 | B19200; |
| 601 | term.c_cflag &= ~(CSIZE); |
| 602 | term.c_cflag |= CS8; |
| 603 | term.c_ispeed = B19200; |
| 604 | term.c_ospeed = B19200; |
603 | 605 | tcsetattr(STDIN_FILENO, TCSANOW, &term); |
604 | 606 | } |
605 | 607 | } |
-
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/console/console.c b/c/src/lib/libbsp/m68k/mcf5225x/console/console.c
old mode 100644
new mode 100755
index 63bb644..9e36e39
a
|
b
|
IntUartSet(int minor, int baud, int databits, int parity, int stopbits, |
150 | 150 | Description : This provides the hardware-dependent portion of tcsetattr(). |
151 | 151 | value and sets it. At the moment this just sets the baud rate. |
152 | 152 | |
153 | | Note: The highest baudrate is 115200 as this stays within |
| 153 | Note: The highest baudrate is 115200 as this stays within |
154 | 154 | an error of +/- 5% at 25MHz processor clock |
155 | 155 | ***************************************************************************/ |
156 | 156 | static int IntUartSetAttributes(int minor, const struct termios *t) |
… |
… |
static int IntUartSetAttributes(int minor, const struct termios *t) |
166 | 166 | /* check to see if input is valid */ |
167 | 167 | if (t != (const struct termios *) 0) { |
168 | 168 | /* determine baud rate index */ |
169 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 169 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
170 | 170 | |
171 | 171 | /* determine data bits */ |
172 | 172 | switch (t->c_cflag & CSIZE) { |
… |
… |
static rtems_isr IntUartInterruptHandler(rtems_vector_number v) |
243 | 243 | else |
244 | 244 | MCF_GPIO_PORTTC |= MCF_GPIO_PORTTC_PORTTC0; |
245 | 245 | #endif |
246 | | |
| 246 | |
247 | 247 | /* read data and put into the receive buffer */ |
248 | 248 | while (MCF_UART_USR(chan) & MCF_UART_USR_RXRDY) { |
249 | 249 | |
… |
… |
static void IntUartInitialize(void) |
359 | 359 | /*************************************************************************** |
360 | 360 | Function : IntUartInterruptWrite |
361 | 361 | |
362 | | Description : This writes a single character to the appropriate uart |
| 362 | Description : This writes a single character to the appropriate uart |
363 | 363 | channel. This is either called during an interrupt or in the user's task |
364 | | to initiate a transmit sequence. Calling this routine enables Tx |
| 364 | to initiate a transmit sequence. Calling this routine enables Tx |
365 | 365 | interrupts. |
366 | 366 | ***************************************************************************/ |
367 | 367 | static ssize_t IntUartInterruptWrite(int minor, const char *buf, size_t len) |
… |
… |
static int IntUartTaskRead(int minor) |
476 | 476 | /*************************************************************************** |
477 | 477 | Function : IntUartPollRead |
478 | 478 | |
479 | | Description : This reads a character from the internal uart. It returns |
| 479 | Description : This reads a character from the internal uart. It returns |
480 | 480 | to the caller without blocking if not character is waiting. |
481 | 481 | ***************************************************************************/ |
482 | 482 | static |
… |
… |
int IntUartPollRead(int minor) |
491 | 491 | /*************************************************************************** |
492 | 492 | Function : IntUartPollWrite |
493 | 493 | |
494 | | Description : This writes out each character in the buffer to the |
495 | | appropriate internal uart channel waiting till each one is sucessfully |
| 494 | Description : This writes out each character in the buffer to the |
| 495 | appropriate internal uart channel waiting till each one is sucessfully |
496 | 496 | transmitted. |
497 | 497 | ***************************************************************************/ |
498 | 498 | static ssize_t IntUartPollWrite(int minor, const char *buf, size_t len) |
… |
… |
rtems_device_driver console_initialize(rtems_device_major_number major, |
562 | 562 | /*************************************************************************** |
563 | 563 | Function : console_open |
564 | 564 | |
565 | | Description : This actually opens the device depending on the minor |
| 565 | Description : This actually opens the device depending on the minor |
566 | 566 | number set during initialisation. The device specific access routines are |
567 | 567 | passed to termios when the devices is opened depending on whether it is |
568 | 568 | polled or not. |
… |
… |
rtems_device_driver console_open(rtems_device_major_number major, |
631 | 631 | struct termios term; |
632 | 632 | |
633 | 633 | if (tcgetattr(STDIN_FILENO, &term) >= 0) { |
634 | | term.c_cflag &= ~(CBAUD | CSIZE); |
635 | | term.c_cflag |= CS8 | B115200; |
| 634 | term.c_cflag &= ~(CSIZE); |
| 635 | term.c_cflag |= CS8; |
| 636 | term.c_ispeed = B115200; |
| 637 | term.c_ospeed = B115200; |
636 | 638 | tcsetattr(STDIN_FILENO, TCSANOW, &term); |
637 | 639 | } |
638 | 640 | } |
-
diff --git a/c/src/lib/libbsp/m68k/mcf5235/console/console.c b/c/src/lib/libbsp/m68k/mcf5235/console/console.c
old mode 100644
new mode 100755
index 3f50b6a..6fd92aa
a
|
b
|
IntUartSetAttributes(int minor, const struct termios *t) |
174 | 174 | if ( t != (const struct termios *)0 ) |
175 | 175 | { |
176 | 176 | /* determine baud rate index */ |
177 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 177 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
178 | 178 | |
179 | 179 | /* determine data bits */ |
180 | 180 | switch ( t->c_cflag & CSIZE ) |
… |
… |
rtems_device_driver console_open( |
681 | 681 | struct termios term; |
682 | 682 | if (tcgetattr (STDIN_FILENO, &term) >= 0) |
683 | 683 | { |
684 | | term.c_cflag &= ~(CBAUD | CSIZE); |
685 | | term.c_cflag |= CS8 | B19200; |
| 684 | term.c_cflag &= ~(CSIZE); |
| 685 | term.c_cflag |= CS8; |
| 686 | term.c_ispeed = B19200; |
| 687 | term.c_ospeed = B19200; |
686 | 688 | tcsetattr (STDIN_FILENO, TCSANOW, &term); |
687 | 689 | } |
688 | 690 | } |
-
diff --git a/c/src/lib/libbsp/m68k/mcf5329/console/console.c b/c/src/lib/libbsp/m68k/mcf5329/console/console.c
old mode 100644
new mode 100755
index dfae857..ba4a7d9
a
|
b
|
static int IntUartSetAttributes(int minor, const struct termios *t) |
170 | 170 | /* check to see if input is valid */ |
171 | 171 | if (t != (const struct termios *) 0) { |
172 | 172 | /* determine baud rate index */ |
173 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 173 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
174 | 174 | |
175 | 175 | /* determine data bits */ |
176 | 176 | switch (t->c_cflag & CSIZE) { |
… |
… |
rtems_device_driver console_open(rtems_device_major_number major, |
613 | 613 | struct termios term; |
614 | 614 | |
615 | 615 | if (tcgetattr(STDIN_FILENO, &term) >= 0) { |
616 | | term.c_cflag &= ~(CBAUD | CSIZE); |
617 | | term.c_cflag |= CS8 | B19200; |
| 616 | term.c_cflag &= ~(CSIZE); |
| 617 | term.c_cflag |= CS8; |
| 618 | term.c_ispeed = B19200; |
| 619 | term.c_ospeed = B19200; |
618 | 620 | tcsetattr(STDIN_FILENO, TCSANOW, &term); |
619 | 621 | } |
620 | 622 | } |
-
diff --git a/c/src/lib/libbsp/m68k/mrm332/console/sci.c b/c/src/lib/libbsp/m68k/mrm332/console/sci.c
old mode 100644
new mode 100755
index a0f8cc0..4cd9f250
a
|
b
|
int SciSetAttributes( |
675 | 675 | /* if you look closely you will see this is the only thing we use */ |
676 | 676 | /* set the baud rate */ |
677 | 677 | |
678 | | baud_requested = t->c_cflag & CBAUD; /* baud rate */ |
| 678 | baud_requested = t->c_ospeed; /* baud rate */ |
679 | 679 | |
680 | 680 | if (!baud_requested) |
681 | 681 | { |
-
diff --git a/c/src/lib/libbsp/m68k/mvme167/console/console.c b/c/src/lib/libbsp/m68k/mvme167/console/console.c
old mode 100644
new mode 100755
index 9ac8f70..1e0935d
a
|
b
|
int cd2401_firstOpen( |
725 | 725 | * We could have made a tcgetattr() call if we had our fd. |
726 | 726 | */ |
727 | 727 | newarg.iop = args->iop; |
728 | | newarg.command = RTEMS_IO_GET_ATTRIBUTES; |
| 728 | newarg.command = TIOCGETA; |
729 | 729 | newarg.buffer = &termios; |
730 | 730 | sc = rtems_termios_ioctl (&newarg); |
731 | 731 | if (sc != RTEMS_SUCCESSFUL) |
… |
… |
int cd2401_firstOpen( |
738 | 738 | * on the ttyMutex that it already owns; this is safe in RTEMS. |
739 | 739 | */ |
740 | 740 | termios.c_cflag |= CLOCAL; /* Ignore modem status lines */ |
741 | | newarg.command = RTEMS_IO_SET_ATTRIBUTES; |
| 741 | newarg.command = TIOCSETA; |
742 | 742 | sc = rtems_termios_ioctl (&newarg); |
743 | 743 | if (sc != RTEMS_SUCCESSFUL) |
744 | 744 | rtems_fatal_error_occurred (sc); |
… |
… |
int cd2401_setAttributes( |
844 | 844 | /* Determine what the line parameters should be */ |
845 | 845 | |
846 | 846 | /* baud rates */ |
847 | | out_baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
848 | | in_baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 847 | out_baud = rtems_termios_baud_to_number(t->c_ospeed); |
| 848 | in_baud = rtems_termios_baud_to_number(t->c_ispeed); |
849 | 849 | |
850 | 850 | /* Number of bits per char */ |
851 | 851 | csize = 0x07; /* to avoid a warning */ |
-
diff --git a/c/src/lib/libbsp/m68k/uC5282/console/console.c b/c/src/lib/libbsp/m68k/uC5282/console/console.c
old mode 100644
new mode 100755
index 0f08cea..562e028
a
|
b
|
IntUartSetAttributes(int minor, const struct termios *t) |
190 | 190 | if ( t != (const struct termios *)0 ) |
191 | 191 | { |
192 | 192 | /* determine baud rate index */ |
193 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 193 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
194 | 194 | |
195 | 195 | /* determine data bits */ |
196 | 196 | switch ( t->c_cflag & CSIZE ) |
… |
… |
IntUartInterruptOpen(int major, int minor, void *arg) |
447 | 447 | MCF5282_GPIO_PUAPAR |= MCF5282_GPIO_PUAPAR_PUAPA3|MCF5282_GPIO_PUAPAR_PUAPA2; |
448 | 448 | break; |
449 | 449 | case 2: |
450 | | MCF5282_GPIO_PASPAR = |
| 450 | MCF5282_GPIO_PASPAR = |
451 | 451 | (MCF5282_GPIO_PASPAR |
452 | 452 | & ~(MCF5282_GPIO_PASPAR_PASPA3(3)|MCF5282_GPIO_PASPAR_PASPA2(3))) |
453 | 453 | | (MCF5282_GPIO_PASPAR_PASPA3(2)|MCF5282_GPIO_PASPAR_PASPA2(2)); |
-
diff --git a/c/src/lib/libbsp/powerpc/acinclude.m4 b/c/src/lib/libbsp/powerpc/acinclude.m4
index 4c83475..edc67b5 100644
a
|
b
|
AC_DEFUN([RTEMS_CHECK_BSPDIR], |
32 | 32 | AC_CONFIG_SUBDIRS([t32mppc]);; |
33 | 33 | tqm8xx ) |
34 | 34 | AC_CONFIG_SUBDIRS([tqm8xx]);; |
35 | | virtex ) |
36 | | AC_CONFIG_SUBDIRS([virtex]);; |
37 | 35 | virtex4 ) |
38 | 36 | AC_CONFIG_SUBDIRS([virtex4]);; |
39 | 37 | virtex5 ) |
40 | 38 | AC_CONFIG_SUBDIRS([virtex5]);; |
| 39 | virtex ) |
| 40 | AC_CONFIG_SUBDIRS([virtex]);; |
41 | 41 | *) |
42 | 42 | AC_MSG_ERROR([Invalid BSP]);; |
43 | 43 | esac |
-
diff --git a/c/src/lib/libbsp/powerpc/gen5200/console/console.c b/c/src/lib/libbsp/powerpc/gen5200/console/console.c
old mode 100644
new mode 100755
index 26f5558..754a527
a
|
b
|
static int mpc5200_psc_setAttributes( |
192 | 192 | (struct mpc5200_psc *)(&mpc5200.psc[psc_minor_to_regset[minor]]); |
193 | 193 | |
194 | 194 | /* Baud rate */ |
195 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 195 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
196 | 196 | if (baud > 0) { |
197 | 197 | /* |
198 | 198 | * Calculate baud rate |
-
diff --git a/c/src/lib/libbsp/powerpc/shared/console/console.c b/c/src/lib/libbsp/powerpc/shared/console/console.c
old mode 100644
new mode 100755
index 082cbd9..f275683
a
|
b
|
static int conSetAttr( |
304 | 304 | { |
305 | 305 | rtems_termios_baud_t baud; |
306 | 306 | |
307 | | baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD); |
| 307 | baud = rtems_termios_baud_to_number(t->c_ospeed); |
308 | 308 | if ( baud > 115200 ) |
309 | 309 | rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR); |
310 | 310 | |
-
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c b/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
old mode 100644
new mode 100755
index e0b4c70..e109303
a
|
b
|
sccSetAttributes (int minor, const struct termios *t) |
392 | 392 | { |
393 | 393 | int baud; |
394 | 394 | |
395 | | switch (t->c_cflag & CBAUD) { |
| 395 | switch (t->c_ospeed) { |
396 | 396 | default: baud = -1; break; |
397 | 397 | case B50: baud = 50; break; |
398 | 398 | case B75: baud = 75; break; |
-
diff --git a/c/src/lib/libbsp/shared/console.c b/c/src/lib/libbsp/shared/console.c
old mode 100644
new mode 100755
index b4af1b3..b8a078f
a
|
b
|
rtems_device_driver console_open( |
244 | 244 | * If this is not the console we do not want ECHO and so forth |
245 | 245 | */ |
246 | 246 | IoctlArgs.iop = args->iop; |
247 | | IoctlArgs.command = RTEMS_IO_GET_ATTRIBUTES; |
| 247 | IoctlArgs.command = TIOCGETA; |
248 | 248 | IoctlArgs.buffer = &Termios; |
249 | 249 | rtems_termios_ioctl( &IoctlArgs ); |
250 | 250 | |
251 | 251 | Termios.c_lflag = ICANON; |
252 | | IoctlArgs.command = RTEMS_IO_SET_ATTRIBUTES; |
| 252 | IoctlArgs.command = TIOCSETA; |
253 | 253 | rtems_termios_ioctl( &IoctlArgs ); |
254 | 254 | } |
255 | 255 | } |
-
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
old mode 100644
new mode 100755
index 50805f1..aa69670
a
|
b
|
|
39 | 39 | #ifdef DEBUG |
40 | 40 | #define DBG(x...) printk(x) |
41 | 41 | #else |
42 | | #define DBG(x...) |
| 42 | #define DBG(x...) |
43 | 43 | #endif |
44 | 44 | |
45 | 45 | /* LEON3 Low level transmit/receive functions provided by debug-uart code */ |
… |
… |
static int apbuart_info( |
85 | 85 | #define APBUART_INFO_FUNC NULL |
86 | 86 | #endif |
87 | 87 | |
88 | | struct drvmgr_drv_ops apbuart_ops = |
| 88 | struct drvmgr_drv_ops apbuart_ops = |
89 | 89 | { |
90 | 90 | .init = {apbuart_init1, NULL, NULL, NULL}, |
91 | 91 | .remove = NULL, |
… |
… |
int apbuart_set_attributes(int minor, const struct termios *t) |
567 | 567 | uart->regs->ctrl = ctrl; |
568 | 568 | |
569 | 569 | /* Baud rate */ |
570 | | baud = apbuart_baud_num2baud(t->c_cflag & CBAUD); |
| 570 | baud = apbuart_baud_num2baud(t->c_ospeed); |
571 | 571 | if (baud > 0){ |
572 | 572 | /* Get APBUART core frequency */ |
573 | 573 | drvmgr_freq_get(uart->dev, DEV_APB_SLV, &core_clk_hz); |
… |
… |
void apbuart_get_attributes(struct console_dev *condev, struct termios *t) |
588 | 588 | unsigned int ctrl; |
589 | 589 | struct apbuart_baud *baud; |
590 | 590 | |
591 | | t->c_cflag = t->c_cflag & ~(CSIZE|PARENB|PARODD|CLOCAL|CBAUD); |
| 591 | t->c_cflag = t->c_cflag & ~(CSIZE|PARENB|PARODD|CLOCAL); |
592 | 592 | |
593 | 593 | /* Hardware support only CS8 */ |
594 | 594 | t->c_cflag |= CS8; |
-
diff --git a/c/src/lib/libcpu/arm/at91rm9200/usart/usart.c b/c/src/lib/libcpu/arm/at91rm9200/usart/usart.c
old mode 100644
new mode 100755
index c552899..23b877c
a
|
b
|
static int usart_set_attributes(int minor, const struct termios *t) |
240 | 240 | } else |
241 | 241 | mode |= US_MR_PAR_NONE; |
242 | 242 | |
243 | | baud_requested = t->c_cflag & CBAUD; |
| 243 | baud_requested = t->c_ospeed; |
244 | 244 | |
245 | 245 | /* If not, set the dbgu console baud as USART baud default */ |
246 | 246 | if (!baud_requested) |
-
diff --git a/c/src/lib/libcpu/bfin/serial/uart.c b/c/src/lib/libcpu/bfin/serial/uart.c
old mode 100644
new mode 100755
index 79f0941..617c59d
a
|
b
|
|
9 | 9 | * found in the file LICENSE in this distribution or at |
10 | 10 | * http://www.rtems.org/license/LICENSE. |
11 | 11 | */ |
12 | | |
| 12 | |
13 | 13 | #include <rtems.h> |
14 | 14 | #include <rtems/libio.h> |
15 | 15 | #include <rtems/termiostypes.h> |
… |
… |
static int setAttributes(int minor, const struct termios *termios) |
159 | 159 | uint16_t lcr; |
160 | 160 | |
161 | 161 | base = uartsConfig->channels[minor].uart_baseAddress; |
162 | | switch (termios->c_cflag & CBAUD) { |
| 162 | switch (termios->c_ospeed) { |
163 | 163 | case B0: baud = 0; break; |
164 | 164 | case B50: baud = 50; break; |
165 | 165 | case B75: baud = 75; break; |
-
diff --git a/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c b/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c
old mode 100644
new mode 100755
index f8101d7..a500743b
a
|
b
|
static int mpc55xx_esci_termios_set_attributes( int minor, const struct termios |
362 | 362 | cr1.B.TE = 1; |
363 | 363 | |
364 | 364 | /* Baud rate */ |
365 | | switch (t->c_cflag & CBAUD) { |
| 365 | switch (t->c_ospeed) { |
366 | 366 | case B50: br = 50; break; |
367 | 367 | case B75: br = 75; break; |
368 | 368 | case B110: br = 110; break; |
-
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c
old mode 100644
new mode 100755
index 22fee2d..c1de9c5
a
|
b
|
m5xx_uart_setAttributes( |
190 | 190 | return RTEMS_INVALID_NUMBER; |
191 | 191 | |
192 | 192 | /* Baud rate */ |
193 | | baud = rtems_termios_baud_to_number( t->c_cflag & CBAUD ); |
| 193 | baud = rtems_termios_baud_to_number( t->c_ospeed ); |
194 | 194 | if (baud > 0) { |
195 | 195 | sccr0 &= ~QSMCM_SCI_BAUD(-1); |
196 | 196 | sccr0 |= QSMCM_SCI_BAUD((bsp_clock_speed + (16 * baud)) / (32 * baud)); |
-
diff --git a/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c
old mode 100644
new mode 100755
index e325acc..4bfb640
a
|
b
|
m8xx_smc_set_attributes (int minor, const struct termios *t) |
108 | 108 | uint16_t clen=0, cstopb, parenb, parodd, cread; |
109 | 109 | |
110 | 110 | /* Baud rate */ |
111 | | switch (t->c_cflag & CBAUD) { |
| 111 | switch (t->c_ospeed) { |
112 | 112 | default: baud = -1; break; |
113 | 113 | case B50: baud = 50; break; |
114 | 114 | case B75: baud = 75; break; |
… |
… |
m8xx_scc_set_attributes (int minor, const struct termios *t) |
221 | 221 | uint16_t csize=0, cstopb, parenb, parodd; |
222 | 222 | |
223 | 223 | /* Baud rate */ |
224 | | switch (t->c_cflag & CBAUD) { |
| 224 | switch (t->c_ospeed) { |
225 | 225 | default: baud = -1; break; |
226 | 226 | case B50: baud = 50; break; |
227 | 227 | case B75: baud = 75; break; |
-
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c
old mode 100644
new mode 100755
index d7fd8b4..e015a64
a
|
b
|
m8xx_smc_set_attributes (int minor, const struct termios *t) |
175 | 175 | uint16_t clen=0, cstopb, parenb, parodd, cread; |
176 | 176 | |
177 | 177 | /* Baud rate */ |
178 | | switch (t->c_cflag & CBAUD) { |
| 178 | switch (t->c_ospeed) { |
179 | 179 | default: baud = -1; break; |
180 | 180 | case B50: baud = 50; break; |
181 | 181 | case B75: baud = 75; break; |
… |
… |
m8xx_scc_set_attributes (int minor, const struct termios *t) |
271 | 271 | uint16_t csize=0, cstopb, parenb, parodd; |
272 | 272 | |
273 | 273 | /* Baud rate */ |
274 | | switch (t->c_cflag & CBAUD) { |
| 274 | switch (t->c_ospeed) { |
275 | 275 | default: baud = -1; break; |
276 | 276 | case B50: baud = 50; break; |
277 | 277 | case B75: baud = 75; break; |
-
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c b/c/src/lib/libcpu/powerpc/ppc403/console/console.c
old mode 100644
new mode 100755
index 0e74879..0e0bbd7
a
|
b
|
spiSetAttributes (int minor, const struct termios *t) |
224 | 224 | |
225 | 225 | /* FIXME: check c_cflag & CRTSCTS for hardware flowcontrol */ |
226 | 226 | /* FIXME: check and IMPLEMENT XON/XOFF */ |
227 | | switch (t->c_cflag & CBAUD) { |
| 227 | switch (t->c_ospeed) { |
228 | 228 | default: baud = -1; break; |
229 | 229 | case B50: baud = 50; break; |
230 | 230 | case B75: baud = 75; break; |
-
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console405.c b/c/src/lib/libcpu/powerpc/ppc403/console/console405.c
old mode 100644
new mode 100755
index cf93658..96c3534
a
|
b
|
spiSetAttributes (int minor, const struct termios *t) |
216 | 216 | |
217 | 217 | /* FIXME: check c_cflag & CRTSCTS for hardware flowcontrol */ |
218 | 218 | /* FIXME: check and IMPLEMENT XON/XOFF */ |
219 | | switch (t->c_cflag & CBAUD) { |
| 219 | switch (t->c_ospeed) { |
220 | 220 | default: baud = -1; break; |
221 | 221 | case B50: baud = 50; break; |
222 | 222 | case B75: baud = 75; break; |
-
diff --git a/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c b/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c
old mode 100644
new mode 100755
index 1d7b013..3e79bbf
a
|
b
|
tty0SetAttributes (int minor, const struct termios *t) |
181 | 181 | |
182 | 182 | /* FIXME: check c_cflag & CRTSCTS for hardware flow control */ |
183 | 183 | /* FIXME: check and IMPLEMENT XON/XOFF */ |
184 | | switch (t->c_cflag & CBAUD) { |
| 184 | switch (t->c_ospeed) { |
185 | 185 | default: baud = -1; break; |
186 | 186 | case B50: baud = 50; break; |
187 | 187 | case B75: baud = 75; break; |
-
diff --git a/c/src/lib/libcpu/sh/sh7032/sci/sci.c b/c/src/lib/libcpu/sh/sh7032/sci/sci.c
old mode 100644
new mode 100755
index c9db0fe..8a099cf
a
|
b
|
struct scidev_t { |
54 | 54 | |
55 | 55 | /* imported from scitab.rel */ |
56 | 56 | extern int _sci_get_brparms( |
57 | | tcflag_t cflag, |
| 57 | speed_t spd, |
58 | 58 | unsigned char *smr, |
59 | 59 | unsigned char *brr ); |
60 | 60 | |
61 | 61 | /* Translate termios' tcflag_t into sci settings */ |
62 | 62 | static int _sci_set_cflags( |
63 | 63 | struct scidev_t *sci_dev, |
64 | | tcflag_t c_cflag ) |
| 64 | speed_t spd ) |
65 | 65 | { |
66 | 66 | uint8_t smr ; |
67 | 67 | uint8_t brr ; |
68 | 68 | |
69 | | if ( c_cflag & CBAUD ) |
| 69 | if ( spd ) |
70 | 70 | { |
71 | | if ( _sci_get_brparms( c_cflag, &smr, &brr ) != 0 ) |
| 71 | if ( _sci_get_brparms( spd, &smr, &brr ) != 0 ) |
72 | 72 | return -1 ; |
73 | 73 | } |
74 | 74 | |
-
diff --git a/c/src/lib/libcpu/sh/sh7045/sci/sci.c b/c/src/lib/libcpu/sh/sh7045/sci/sci.c
old mode 100644
new mode 100755
index 690035a..882eb45
a
|
b
|
static sci_setup_t sio_param[2]; |
96 | 96 | /* Translate termios' tcflag_t into sci settings */ |
97 | 97 | static int _sci_set_cflags( |
98 | 98 | struct scidev_t *sci_dev, |
99 | | tcflag_t c_cflag |
| 99 | speed_t spd |
100 | 100 | ) |
101 | 101 | { |
102 | 102 | uint8_t smr; |
103 | 103 | uint8_t brr; |
104 | 104 | |
105 | | if ( c_cflag & CBAUD ) |
| 105 | if ( spd ) |
106 | 106 | { |
107 | | if ( _sci_get_brparms( c_cflag, &smr, &brr ) != 0 ) |
| 107 | if ( _sci_get_brparms( spd, &smr, &brr ) != 0 ) |
108 | 108 | return -1; |
109 | 109 | } |
110 | 110 | |
-
diff --git a/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c b/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c
old mode 100644
new mode 100755
index db9040e..645a433
a
|
b
|
|
59 | 59 | * Automatically generated function imported from scitab.rel |
60 | 60 | */ |
61 | 61 | extern int _sci_get_brparms( |
62 | | tcflag_t cflag, |
| 62 | speed_t spd, |
63 | 63 | unsigned char *smr, |
64 | 64 | unsigned char *brr |
65 | 65 | ); |
… |
… |
int sh_sci_set_attributes( |
76 | 76 | uint8_t brr; |
77 | 77 | int a; |
78 | 78 | |
79 | | tcflag_t c_cflag = t->c_cflag; |
| 79 | speed_t spd = t->c_ospeed; |
80 | 80 | |
81 | | if ( c_cflag & CBAUD ) { |
82 | | if ( _sci_get_brparms( c_cflag, &smr, &brr ) != 0 ) |
| 81 | if ( spd ) { |
| 82 | if ( _sci_get_brparms( spd, &smr, &brr ) != 0 ) |
83 | 83 | return -1 ; |
84 | 84 | } |
85 | 85 | |
-
diff --git a/c/src/libchip/serial/mc68681.c b/c/src/libchip/serial/mc68681.c
old mode 100644
new mode 100755
index afa850e..a9ca05d
a
|
b
|
MC68681_STATIC int mc68681_baud_rate( |
581 | 581 | break; |
582 | 582 | } |
583 | 583 | |
584 | | baud_requested = baud & CBAUD; |
| 584 | baud_requested = baud; |
585 | 585 | if (!baud_requested) |
586 | 586 | baud_requested = B9600; /* default to 9600 baud */ |
587 | 587 | |
-
diff --git a/c/src/libchip/serial/mc68681_baud.c b/c/src/libchip/serial/mc68681_baud.c
old mode 100644
new mode 100755
index a27e6c9..0f8e87c
a
|
b
|
mc68681_baud_t mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { |
30 | 30 | 0x0B, /* B9600 */ |
31 | 31 | MC68681_BAUD_NOT_VALID, /* B19200 */ |
32 | 32 | 0x0C, /* B38400 */ |
| 33 | MC68681_BAUD_NOT_VALID, /* B7200 */ |
| 34 | MC68681_BAUD_NOT_VALID, /* B14400 */ |
| 35 | MC68681_BAUD_NOT_VALID, /* B28800 */ |
33 | 36 | MC68681_BAUD_NOT_VALID, /* B57600 */ |
| 37 | MC68681_BAUD_NOT_VALID, /* B76800 */ |
34 | 38 | MC68681_BAUD_NOT_VALID, /* B115200 */ |
35 | 39 | MC68681_BAUD_NOT_VALID, /* B230400 */ |
36 | | MC68681_BAUD_NOT_VALID /* B460800 */ |
| 40 | MC68681_BAUD_NOT_VALID, /* B460800 */ |
| 41 | MC68681_BAUD_NOT_VALID /* B921600 */ |
37 | 42 | }, |
38 | 43 | { /* ACR[7] = 1, X = 0 */ |
39 | 44 | MC68681_BAUD_NOT_VALID, /* B0 */ |
… |
… |
mc68681_baud_t mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { |
52 | 57 | 0x0B, /* B9600 */ |
53 | 58 | 0x0C, /* B19200 */ |
54 | 59 | MC68681_BAUD_NOT_VALID, /* B38400 */ |
| 60 | MC68681_BAUD_NOT_VALID, /* B7200 */ |
| 61 | MC68681_BAUD_NOT_VALID, /* B14400 */ |
| 62 | MC68681_BAUD_NOT_VALID, /* B28800 */ |
55 | 63 | MC68681_BAUD_NOT_VALID, /* B57600 */ |
| 64 | MC68681_BAUD_NOT_VALID, /* B76800 */ |
56 | 65 | MC68681_BAUD_NOT_VALID, /* B115200 */ |
57 | 66 | MC68681_BAUD_NOT_VALID, /* B230400 */ |
58 | | MC68681_BAUD_NOT_VALID /* B460800 */ |
| 67 | MC68681_BAUD_NOT_VALID, /* B460800 */ |
| 68 | MC68681_BAUD_NOT_VALID /* B921600 */ |
59 | 69 | }, |
60 | 70 | { /* ACR[7] = 0, X = 1 */ |
61 | 71 | MC68681_BAUD_NOT_VALID, /* B0 */ |
… |
… |
mc68681_baud_t mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { |
74 | 84 | 0x0B, /* B9600 */ |
75 | 85 | 0x0C, /* B19200 */ |
76 | 86 | MC68681_BAUD_NOT_VALID, /* B38400 */ |
| 87 | MC68681_BAUD_NOT_VALID, /* B7200 */ |
| 88 | MC68681_BAUD_NOT_VALID, /* B14400 */ |
| 89 | MC68681_BAUD_NOT_VALID, /* B28800 */ |
77 | 90 | 0x07, /* B57600 */ |
| 91 | MC68681_BAUD_NOT_VALID, /* B76800 */ |
78 | 92 | 0x08, /* B115200 */ |
79 | 93 | MC68681_BAUD_NOT_VALID, /* B230400 */ |
80 | | MC68681_BAUD_NOT_VALID /* B460800 */ |
| 94 | MC68681_BAUD_NOT_VALID, /* B460800 */ |
| 95 | MC68681_BAUD_NOT_VALID /* B921600 */ |
81 | 96 | }, |
82 | 97 | { /* ACR[7] = 1, X = 1 */ |
83 | 98 | MC68681_BAUD_NOT_VALID, /* B0 */ |
… |
… |
mc68681_baud_t mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { |
96 | 111 | 0x0B, /* B9600 */ |
97 | 112 | MC68681_BAUD_NOT_VALID, /* B19200 */ |
98 | 113 | 0x0C, /* B38400 */ |
| 114 | MC68681_BAUD_NOT_VALID, /* B7200 */ |
| 115 | MC68681_BAUD_NOT_VALID, /* B14400 */ |
| 116 | MC68681_BAUD_NOT_VALID, /* B28800 */ |
99 | 117 | 0x07, /* B57600 */ |
| 118 | MC68681_BAUD_NOT_VALID, /* B76800 */ |
100 | 119 | 0x08, /* B115200 */ |
101 | 120 | MC68681_BAUD_NOT_VALID, /* B230400 */ |
102 | | MC68681_BAUD_NOT_VALID /* B460800 */ |
| 121 | MC68681_BAUD_NOT_VALID, /* B460800 */ |
| 122 | MC68681_BAUD_NOT_VALID /* B921600 */ |
103 | 123 | }, |
104 | 124 | }; |
-
diff --git a/c/src/libchip/serial/z85c30.c b/c/src/libchip/serial/z85c30.c
old mode 100644
new mode 100755
index 7c55a51..55df9d3
a
|
b
|
Z85C30_STATIC int z85c30_set_attributes( |
449 | 449 | * Assert ensures there is no division by 0. |
450 | 450 | */ |
451 | 451 | |
452 | | baud_requested = t->c_cflag & CBAUD; |
| 452 | baud_requested = t->c_ospeed; |
453 | 453 | if (!baud_requested) |
454 | 454 | baud_requested = B9600; /* default to 9600 baud */ |
455 | 455 | |