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