diff --git a/board/cr50/gpio.inc b/board/cr50/gpio.inc index a0381021fb..bb3150452b 100644 --- a/board/cr50/gpio.inc +++ b/board/cr50/gpio.inc @@ -76,8 +76,14 @@ PINMUX(GPIO(BATT_PRES), M2, 0) /* UARTs */ PINMUX(FUNC(UART0_TX), A0, DIO_OUTPUT) /* Cr50 console */ -PINMUX(FUNC(UART0_RX), A1, DIO_INPUT | DIO_WAKE_LOW) -/* UART1_TX and UART2_TX are configured in usart.c. They are not set as outputs +/* + * UART0_RX should only be used for debugging purposes. There is no internal + * pull up on DIOA13, so make sure there is an external pull up. If there is + * no external pull up cr50 will be held in UART0RX interrupts and will + * constantly reboot. + * UART0_RX = DIOA13 + * + * UART1_TX and UART2_TX are configured in usart.c. They are not set as outputs * here in order to avoid interfering with servo. They can be controlled using * the 'uart' console command. * UART1_TX = DIOA7 AP console diff --git a/chip/g/uartn.c b/chip/g/uartn.c index 17cd5e51b8..cda77c819d 100644 --- a/chip/g/uartn.c +++ b/chip/g/uartn.c @@ -116,8 +116,12 @@ void uartn_enable_interrupt(int uart) /* Enable TX and RX. Disable HW flow control and loopback */ void uartn_enable(int uart) { - /* TX and RX enable */ - GR_UART_CTRL(uart) = 0x03; + /* Enable UART TX */ + GR_UART_CTRL(uart) = 0x01; + + /* Enable UART RX if it is connected to an external pad */ + if (DIO_SEL_REG(GC_PINMUX_UART0_RX_SEL_OFFSET + (uart * 16))) + GR_UART_CTRL(uart) |= 0x02; } /* Disable TX, RX, HW flow control, and loopback */