xref: /openbmc/u-boot/drivers/serial/Kconfig (revision 275854ba)
1da333ae7SMasahiro Yamadaconfig DM_SERIAL
2da333ae7SMasahiro Yamada	bool "Enable Driver Model for serial drivers"
3da333ae7SMasahiro Yamada	depends on DM
4da333ae7SMasahiro Yamada	help
5f94a1bedSSimon Glass	  Enable driver model for serial. This replaces
6f94a1bedSSimon Glass	  drivers/serial/serial.c with the serial uclass, which
7f94a1bedSSimon Glass	  implements serial_putc() etc. The uclass interface is
8f94a1bedSSimon Glass	  defined in include/serial.h.
9ff247b7aSMasahiro Yamada
102f964aa7SSimon Glassconfig DEBUG_UART
112f964aa7SSimon Glass	bool "Enable an early debug UART for debugging"
122f964aa7SSimon Glass	help
132f964aa7SSimon Glass	  The debug UART is intended for use very early in U-Boot to debug
142f964aa7SSimon Glass	  problems when an ICE or other debug mechanism is not available.
152f964aa7SSimon Glass
162f964aa7SSimon Glass	  To use it you should:
172f964aa7SSimon Glass	  - Make sure your UART supports this interface
182f964aa7SSimon Glass	  - Enable CONFIG_DEBUG_UART
192f964aa7SSimon Glass	  - Enable the CONFIG for your UART to tell it to provide this interface
202f964aa7SSimon Glass	        (e.g. CONFIG_DEBUG_UART_NS16550)
212f964aa7SSimon Glass	  - Define the required settings as needed (see below)
222f964aa7SSimon Glass	  - Call debug_uart_init() before use
232f964aa7SSimon Glass	  - Call debug_uart_putc() to output a character
242f964aa7SSimon Glass
252f964aa7SSimon Glass	  Depending on your platform it may be possible to use this UART before
262f964aa7SSimon Glass	  a stack is available.
272f964aa7SSimon Glass
282f964aa7SSimon Glass	  If your UART does not support this interface you can probably add
292f964aa7SSimon Glass	  support quite easily. Remember that you cannot use driver model and
302f964aa7SSimon Glass	  it is preferred to use no stack.
312f964aa7SSimon Glass
322f964aa7SSimon Glass	  You must not use this UART once driver model is working and the
332f964aa7SSimon Glass	  serial drivers are up and running (done in serial_init()). Otherwise
342f964aa7SSimon Glass	  the drivers may conflict and you will get strange output.
352f964aa7SSimon Glass
3621d00436SSimon Glasschoice
3721d00436SSimon Glass	prompt "Select which UART will provide the debug UART"
3821d00436SSimon Glass	depends on DEBUG_UART
3921d00436SSimon Glass
4021d00436SSimon Glassconfig DEBUG_UART_NS16550
4121d00436SSimon Glass	bool "ns16550"
4221d00436SSimon Glass	help
4321d00436SSimon Glass	  Select this to enable a debug UART using the ns16550 driver. You
4421d00436SSimon Glass	  will need to provide parameters to make this work. The driver will
4521d00436SSimon Glass	  be available until the real driver model serial is running.
4621d00436SSimon Glass
47*275854baSSimon Glassconfig DEBUG_EFI_CONSOLE
48*275854baSSimon Glass	bool "EFI"
49*275854baSSimon Glass	depends on EFI_APP
50*275854baSSimon Glass	help
51*275854baSSimon Glass	  Select this to enable a debug console which calls back to EFI to
52*275854baSSimon Glass	  output to the console. This can be useful for early debugging of
53*275854baSSimon Glass	  U-Boot when running on top of EFI (Extensive Firmware Interface).
54*275854baSSimon Glass	  This is a type of BIOS used by PCs.
55*275854baSSimon Glass
5621d00436SSimon Glassendchoice
5721d00436SSimon Glass
582f964aa7SSimon Glassconfig DEBUG_UART_BASE
592f964aa7SSimon Glass	hex "Base address of UART"
602f964aa7SSimon Glass	depends on DEBUG_UART
612f964aa7SSimon Glass	help
622f964aa7SSimon Glass	  This is the base address of your UART for memory-mapped UARTs.
632f964aa7SSimon Glass
642f964aa7SSimon Glass	  A default should be provided by your board, but if not you will need
652f964aa7SSimon Glass	  to use the correct value here.
662f964aa7SSimon Glass
672f964aa7SSimon Glassconfig DEBUG_UART_CLOCK
682f964aa7SSimon Glass	int "UART input clock"
692f964aa7SSimon Glass	depends on DEBUG_UART
702f964aa7SSimon Glass	help
712f964aa7SSimon Glass	  The UART input clock determines the speed of the internal UART
722f964aa7SSimon Glass	  circuitry. The baud rate is derived from this by dividing the input
732f964aa7SSimon Glass	  clock down.
742f964aa7SSimon Glass
752f964aa7SSimon Glass	  A default should be provided by your board, but if not you will need
762f964aa7SSimon Glass	  to use the correct value here.
772f964aa7SSimon Glass
78dd0b0122SSimon Glassconfig DEBUG_UART_SHIFT
79dd0b0122SSimon Glass	int "UART register shift"
80dd0b0122SSimon Glass	depends on DEBUG_UART
81dd0b0122SSimon Glass	default 0 if DEBUG_UART
82dd0b0122SSimon Glass	help
83dd0b0122SSimon Glass	  Some UARTs (notably ns16550) support different register layouts
84dd0b0122SSimon Glass	  where the registers are spaced either as bytes, words or some other
85dd0b0122SSimon Glass	  value. Use this value to specify the shift to use, where 0=byte
86dd0b0122SSimon Glass	  registers, 2=32-bit word registers, etc.
87dd0b0122SSimon Glass
88af282245SSimon Glassconfig SANDBOX_SERIAL
89af282245SSimon Glass	bool "Sandbox UART support"
90af282245SSimon Glass	depends on SANDBOX && DM
91af282245SSimon Glass	help
92af282245SSimon Glass	  Select this to enable a seral UART for sandbox. This is required to
93af282245SSimon Glass	  operate correctly, otherwise you will see no serial output from
94af282245SSimon Glass	  sandbox. The emulated UART will display to the console and console
95af282245SSimon Glass	  input will be fed into the UART. This allows you to interact with
96af282245SSimon Glass	  U-Boot.
97af282245SSimon Glass
98af282245SSimon Glass	  The operation of the console is controlled by the -t command-line
99af282245SSimon Glass	  flag. In raw mode, U-Boot sees all characters from the terminal
100af282245SSimon Glass	  before they are processed, including Ctrl-C. In cooked mode, Ctrl-C
101af282245SSimon Glass	  is processed by the terminal, and terminates U-Boot. Valid options
102af282245SSimon Glass	  are:
103af282245SSimon Glass
104af282245SSimon Glass	     -t raw-with-sigs	Raw mode, Ctrl-C will terminate U-Boot
105af282245SSimon Glass	     -t raw		Raw mode, Ctrl-C is processed by U-Boot
106af282245SSimon Glass	     -t cooked		Cooked mode, Ctrl-C terminates
107af282245SSimon Glass
108ff247b7aSMasahiro Yamadaconfig UNIPHIER_SERIAL
109b6ef3a3fSMasahiro Yamada	bool "Support for UniPhier on-chip UART"
110ff247b7aSMasahiro Yamada	depends on ARCH_UNIPHIER && DM_SERIAL
111ff247b7aSMasahiro Yamada	help
112b6ef3a3fSMasahiro Yamada	  If you have a UniPhier based board and want to use the on-chip
113b6ef3a3fSMasahiro Yamada	  serial ports, say Y to this option. If unsure, say N.
114dcfe4a54SSimon Glass
115dcfe4a54SSimon Glassconfig X86_SERIAL
116dcfe4a54SSimon Glass	bool "Support for 16550 serial port on x86 machines"
117dcfe4a54SSimon Glass	depends on X86
118dcfe4a54SSimon Glass	default y
119dcfe4a54SSimon Glass	help
120dcfe4a54SSimon Glass	  Most x86 machines have a ns16550 UART or compatible. This can be
121dcfe4a54SSimon Glass	  enabled in the device tree with the correct input clock frequency
122dcfe4a54SSimon Glass	  provided (default 1843200). Enable this to obtain serial console
123dcfe4a54SSimon Glass	  output.
124