xref: /openbmc/u-boot/drivers/serial/Kconfig (revision fa87abb6)
1#
2# Serial device configuration
3#
4
5menu "Serial drivers"
6
7config BAUDRATE
8	int "Default baudrate"
9	default 115200
10	help
11	  Select a default baudrate, where "default" has a driver-specific
12	  meaning of either setting the baudrate for the early debug UART
13	  in the SPL stage (most drivers) or for choosing a default baudrate
14	  in the absence of an environment setting (serial_mxc.c).
15
16config REQUIRE_SERIAL_CONSOLE
17	bool "Require a serial port for console"
18	# Running without a serial console is not supported by the
19	# non-dm serial code
20	depends on DM_SERIAL
21	default y
22	help
23	  Require a serial port for the console, and panic if none is found
24	  during serial port initialization (default y). Set this to n on
25	  boards which have no debug serial port whatsoever.
26
27config SERIAL_PRESENT
28	bool "Provide a serial driver"
29	depends on DM_SERIAL
30	default y
31	help
32	  In very space-constrained devices even the full UART driver is too
33	  large. In this case the debug UART can still be used in some cases.
34	  This option enables the full UART in U-Boot, so if is it disabled,
35	  the full UART driver will be omitted, thus saving space.
36
37config SPL_SERIAL_PRESENT
38	bool "Provide a serial driver in SPL"
39	depends on DM_SERIAL
40	default y
41	help
42	  In very space-constrained devices even the full UART driver is too
43	  large. In this case the debug UART can still be used in some cases.
44	  This option enables the full UART in SPL, so if is it disabled,
45	  the full UART driver will be omitted, thus saving space.
46
47config CONS_INDEX
48	int "UART used for console"
49	depends on ARCH_SUNXI
50	default 2 if MACH_SUN5I
51	default 5 if MACH_SUN8I_A23 || MACH_SUN8I_A33
52	default 1
53	help
54	  Configures the console index.
55	  For Allwinner SoC., default values are 2 for SUN5I and 5 for A23/A33.
56	  Otherwise, the index equals 1.
57
58config DM_SERIAL
59	bool "Enable Driver Model for serial drivers"
60	depends on DM
61	help
62	  Enable driver model for serial. This replaces
63	  drivers/serial/serial.c with the serial uclass, which
64	  implements serial_putc() etc. The uclass interface is
65	  defined in include/serial.h.
66
67config SERIAL_IRQ_BUFFER
68	bool "Enable RX interrupt buffer for serial input"
69	depends on DM_SERIAL
70	default n
71	help
72	  Enable RX interrupt buffer support for the serial driver.
73	  This enables pasting longer strings, even when the RX FIFO
74	  of the UART is not big enough (e.g. 16 bytes on the normal
75	  NS16550).
76
77config SPL_DM_SERIAL
78	bool "Enable Driver Model for serial drivers in SPL"
79	depends on DM_SERIAL
80	default y if SPL && DM_SERIAL
81	help
82	  Enable driver model for serial in SPL. This replaces
83	  drivers/serial/serial.c with the serial uclass, which
84	  implements serial_putc() etc. The uclass interface is
85	  defined in include/serial.h.
86
87config TPL_DM_SERIAL
88	bool "Enable Driver Model for serial drivers in TPL"
89	depends on DM_SERIAL
90	default y if TPL && DM_SERIAL
91	help
92	  Enable driver model for serial in TPL. This replaces
93	  drivers/serial/serial.c with the serial uclass, which
94	  implements serial_putc() etc. The uclass interface is
95	  defined in include/serial.h.
96
97config DEBUG_UART
98	bool "Enable an early debug UART for debugging"
99	help
100	  The debug UART is intended for use very early in U-Boot to debug
101	  problems when an ICE or other debug mechanism is not available.
102
103	  To use it you should:
104	  - Make sure your UART supports this interface
105	  - Enable CONFIG_DEBUG_UART
106	  - Enable the CONFIG for your UART to tell it to provide this interface
107	        (e.g. CONFIG_DEBUG_UART_NS16550)
108	  - Define the required settings as needed (see below)
109	  - Call debug_uart_init() before use
110	  - Call debug_uart_putc() to output a character
111
112	  Depending on your platform it may be possible to use this UART before
113	  a stack is available.
114
115	  If your UART does not support this interface you can probably add
116	  support quite easily. Remember that you cannot use driver model and
117	  it is preferred to use no stack.
118
119	  You must not use this UART once driver model is working and the
120	  serial drivers are up and running (done in serial_init()). Otherwise
121	  the drivers may conflict and you will get strange output.
122
123choice
124	prompt "Select which UART will provide the debug UART"
125	depends on DEBUG_UART
126	default DEBUG_UART_NS16550
127
128config DEBUG_UART_ALTERA_JTAGUART
129	bool "Altera JTAG UART"
130	help
131	  Select this to enable a debug UART using the altera_jtag_uart driver.
132	  You will need to provide parameters to make this work. The driver will
133	  be available until the real driver model serial is running.
134
135config DEBUG_UART_ALTERA_UART
136	bool "Altera UART"
137	help
138	  Select this to enable a debug UART using the altera_uart driver.
139	  You will need to provide parameters to make this work. The driver will
140	  be available until the real driver model serial is running.
141
142config DEBUG_UART_AR933X
143	bool "QCA/Atheros ar933x"
144	depends on AR933X_UART
145	help
146	  Select this to enable a debug UART using the ar933x uart driver.
147	  You will need to provide parameters to make this work. The
148	  driver will be available until the real driver model serial is
149	  running.
150
151config DEBUG_UART_ATMEL
152	bool "Atmel USART"
153	help
154	  Select this to enable a debug UART using the atmel usart driver. You
155	  will need to provide parameters to make this work. The driver will
156	  be available until the real driver-model serial is running.
157
158config DEBUG_UART_BCM6345
159	bool "BCM6345 UART"
160	depends on BCM6345_SERIAL
161	help
162	  Select this to enable a debug UART on BCM6345 SoCs. You
163	  will need to provide parameters to make this work. The driver will
164	  be available until the real driver model serial is running.
165
166config DEBUG_UART_NS16550
167	bool "ns16550"
168	help
169	  Select this to enable a debug UART using the ns16550 driver. You
170	  will need to provide parameters to make this work. The driver will
171	  be available until the real driver model serial is running.
172
173config DEBUG_EFI_CONSOLE
174	bool "EFI"
175	depends on EFI_APP
176	help
177	  Select this to enable a debug console which calls back to EFI to
178	  output to the console. This can be useful for early debugging of
179	  U-Boot when running on top of EFI (Extensive Firmware Interface).
180	  This is a type of BIOS used by PCs.
181
182config DEBUG_UART_S5P
183	bool "Samsung S5P"
184	help
185	  Select this to enable a debug UART using the serial_s5p driver. You
186	  will need to provide parameters to make this work. The driver will
187	  be available until the real driver-model serial is running.
188
189config DEBUG_UART_MESON
190	bool "Amlogic Meson"
191	depends on MESON_SERIAL
192	help
193	  Select this to enable a debug UART using the serial_meson driver. You
194	  will need to provide parameters to make this work. The driver will
195	  be available until the real driver-model serial is running.
196
197config DEBUG_UART_UARTLITE
198	bool "Xilinx Uartlite"
199	help
200	  Select this to enable a debug UART using the serial_uartlite driver.
201	  You will need to provide parameters to make this work. The driver will
202	  be available until the real driver-model serial is running.
203
204config DEBUG_UART_ARM_DCC
205	bool "ARM DCC"
206	help
207	  Select this to enable a debug UART using the ARM JTAG DCC port.
208	  The DCC port can be used for very early debugging and doesn't require
209	  any additional setting like address/baudrate/clock. On systems without
210	  any serial interface this is the easiest way how to get console.
211	  Every ARM core has own DCC port which is the part of debug interface.
212	  This port is available at least on ARMv6, ARMv7, ARMv8 and XScale
213	  architectures.
214
215config DEBUG_MVEBU_A3700_UART
216	bool "Marvell Armada 3700"
217	help
218	  Select this to enable a debug UART using the serial_mvebu driver. You
219	  will need to provide parameters to make this work. The driver will
220	  be available until the real driver-model serial is running.
221
222config DEBUG_UART_ZYNQ
223	bool "Xilinx Zynq"
224	help
225	  Select this to enable a debug UART using the serial_zynq driver. You
226	  will need to provide parameters to make this work. The driver will
227	  be available until the real driver-model serial is running.
228
229config DEBUG_UART_APBUART
230	depends on LEON3
231	bool "Gaisler APBUART"
232	help
233	  Select this to enable a debug UART using the serial_leon3 driver. You
234	  will need to provide parameters to make this work. The driver will
235	  be available until the real driver model serial is running.
236
237config DEBUG_UART_PL010
238	bool "pl010"
239	help
240	  Select this to enable a debug UART using the pl01x driver with the
241	  PL010 UART type. You will need to provide parameters to make this
242	  work. The driver will be available until the real driver model
243	  serial is running.
244
245config DEBUG_UART_PL011
246	bool "pl011"
247	help
248	  Select this to enable a debug UART using the pl01x driver with the
249	  PL011 UART type. You will need to provide parameters to make this
250	  work. The driver will be available until the real driver model
251	  serial is running.
252
253config DEBUG_UART_PIC32
254	bool "Microchip PIC32"
255	depends on PIC32_SERIAL
256	help
257	  Select this to enable a debug UART using the serial_pic32 driver. You
258	  will need to provide parameters to make this work. The driver will
259	  be available until the real driver model serial is running.
260
261config DEBUG_UART_MXC
262	bool "IMX Serial port"
263	depends on MXC_UART
264	help
265	  Select this to enable a debug UART using the serial_mxc driver. You
266	  will need to provide parameters to make this work. The driver will
267	  be available until the real driver model serial is running.
268
269config DEBUG_UART_UNIPHIER
270	bool "UniPhier on-chip UART"
271	depends on ARCH_UNIPHIER
272	help
273	  Select this to enable a debug UART using the UniPhier on-chip UART.
274	  You will need to provide DEBUG_UART_BASE to make this work.  The
275	  driver will be available until the real driver-model serial is
276	  running.
277
278config DEBUG_UART_OMAP
279	bool "OMAP uart"
280	help
281	  Select this to enable a debug UART using the omap ns16550 driver.
282	  You will need to provide parameters to make this work. The driver
283	  will be available until the real driver model serial is running.
284
285endchoice
286
287config DEBUG_UART_BASE
288	hex "Base address of UART"
289	depends on DEBUG_UART
290	help
291	  This is the base address of your UART for memory-mapped UARTs.
292
293	  A default should be provided by your board, but if not you will need
294	  to use the correct value here.
295
296config DEBUG_UART_CLOCK
297	int "UART input clock"
298	depends on DEBUG_UART
299	help
300	  The UART input clock determines the speed of the internal UART
301	  circuitry. The baud rate is derived from this by dividing the input
302	  clock down.
303
304	  A default should be provided by your board, but if not you will need
305	  to use the correct value here.
306
307config DEBUG_UART_SHIFT
308	int "UART register shift"
309	depends on DEBUG_UART
310	default 0 if DEBUG_UART
311	help
312	  Some UARTs (notably ns16550) support different register layouts
313	  where the registers are spaced either as bytes, words or some other
314	  value. Use this value to specify the shift to use, where 0=byte
315	  registers, 2=32-bit word registers, etc.
316
317config DEBUG_UART_BOARD_INIT
318	bool "Enable board-specific debug UART init"
319	depends on DEBUG_UART
320	help
321	  Some boards need to set things up before the debug UART can be used.
322	  On these boards a call to debug_uart_init() is insufficient. When
323	  this option is enabled, the function board_debug_uart_init() will
324	  be called when debug_uart_init() is called. You can put any code
325	  here that is needed to set up the UART ready for use, such as set
326	  pin multiplexing or enable clocks.
327
328config DEBUG_UART_ANNOUNCE
329	bool "Show a message when the debug UART starts up"
330	depends on DEBUG_UART
331	help
332	  Enable this option to show a message when the debug UART is ready
333	  for use. You will see a message like "<debug_uart> " as soon as
334	  U-Boot has the UART ready for use (i.e. your code calls
335	  debug_uart_init()). This can be useful just as a check that
336	  everything is working.
337
338config DEBUG_UART_SKIP_INIT
339	bool "Skip UART initialization"
340	help
341	  Select this if the UART you want to use for debug output is already
342	  initialized by the time U-Boot starts its execution.
343
344config ALTERA_JTAG_UART
345	bool "Altera JTAG UART support"
346	depends on DM_SERIAL
347	help
348	  Select this to enable an JTAG UART for Altera devices.The JTAG UART
349	  core implements a method to communicate serial character streams
350	  between a host PC and a Qsys system on an Altera FPGA. Please find
351	  details on the "Embedded Peripherals IP User Guide" of Altera.
352
353config ALTERA_JTAG_UART_BYPASS
354	bool "Bypass output when no connection"
355	depends on ALTERA_JTAG_UART
356	help
357	  Bypass console output and keep going even if there is no JTAG
358	  terminal connection with the host. The console output will resume
359	  once the JTAG terminal is connected. Without the bypass, the console
360	  output will wait forever until a JTAG terminal is connected. If you
361	  not are sure, say Y.
362
363config ALTERA_UART
364	bool "Altera UART support"
365	depends on DM_SERIAL
366	help
367	  Select this to enable an UART for Altera devices. Please find
368	  details on the "Embedded Peripherals IP User Guide" of Altera.
369
370config AR933X_UART
371	bool "QCA/Atheros ar933x UART support"
372	depends on DM_SERIAL && SOC_AR933X
373	help
374	  Select this to enable UART support for QCA/Atheros ar933x
375	  devices. This driver uses driver model and requires a device
376	  tree binding to operate, please refer to the document at
377	  doc/device-tree-bindings/serial/qca,ar9330-uart.txt.
378
379config ATMEL_USART
380	bool "Atmel USART support"
381	help
382	  Select this to enable USART support for Atmel SoCs. It can be
383	  configured in the device tree, and input clock frequency can
384	  be got from the clk node.
385
386config BCM6345_SERIAL
387	bool "Support for BCM6345 UART"
388	depends on DM_SERIAL && ARCH_BMIPS
389	help
390	  Select this to enable UART on BCM6345 SoCs.
391
392config FSL_LPUART
393	bool "Freescale LPUART support"
394	help
395	  Select this to enable a Low Power UART for Freescale VF610 and
396	  QorIQ Layerscape devices.
397
398config MVEBU_A3700_UART
399	bool "UART support for Armada 3700"
400	default n
401	help
402	  Choose this option to add support for UART driver on the Marvell
403	  Armada 3700 SoC. The base address is configured via DT.
404
405config MXC_UART
406	bool "IMX serial port support"
407	depends on MX5 || MX6
408	help
409	  If you have a machine based on a Motorola IMX CPU you
410	  can enable its onboard serial port by enabling this option.
411
412config PIC32_SERIAL
413	bool "Support for Microchip PIC32 on-chip UART"
414	depends on DM_SERIAL && MACH_PIC32
415	default y
416	help
417	  Support for the UART found on Microchip PIC32 SoC's.
418
419config SYS_NS16550
420	bool "NS16550 UART or compatible"
421	help
422	  Support NS16550 UART or compatible. This can be enabled in the
423	  device tree with the correct input clock frequency. If the input
424	  clock frequency is not defined in the device tree, the macro
425	  CONFIG_SYS_NS16550_CLK defined in a legacy board header file will
426	  be used. It can be a constant or a function to get clock, eg,
427	  get_serial_clock().
428
429config INTEL_MID_SERIAL
430	bool "Intel MID platform UART support"
431	depends on DM_SERIAL && OF_CONTROL
432	depends on INTEL_MID
433	select SYS_NS16550
434	help
435	  Select this to enable a UART for Intel MID platforms.
436	  This uses the ns16550 driver as a library.
437
438config ROCKCHIP_SERIAL
439	bool "Rockchip on-chip UART support"
440	depends on DM_SERIAL && SPL_OF_PLATDATA
441	help
442	  Select this to enable a debug UART for Rockchip devices when using
443	  CONFIG_SPL_OF_PLATDATA (i.e. a compiled-in device tree replacemenmt).
444	  This uses the ns16550 driver, converting the platdata from of-platdata
445	  to the ns16550 format.
446
447config SANDBOX_SERIAL
448	bool "Sandbox UART support"
449	depends on SANDBOX
450	help
451	  Select this to enable a seral UART for sandbox. This is required to
452	  operate correctly, otherwise you will see no serial output from
453	  sandbox. The emulated UART will display to the console and console
454	  input will be fed into the UART. This allows you to interact with
455	  U-Boot.
456
457	  The operation of the console is controlled by the -t command-line
458	  flag. In raw mode, U-Boot sees all characters from the terminal
459	  before they are processed, including Ctrl-C. In cooked mode, Ctrl-C
460	  is processed by the terminal, and terminates U-Boot. Valid options
461	  are:
462
463	     -t raw-with-sigs	Raw mode, Ctrl-C will terminate U-Boot
464	     -t raw		Raw mode, Ctrl-C is processed by U-Boot
465	     -t cooked		Cooked mode, Ctrl-C terminates
466
467config UNIPHIER_SERIAL
468	bool "Support for UniPhier on-chip UART"
469	depends on ARCH_UNIPHIER
470	default y
471	help
472	  If you have a UniPhier based board and want to use the on-chip
473	  serial ports, say Y to this option. If unsure, say N.
474
475config XILINX_UARTLITE
476	bool "Xilinx Uarlite support"
477	depends on DM_SERIAL && (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP || 4xx)
478	help
479	  If you have a Xilinx based board and want to use the uartlite
480	  serial ports, say Y to this option. If unsure, say N.
481
482config MESON_SERIAL
483	bool "Support for Amlogic Meson UART"
484	depends on DM_SERIAL && ARCH_MESON
485	help
486	  If you have an Amlogic Meson based board and want to use the on-chip
487	  serial ports, say Y to this option. If unsure, say N.
488
489config MSM_SERIAL
490	bool "Qualcomm on-chip UART"
491	depends on DM_SERIAL
492	help
493	  Support Data Mover UART used on Qualcomm Snapdragon SoCs.
494	  It should support all Qualcomm devices with UARTDM version 1.4,
495	  for example APQ8016 and MSM8916.
496	  Single baudrate is supported in current implementation (115200).
497
498config PXA_SERIAL
499	bool "PXA serial port support"
500	help
501	  If you have a machine based on a Marvell XScale PXA2xx CPU you
502	  can enable its onboard serial ports by enabling this option.
503
504config STI_ASC_SERIAL
505	bool "STMicroelectronics on-chip UART"
506	depends on DM_SERIAL && ARCH_STI
507	help
508	  Select this to enable Asynchronous Serial Controller available
509	  on STiH410 SoC. This is a basic implementation,  it supports
510	  following baudrate 9600, 19200, 38400, 57600 and 115200.
511
512config MPC8XX_CONS
513	bool "Console driver for MPC8XX"
514	depends on 8xx
515	default y
516
517choice
518	prompt "Console port"
519	default 8xx_CONS_SMC1
520	depends on MPC8XX_CONS
521	help
522	  Depending on board, select one serial port
523	  (CONFIG_8xx_CONS_SMC1 or CONFIG_8xx_CONS_SMC2)
524
525config 8xx_CONS_SMC1
526	bool "SMC1"
527
528config 8xx_CONS_SMC2
529	bool "SMC2"
530
531endchoice
532
533config SYS_SMC_RXBUFLEN
534	int "Console Rx buffer length"
535	depends on MPC8XX_CONS
536	default 1
537	help
538	  With CONFIG_SYS_SMC_RXBUFLEN it is possible to define
539	  the maximum receive buffer length for the SMC.
540	  This option is actual only for 8xx possible.
541	  If using CONFIG_SYS_SMC_RXBUFLEN also CONFIG_SYS_MAXIDLE
542	  must be defined, to setup the maximum idle timeout for
543	  the SMC.
544
545config SYS_MAXIDLE
546	int "maximum idle timeout"
547	depends on MPC8XX_CONS
548	default 0
549
550config SYS_BRGCLK_PRESCALE
551	int "BRG Clock Prescale"
552	depends on MPC8XX_CONS
553	default 1
554
555config SYS_SDSR
556	hex "SDSR Value"
557	depends on MPC8XX_CONS
558	default 0x83
559
560config SYS_SDMR
561	hex "SDMR Value"
562	depends on MPC8XX_CONS
563	default 0
564
565endmenu
566