summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-04-03 12:51:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-04-03 14:07:58 +0200
commit1301468b5a6e1080ba94ab4ca763c7e8e5c223e4 (patch)
treec96fd5f7e874294c2834a0d230082ad7a79eb0bb
parent36f0ac20b6ea45e9b3f7f9e2a8119f7e98eef1ed (diff)
downloadrtems-1301468b5a6e1080ba94ab4ca763c7e8e5c223e4.tar.bz2
bsps: Fix baud settings
Update #2897.
-rw-r--r--c/src/lib/libbsp/arm/atsam/console/console.c4
-rw-r--r--c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-esci.c2
-rw-r--r--c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-linflex.c2
-rw-r--r--c/src/lib/libbsp/sparc/shared/uart/apbuart_termios.c2
-rw-r--r--c/src/libchip/serial/ns16550-context.c2
-rw-r--r--c/src/libchip/serial/ns16550.c2
-rw-r--r--cpukit/dev/serial/sc16is752.c2
-rw-r--r--cpukit/libcsupport/include/rtems/termiostypes.h6
8 files changed, 10 insertions, 12 deletions
diff --git a/c/src/lib/libbsp/arm/atsam/console/console.c b/c/src/lib/libbsp/arm/atsam/console/console.c
index 84cfea86e8..d51d2ace7d 100644
--- a/c/src/lib/libbsp/arm/atsam/console/console.c
+++ b/c/src/lib/libbsp/arm/atsam/console/console.c
@@ -88,7 +88,7 @@ static bool atsam_usart_set_attributes(
rtems_termios_baud_t baud;
uint32_t mr;
- baud = rtems_termios_baud_to_number(term->c_cflag);
+ baud = rtems_termios_baud_to_number(term->c_ospeed);
regs->US_BRGR = (BOARD_MCK / baud) / 16;
if ((term->c_cflag & CREAD) != 0) {
@@ -327,7 +327,7 @@ static bool atsam_uart_set_attributes(
rtems_termios_baud_t baud;
uint32_t mr;
- baud = rtems_termios_baud_to_number(term->c_cflag);
+ baud = rtems_termios_baud_to_number(term->c_ospeed);
regs->UART_BRGR = (BOARD_MCK / baud) / 16;
if ((term->c_cflag & CREAD) != 0) {
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-esci.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-esci.c
index 8ad7edbc44..9e6646fb65 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-esci.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-esci.c
@@ -190,7 +190,7 @@ static int mpc55xx_esci_set_attributes(int minor, const struct termios *t)
volatile struct ESCI_tag *regs = self->regs;
union ESCI_CR1_tag cr1 = { .R = regs->CR1.R };
union ESCI_CR2_tag cr2 = MPC55XX_ZERO_FLAGS;
- rtems_termios_baud_t br = rtems_termios_baud_to_number(t->c_cflag);
+ rtems_termios_baud_t br = rtems_termios_baud_to_number(t->c_ospeed);
/* Enable module */
cr2.B.MDIS = 0;
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-linflex.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-linflex.c
index 9aed2a639c..02978be524 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-linflex.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/console/console-linflex.c
@@ -174,7 +174,7 @@ static int mpc55xx_linflex_set_attributes(int minor, const struct termios *t)
LINFLEX_UARTCR_32B_tag uartcr = { .R = 0 };
LINFLEX_GCR_32B_tag gcr = { .R = 0 };
LINFLEX_LINIER_32B_tag ier = { .R = 0 };
- rtems_termios_baud_t br = rtems_termios_baud_to_number(t->c_cflag);
+ rtems_termios_baud_t br = rtems_termios_baud_to_number(t->c_ospeed);
LINFLEX_LINFBRR_32B_tag fbrr = { .R = 0 };
LINFLEX_LINIBRR_32B_tag ibrr = { .R = 0 };
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_termios.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_termios.c
index 21f2e834cb..28ece27d9d 100644
--- a/c/src/lib/libbsp/sparc/shared/uart/apbuart_termios.c
+++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_termios.c
@@ -148,7 +148,7 @@ static bool apbuart_set_attributes(
rtems_termios_device_lock_release(base, &lock_context);
/* Baud rate */
- baud = rtems_termios_baud_to_number(t->c_cflag);
+ baud = rtems_termios_baud_to_number(t->c_ospeed);
if (baud > 0) {
/* Calculate Baud rate generator "scaler" number */
scaler = (((uart->freq_hz * 10) / (baud * 8)) - 5) / 10;
diff --git a/c/src/libchip/serial/ns16550-context.c b/c/src/libchip/serial/ns16550-context.c
index 087627a1f7..4f0328d62e 100644
--- a/c/src/libchip/serial/ns16550-context.c
+++ b/c/src/libchip/serial/ns16550-context.c
@@ -596,7 +596,7 @@ static bool ns16550_set_attributes(
* Assert ensures there is no division by 0.
*/
- baud_requested = rtems_termios_baud_to_number(t->c_cflag);
+ baud_requested = rtems_termios_baud_to_number(t->c_ospeed);
_Assert( baud_requested != 0 );
ulBaudDivisor = NS16550_GetBaudDivisor(ctx, baud_requested);
diff --git a/c/src/libchip/serial/ns16550.c b/c/src/libchip/serial/ns16550.c
index 6473028692..c8d66defa4 100644
--- a/c/src/libchip/serial/ns16550.c
+++ b/c/src/libchip/serial/ns16550.c
@@ -535,7 +535,7 @@ int ns16550_set_attributes(
* Assert ensures there is no division by 0.
*/
- baud_requested = rtems_termios_baud_to_number(t->c_cflag);
+ baud_requested = rtems_termios_baud_to_number(t->c_ospeed);
_Assert( baud_requested != 0 );
ulBaudDivisor = NS16550_GetBaudDivisor(c, baud_requested);
diff --git a/cpukit/dev/serial/sc16is752.c b/cpukit/dev/serial/sc16is752.c
index 96fac30efc..74c3ad3d7a 100644
--- a/cpukit/dev/serial/sc16is752.c
+++ b/cpukit/dev/serial/sc16is752.c
@@ -148,7 +148,7 @@ static bool sc16is752_set_attributes(
ctx->lcr = 0;
- baud = rtems_termios_baud_to_number(term->c_cflag);
+ baud = rtems_termios_baud_to_number(term->c_ospeed);
baud_successful = set_baud(ctx, baud);
if (!baud_successful){
return false;
diff --git a/cpukit/libcsupport/include/rtems/termiostypes.h b/cpukit/libcsupport/include/rtems/termiostypes.h
index f68de0c12f..1140c6162d 100644
--- a/cpukit/libcsupport/include/rtems/termiostypes.h
+++ b/cpukit/libcsupport/include/rtems/termiostypes.h
@@ -530,14 +530,12 @@ extern const rtems_assoc_t rtems_termios_baud_table [];
speed_t rtems_termios_number_to_baud(rtems_termios_baud_t baud);
/**
- * @brief Convert Baud Part of Termios control flags to an integral Baud Value
- *
- * There is no need to mask the @a c_cflag with @c CBAUD.
+ * @brief Converts the baud flags to an integral baud value.
*
* @retval 0 Invalid baud value or a baud value of @c B0.
* @retval other Integral baud value.
*/
-rtems_termios_baud_t rtems_termios_baud_to_number(speed_t c_cflag);
+rtems_termios_baud_t rtems_termios_baud_to_number(speed_t baud);
/**
* @brief Convert Bxxx Constant to Index