mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
uart: provide polling mode of operation
Early hardware bringup often is complicated by exceptions happening in
the code all over the place. Using interrupt based console output to
trace startup progress is inefficient - a lot of text gets buffered
and never shows up on the console.
The new config option enables the mode where the console output is
supposed to be happening in polling mode, the character transmit
function not exiting until the entire character is transmitted.
BRANCH=none
BUG=chrome-os-partner:43791
TEST=with the new config enabled (and the appropriate changes to
chip/g/uart.c) was able to debug bringup on the new version.
Change-Id: I85fd2f3990ac1d31097d58bd6a7fa658b2b5146e
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/291852
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
c124e8cbc7
commit
6cb2008348
@@ -68,6 +68,12 @@ static int __tx_char(void *context, int c)
|
||||
if (c == '\n' && __tx_char(NULL, '\r'))
|
||||
return 1;
|
||||
|
||||
#if defined CONFIG_POLLING_UART
|
||||
(void) tx_buf_next;
|
||||
(void) tx_buf_new_tail;
|
||||
uart_write_char(c);
|
||||
#else
|
||||
|
||||
tx_buf_next = TX_BUF_NEXT(tx_buf_head);
|
||||
if (tx_buf_next == tx_buf_tail)
|
||||
return 1;
|
||||
@@ -89,6 +95,7 @@ static int __tx_char(void *context, int c)
|
||||
|
||||
tx_buf[tx_buf_head] = c;
|
||||
tx_buf_head = tx_buf_next;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1220,6 +1220,16 @@
|
||||
*/
|
||||
#undef CONFIG_PMU_POWERINFO
|
||||
|
||||
/*
|
||||
* Enable this config to make console UART self sufficient (no other
|
||||
* initialization required before uart_init(), no interrupts, uart_tx_char()
|
||||
* does not exit until character finished transmitting).
|
||||
*
|
||||
* This is useful during early hardware bringup, each platform needs to
|
||||
* implement its own code to support this.
|
||||
*/
|
||||
#undef CONFIG_POLLING_UART
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user