drivers: console: add a QingKe Debug Module console driver #89966
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



The QingKe V2A, V2C, and V4C have a Debug Module with two data registers
data0anddata1. These can be used with SDI compatible debuggers such asminichlinkto send console data to the host.Add a console driver that buffers up to three characters in data0, communicates with the host, and fails gracefully if the driver is enabled but the debugger is not connected. The buffering is particularly important on hosts that use USB passthrough such as Chrome OS.
Compared to the UART console, the debug console uses 916 bytes less flash and frees up a UART.
Tested on the ch32v003evt and ch32v006evt. To test, add
&debug { status = "okay"; };to the board Devicetree, setzephyr,console = &debug, and enable the driver.