mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
Merged in hg42/nuttx/lpc17-disable-FDR-2 (pull request #596)
disable LPC17 FDR when not used (second fix) if a boot loader sets the fractional divider (FDR) the baud rate in nuttx will be wrong (multiplied by this fraction). This also has to be added to lpc17_lowputc.c Unfortunately the constant used for shifting the bits was wrong in the header file, so it took some time to realize this... Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
d5522704b1
commit
3a029ed185
@@ -342,7 +342,7 @@
|
||||
|
||||
#define UART_FDR_DIVADDVAL_SHIFT (0) /* Bits 0-3: Baud-rate generation pre-scaler divisor value */
|
||||
#define UART_FDR_DIVADDVAL_MASK (15 << UART_FDR_DIVADDVAL_SHIFT)
|
||||
#define UART_FDR_MULVAL_SHIFT (3) /* Bits 4-7 Baud-rate pre-scaler multiplier value */
|
||||
#define UART_FDR_MULVAL_SHIFT (4) /* Bits 4-7 Baud-rate pre-scaler multiplier value */
|
||||
#define UART_FDR_MULVAL_MASK (15 << UART_FDR_MULVAL_SHIFT)
|
||||
/* Bits 8-31: Reserved */
|
||||
/* TER Transmit Enable Register (all) */
|
||||
|
||||
@@ -389,6 +389,13 @@ void lpc17_lowsetup(void)
|
||||
putreg32(UART_FCR_FIFOEN | UART_FCR_RXTRIGGER_8,
|
||||
CONSOLE_BASE + LPC17_UART_FCR_OFFSET);
|
||||
|
||||
/* Disable FDR (fractional divider),
|
||||
* ignored by baudrate calculation => has to be disabled
|
||||
*/
|
||||
|
||||
putreg32((1 << UART_FDR_MULVAL_SHIFT) + (0 << UART_FDR_DIVADDVAL_SHIFT),
|
||||
CONSOLE_BASE + LPC17_UART_FDR_OFFSET);
|
||||
|
||||
/* Set up the LCR and set DLAB=1 */
|
||||
|
||||
putreg32(CONSOLE_LCR_VALUE | UART_LCR_DLAB,
|
||||
|
||||
@@ -920,8 +920,8 @@ 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)
|
||||
/* Disable FDR (fractional divider),
|
||||
* ignored by baudrate calculation => has to be disabled
|
||||
*/
|
||||
|
||||
up_serialout(priv, LPC17_UART_FDR_OFFSET,
|
||||
|
||||
Reference in New Issue
Block a user