Skip to contentSkip to conversation

serial: msm_geni_serial_console : Add Earlycon support

PATCH Superseded Mukesh, Savaliya 2 participants 3 messages May 14, 2020 – May 19, 2020 TTY layer and serial drivers

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 serial: msm_geni_serial_console : Add Earlycon support

From: Mukesh Kumar Savaliya <[email protected]>

This change enables earlyconsole support as static driver for geni based UART. Kernel space UART console driver will be generic for console and other usecases of UART.

---
Removed mb() calls as *_relaxed() should take care.

 drivers/tty/serial/Kconfig                   |  15 +
 drivers/tty/serial/Makefile                  |   1 +
 drivers/tty/serial/msm_geni_serial_console.c | 483 +++++++++++++++++++
 3 files changed, 499 insertions(+)
 create mode 100644 drivers/tty/serial/msm_geni_serial_console.c
drivers/tty/serial/Kconfig +15 -0
index 0aea76cd67ff..ded19d80e696 100644
@@ -956,6 +956,21 @@ config SERIAL_MSM_CONSOLE
 	select SERIAL_CORE_CONSOLE
 	select SERIAL_EARLYCON
 
+config SERIAL_MSM_GENI_HALF_SAMPLING
+	bool "Changes clock divider which impacts sampling rate for QUP HW ver greater than 2.5.0"
+	help
+	  Clock divider value should be doubled for QUP hardware version
+	  greater than 2.5.0.
+	  As earlycon can't have HW version awareness, decision is taken
+	  based on the configuration.
+
+config SERIAL_MSM_GENI_EARLY_CONSOLE
+	bool "MSM on-chip GENI HW based early console support"
+	select SERIAL_MSM_GENI_HALF_SAMPLING
+	help
+	  Serial early console driver for Qualcomm Technologies Inc's GENI
+	  based QUP hardware.
+
 config SERIAL_QCOM_GENI
 	tristate "QCOM on-chip GENI based serial port support"
 	depends on ARCH_QCOM || COMPILE_TEST
drivers/tty/serial/Makefile +1 -0
index d056ee6cca33..7b6422e9d638 100644
@@ -55,6 +55,7 @@ obj-$(CONFIG_SERIAL_VR41XX) += vr41xx_siu.o
 obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o
 obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o
 obj-$(CONFIG_SERIAL_MSM) += msm_serial.o
+obj-$(CONFIG_SERIAL_MSM_GENI_EARLY_CONSOLE) += msm_geni_serial_console.o
 obj-$(CONFIG_SERIAL_QCOM_GENI) += qcom_geni_serial.o
 obj-$(CONFIG_SERIAL_OMAP) += omap-serial.o
 obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o
drivers/tty/serial/msm_geni_serial_console.c new file +483 -0

483 lines not on this page · raw message

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
maintainer
#1 lore raw
Quoted 9 lines · Savaliya

From: Mukesh Kumar Savaliya <[email protected]>

This change enables earlyconsole support as static driver for geni based UART. Kernel space UART console driver will be generic for console and other usecases of UART.

---
Removed mb() calls as *_relaxed() should take care.

What about what happened from v1?

ALways keep the full changelog here, otherwise we don't remember what happened.

drivers/tty/serial/msm_geni_serial_console.c line 186

Quoted 5 lines
drivers/tty/serial/msm_geni_serial_console.c new file +5 -0
+static void se_io_set_mode_earlycon(void __iomem *base)
+{
+	unsigned int io_mode;
+
+	io_mode = readl_relaxed(base+SE_IRQ_EN);
	io_mode = readl_relaxed(base + SE_IRQ_EN);

please. Use ' ', there is no need to not do so.

thanks,

greg k-h

#2 lore raw
Quoted 7 lines · Greg KH
Quoted 6 lines · Savaliya

From: Mukesh Kumar Savaliya <[email protected]>

This change enables earlyconsole support as static driver for geni based UART. Kernel space UART console driver will be generic for console and other usecases of UART.

Quoted 7 lines
Quoted 3 lines

---
Removed mb() calls as *_relaxed() should take care.

What about what happened from v1?

ALways keep the full changelog here, otherwise we don't remember what happened.

Sure. Added V2,V3,V4 history of changes.

Quoted 9 lines

drivers/tty/serial/msm_geni_serial_console.c line 186

Quoted 6 lines
drivers/tty/serial/msm_geni_serial_console.c new file +5 -0
+static void se_io_set_mode_earlycon(void __iomem *base)
+{
+	unsigned int io_mode;
+
+	io_mode = readl_relaxed(base+SE_IRQ_EN);
	io_mode = readl_relaxed(base + SE_IRQ_EN);

please. Use ' ', there is no need to not do so.

Sure, Done

Quoted 4 lines

thanks,

greg k-h