lpc176x: Fix serial ordering of initialization

The serial device needs to be enabled before setting the DLAB bit.
This prevented UART3 from working.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor committed 2022-03-01 12:55:06 -05:00
1 parent 682d38f590
commit 7ce409d7a5
1 file changed
+1 -1
+1 -1
View File
@@ -75,8 +75,8 @@ void
serial_init(void)
{
// Setup baud
LPC_UARTx->LCR = (1<<7); // set DLAB bit
enable_pclock(PCLK_UARTx);
LPC_UARTx->LCR = (1<<7); // set DLAB bit
uint32_t pclk = get_pclock_frequency(PCLK_UARTx);
uint32_t div = pclk / (CONFIG_SERIAL_BAUD * 16);
LPC_UARTx->DLL = div & 0xff;