-INLINE void uart_enable(size_t base)
-{
- /* Enable the FIFO */
- HWREG(base + UART_O_LCRH) |= UART_LCRH_FEN;
- /* Enable RX, TX, and the UART */
- HWREG(base + UART_O_CTL) |=
- UART_CTL_UARTEN | UART_CTL_TXE | UART_CTL_RXE;
-}
+#if CONFIG_KDEBUG_PORT == 0
+ #define UART_BASE UART0_BASE
+ #define UART_GPIO_BASE GPIO_PORTA_BASE
+ #define UART_PINS (BV(1) | BV(0))
+ #define UART_REG_SYSCTL SYSCTL_RCGC2_GPIOA
+#elif CONFIG_KDEBUG_PORT == 1
+ #define UART_BASE UART1_BASE
+ #define UART_GPIO_BASE GPIO_PORTD_BASE
+ #define UART_PINS (BV(3) | BV(2))
+ #define UART_REG_SYSCTL SYSCTL_RCGC2_GPIOD
+#elif CONFIG_KDEBUG_PORT == 2
+ #define UART_BASE UART2_BASE
+ #define UART_GPIO_BASE GPIO_PORTG_BASE
+ #define UART_PINS (BV(1) | BV(0))
+ #define UART_REG_SYSCTL SYSCTL_RCGC2_GPIOG
+#else
+ #error "UART port not supported in this board"
+#endif