bsps: Fix baud settings

Update #2897.
This commit is contained in:
Sebastian Huber
2017-04-03 12:51:51 +02:00
parent 36f0ac20b6
commit 1301468b5a
8 changed files with 10 additions and 12 deletions

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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 };

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);