nios2-generic: Fix logic around choosing UART
PATCH 1/2 nios2-generic: Fix logic around choosing UART
* Before, the normal altera UART driver was compiled in unconditionally and the JTAG UART was missed out.
* Work around this by conditionalizing the driver to use based on the UART choice in the user's custom FPGA header file. If both were to be present, the JTAG UART would have preference.
--- include/configs/nios2-generic.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
include/configs/nios2-generic.h +2 -1
@@ -36,10 +36,11 @@/* * SERIAL */ -#define CONFIG_ALTERA_UART #if defined(CONFIG_ALTERA_JTAG_UART ) +# define CONFIG_ALTERA_JTAG_UART # define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_JTAG_UART_BASE#else +# define CONFIG_ALTERA_UART # define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_UART_BASE#endif
Signature · 1 line
1.7.3.4
PATCH 1/2 nios2-generic: Fix logic around choosing UART
Quoted 19 lines · Alex Hornung
* Before, the normal altera UART driver was compiled in unconditionally and the JTAG UART was missed out.
* Work around this by conditionalizing the driver to use based on the UART choice in the user's custom FPGA header file. If both were to be present, the JTAG UART would have preference.
Signed-off-by Alex Hornung <[email protected]>--- include/configs/nios2-generic.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)include/configs/nios2-generic.h +0
-0@@ -36,10 +36,11 @@/* * SERIAL
include/configs/nios2-generic.h line 46
Quoted 10 lines
include/configs/nios2-generic.h +2
-1*/ -#define CONFIG_ALTERA_UART #if defined(CONFIG_ALTERA_JTAG_UART ) +# define CONFIG_ALTERA_JTAG_UART # define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_JTAG_UART_BASE#else +# define CONFIG_ALTERA_UART # define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_UART_BASE#endif
I'm sorry, I just messed this one up submitting a previous version that wasn't ready.
Below is a new one:
PATCH 1/2 nios2-generic: Fix logic around choosing UART
Quoted 7 lines · Alex Hornung
Quoted 6 lines · Alex Hornung
* Before, the normal altera UART driver was compiled in unconditionally and the JTAG UART was missed out.
* Work around this by conditionalizing the driver to use based on the UART choice in the user's custom FPGA header file. If both were to be present, the JTAG UART would have preference.
Dear Alex,
The preference of jtag uart is not always true. Some people prefer normal uart as it doesn't require the nios2-termial program. As it could be switched easily with a #define CONFIG_ALTERA_JTAG_UART per board config file, this patch is not accepted. Thank you anyway.
Best regards,
Thomas