Add dynamic mux for UARTBone / normal UART #1959
Open
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.
One problem with debugging a single-UART system is that the system will always block if a UARTBone client is not connected. This is particularly annoying if, for instance, your vendor's RAM update tools do not work right (I'm looking at you, Efinix...), and you need the UARTBone to iterate on firmware -- but, once you have a build, you would like to have a UART that does not block. (In my system, I have two FPGAs talking to each other, and I am probably developing one or the other at a time, and I would like to be able to distribute a bitstream to the customer that just happily boots without any drama, for instance.)
This PR solves this by modifying the
UARTCrossover
to have adebug_en
CSR, and apad_phy
input. Whendebug_en
is turned on (the default, on reset), then the system behaves exactly like it previously did. However, switching offdebug_en
means that the crossover internal UART and UARTbone are disconnected, and theUARTCrossover
'ssource
andsink
are actually connected to the pads of the outer world -- basically, passing the UART straight through.To use this, I do something like this:
There is a little bit of WIP here: the simplest way to wire this up was through the old
crossover+uartbone
path that is now deprecated. I undeprecate this by commenting out the deprecation! But obviously I would like feedback on what you think the better way is to do this.