#
# Copyright © 2017-2021 The Crust Firmware Authors.
# SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-only
#

config SERIAL
	bool "Serial input/output support"
	default y
	help
		Use a serial port (UART) for error logs and debugging.
		Note that depending on the port and options selected,
		this may interfere with other users of that serial port.

		If you are unsure, use the default port and baud rate.

		For maximum power savings, select the R_UART device or
		disable this option entirely.

if SERIAL

choice
	bool "Device"
	default SERIAL_DEV_UART0

config SERIAL_DEV_UART0
	bool "UART0"

config SERIAL_DEV_UART1
	bool "UART1"

config SERIAL_DEV_UART2
	bool "UART2"

config SERIAL_DEV_UART3
	bool "UART3"

config SERIAL_DEV_UART4
	bool "UART4"
	depends on HAVE_UART4

config SERIAL_DEV_R_UART
	bool "R_UART"

endchoice

config SERIAL_BAUD
	int "Baud" if !SERIAL_DEV_UART0
	range 0 1500000
	default 0 if SERIAL_DEV_UART0
	default 9600 if SERIAL_DEV_R_UART
	default 115200
	help
		If a positive number is entered, the firmware will set
		up the serial port with that baud rate before using it.

		If zero is entered, the firmware will assume the serial
		port is already configured and keep the existing baud
		rate. Use this option if the port is shared with other
		users.

endif
