From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
devicetree@vger.kernel.org, "Jiri Slaby" <jirislaby@kernel.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: Re: [PATCH v4 3/5] drivers/tty/serial: add driver for the ESP32 UART
Date: Tue, 3 Oct 2023 14:56:04 +0200 [thread overview]
Message-ID: <2023100348-visitor-browse-3142@gregkh> (raw)
In-Reply-To: <20230928151631.149333-4-jcmvbkbc@gmail.com>
On Thu, Sep 28, 2023 at 08:16:29AM -0700, Max Filippov wrote:
> Add driver for the UART controllers of the Espressif ESP32 and ESP32S3
> SoCs. Hardware specification is available at the following URLs:
>
> https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
> (Chapter 13 UART Controller)
> https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_en.pdf
> (Chapter 26 UART Controller)
>
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
> Changes v2->v3:
> - rework brk handling in esp32_uart_rxint
> - only increment port->icount.rx in case insert_flip_char() is called
> - use HZ instead of msecs_to_jiffies(1000) in esp32_uart_put_char_sync
> - add early return to esp32_uart_transmit_buffer
> - use request_irq/free_irq instead of devm_* versions
> - add blank lines before certain return statements
>
> Changes v1->v2:
> - redefine register fields using BIT and GENMASK
> - drop _MASK suffix from register field definitions
> - drop *_SHIFT definitions where possible
> - drop unused rxfifo_full_thrhd_mask and txfifo_empty_thrhd_mask
> - split register reads/writes and bitwise operations into multiple lines
> - use u8 instead of unsigned char in internal functions
> - add timeout to esp32_uart_put_char_sync
> - use uart_port_tx_limited in esp32_uart_transmit_buffer
> - use IRQ_RETVAL in esp32_uart_int
> - disable clock in esp32_uart_startup in case devm_request_irq fails
> - rearrange devm_request_irq with enabling IRQs in the UART registers
> - drop empty esp32_uart_release_port and esp32_uart_request_port
> - simplify esp32_uart_tx_empty
> - mask out unsupported CMSPAR flag in termios->c_cflag in
> esp32_uart_set_termios
> - invoke uart_update_timeout in esp32_uart_set_termios
> - drop MODULE_DESCRIPTION
> - rearrange esp32_uart_set_baud: return bool indicating whether baud
> rate was set or not, use it in the esp32_uart_set_termios to set the
> default 115200
> - turn 'locked' into bool in esp32_uart_console_write
> - turn num_read into unsigned int in esp32_uart_earlycon_read
>
> drivers/tty/serial/Kconfig | 13 +
> drivers/tty/serial/Makefile | 1 +
> drivers/tty/serial/esp32_uart.c | 741 +++++++++++++++++++++++++++++++
> include/uapi/linux/serial_core.h | 3 +
> 4 files changed, 758 insertions(+)
> create mode 100644 drivers/tty/serial/esp32_uart.c
>
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index bdc568a4ab66..d9ca6b268f01 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -1578,6 +1578,19 @@ config SERIAL_NUVOTON_MA35D1_CONSOLE
> but you can alter that using a kernel command line option such as
> "console=ttyNVTx".
>
> +config SERIAL_ESP32
> + tristate "Espressif ESP32 UART support"
> + depends on XTENSA_PLATFORM_ESP32 || (COMPILE_TEST && OF)
> + select SERIAL_CORE
> + select SERIAL_CORE_CONSOLE
> + select SERIAL_EARLYCON
> + help
> + Driver for the UART controllers of the Espressif ESP32xx SoCs.
> + When earlycon option is enabled the following kernel command line
> + snippets may be used:
> + earlycon=esp32s3uart,mmio32,0x60000000,115200n8,40000000
> + earlycon=esp32uart,mmio32,0x3ff40000,115200n8
> +
> endmenu
>
> config SERIAL_MCTRL_GPIO
> diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
> index 138abbc89738..7b73137df7f3 100644
> --- a/drivers/tty/serial/Makefile
> +++ b/drivers/tty/serial/Makefile
> @@ -88,6 +88,7 @@ obj-$(CONFIG_SERIAL_MILBEAUT_USIO) += milbeaut_usio.o
> obj-$(CONFIG_SERIAL_SIFIVE) += sifive.o
> obj-$(CONFIG_SERIAL_LITEUART) += liteuart.o
> obj-$(CONFIG_SERIAL_SUNPLUS) += sunplus-uart.o
> +obj-$(CONFIG_SERIAL_ESP32) += esp32_uart.o
>
> # GPIOLIB helpers for modem control lines
> obj-$(CONFIG_SERIAL_MCTRL_GPIO) += serial_mctrl_gpio.o
> diff --git a/drivers/tty/serial/esp32_uart.c b/drivers/tty/serial/esp32_uart.c
> new file mode 100644
> index 000000000000..bb5471e8b6b6
> --- /dev/null
> +++ b/drivers/tty/serial/esp32_uart.c
> @@ -0,0 +1,741 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
Same license and copyright question as I had on the ACM patch.
thanks,
greg k-h
next prev parent reply other threads:[~2023-10-03 12:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 15:16 [PATCH v4 0/5] serial: add drivers for the ESP32xx serial devices Max Filippov
2023-09-28 15:16 ` [PATCH v4 1/5] serial: core: tidy invalid baudrate handling in uart_get_baud_rate Max Filippov
2023-09-29 6:34 ` Ilpo Järvinen
2023-09-29 19:26 ` Max Filippov
2023-10-03 12:39 ` Greg Kroah-Hartman
2023-09-28 15:16 ` [PATCH v4 2/5] dt-bindings: serial: document esp32-uart Max Filippov
2023-09-28 15:16 ` [PATCH v4 3/5] drivers/tty/serial: add driver for the ESP32 UART Max Filippov
2023-10-03 12:56 ` Greg Kroah-Hartman [this message]
2023-09-28 15:16 ` [PATCH v4 4/5] dt-bindings: serial: document esp32s3-acm Max Filippov
2023-09-28 15:16 ` [PATCH v4 5/5] drivers/tty/serial: add ESP32S3 ACM device driver Max Filippov
2023-10-03 12:55 ` Greg Kroah-Hartman
2023-10-03 19:46 ` Max Filippov
2023-10-05 18:57 ` Greg Kroah-Hartman
2023-10-05 21:21 ` Max Filippov
2023-10-06 9:34 ` Greg Kroah-Hartman
2023-10-06 10:27 ` Max Filippov
2023-10-06 11:04 ` Greg Kroah-Hartman
2023-10-06 14:11 ` Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2023100348-visitor-browse-3142@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jcmvbkbc@gmail.com \
--cc=jirislaby@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).