Skip to content

soc/uart: add shared UARTBone mux - #2506

Open
enjoy-digital wants to merge 1 commit into
masterfrom
uartbone-uart-mux
Open

soc/uart: add shared UARTBone mux#2506
enjoy-digital wants to merge 1 commit into
masterfrom
uartbone-uart-mux

Conversation

@enjoy-digital

Copy link
Copy Markdown
Owner

This adds a shared serial PHY mux for SoCs that enable UARTBone together with the regular UART.

When UARTBone and the serial/crossover UART are both selected, SoCCore now uses the mux automatically and the selector resets to UARTBone mode. The UART uartbone CSR selects whether the shared serial pins are connected to UARTBone or directly to the CPU UART, and the BIOS uartbone command switches the pins back to UARTBone from the regular UART console.

This addresses the UARTBone/normal UART sharing use-case from #1959 and is based on the original mux idea proposed by Joshua Wise (@jwise).

Tests:

  • python3 -m py_compile litex/soc/cores/uart.py litex/soc/integration/soc.py test/cores/test_uart.py test/soc/test_soc.py
  • pytest -q test/cores/test_uart.py test/soc/test_soc.py test/software/test_bios_console.py
  • host gcc compile-check for cmd_bios.c with UARTBone CSR stubs

Add a shared serial PHY mux for SoCs that enable UARTBone together with the regular UART. When UARTBone and the serial/crossover UART are both selected, SoCCore now uses the mux automatically and the selector resets to UARTBone mode.

The UART uartbone CSR selects whether the serial pins are connected to UARTBone or directly to the CPU UART. add_uartbone() can use the mux virtual PHY, and the BIOS uartbone command switches the shared serial pins back to UARTBone from the regular console.

This addresses the UARTBone/normal UART sharing use-case from #1959 and is based on the original mux idea proposed by Joshua Wise (@jwise).

Add tests for mux routing, validation, automatic SoC integration, and the regular UART escape path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant