Merged in hg42/nuttx/lpc17-disable-FDR (pull request #591)

disable LPC17 FDR when not used

* disable LPC17 FDR when not used

    if a boot loader set the fractional divider (FDR) the baud rate in
    nuttx will be wrong (multiplied by this fraction).

    So if it is not used, it should be disabled.

    LPC176x docs say:
    "
    DIVADDVAL Baud-rate generation pre-scaler divisor value.
    If this field is 0, fractional baud-rate generator will
    not impact the UARTn baudrate.

    MULVAL Baud-rate pre-scaler multiplier value.
    This field must be greater or equal 1 for UARTn to operate properly,
    regardless of whether the fractional baud-rate generator is used or not.
    "

    So DIVADDVAL is set to 0 and MULVAL is set to 1.

* symbols found and added

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
hg42
2018-02-08 22:37:58 +00:00
committed by Gregory Nutt
parent 970bcef197
commit da051fb3d9
+4
View File
@@ -920,6 +920,10 @@ static int up_setup(struct uart_dev_s *dev)
lcr |= (UART_LCR_PE | UART_LCR_PS_EVEN);
}
/* Disable FDR (fractional divider, not used by baudrate settings -> has to be disabled) */
up_serialout(priv, LPC17_UART_FDR_OFFSET, (1<<UART_FDR_MULVAL_SHIFT) + (0<<UART_FDR_DIVADDVAL_SHIFT));
/* Enter DLAB=1 */
up_serialout(priv, LPC17_UART_LCR_OFFSET, (lcr | UART_LCR_DLAB));