mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user