On 4/29/2020 11:08 PM, Greg KH wrote:
On Wed, Apr 29, 2020 at 10:49:34PM +0530, Mukesh, Savaliya wrote:
From: Mukesh Kumar Savaliya <msavaliy@xxxxxxxxxxxxxx>
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.
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@xxxxxxxxxxxxxx>
---
drivers/tty/serial/Kconfig | 15 +
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/msm_geni_serial_console.c | 525 +++++++++++++++++++
3 files changed, 541 insertions(+)
create mode 100644 drivers/tty/serial/msm_geni_serial_console.c
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 0aea76cd67ff..ded19d80e696 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -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.
How do we know this? Can't this be dynamically determined at runtime?
What about kernels that want to be built for both types of hardware at
the same time?
This will vary for different hardware only if QUP version is lower than
this.
We can not determine this dynamically because register address space to
read QUP version is in QUP wrapper space and that also keep varying per
target.
we only get internal SE address base in cmdline arg.
+ 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.
Why can't we have early console without SERIAL_MSM_GENI_HALF_SAMPLING?
Why are these tied directly to each other? Do you really need 2
options?
HALF_SAMPLING controlls the sampling rate of UART HW, if not then logs
come garbled due to wrong sampling.
+
config SERIAL_QCOM_GENI
tristate "QCOM on-chip GENI based serial port support"
depends on ARCH_QCOM || COMPILE_TEST
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index d056ee6cca33..9790ef2d802c 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -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-$(SERIAL_MSM_GENI_EARLY_CONSOLE) += msm_geni_serial_console.o
I don't think you tested this at all :(
I've stopped here in the review for this obvious reason...
Done the changes. Sorry, i compiled with the static config but missed to
add back when compiled with config change.
Uploaded new change.
thanks,
greg k-h