[PATCH 1/6 v4] serial: qcom: add support for GENI serial driver

Simon Glass sjg at chromium.org
Mon Nov 1 00:47:05 CET 2021


Hi Dzmitry,

On Fri, 15 Oct 2021 at 10:22, Dzmitry Sankouski <dsankouski at gmail.com> wrote:
>
>
> чт, 14 окт. 2021 г. в 18:10, Simon Glass <sjg at chromium.org>:
>>
>> Hi Dzmitry,
>>
>> On Fri, 8 Oct 2021 at 00:46, Dzmitry Sankouski <dsankouski at gmail.com> wrote:
>> >
>> > Generic Interface (GENI) Serial Engine (SE) based uart
>> > can be found on newer qualcomm SOCs, starting from SDM845.
>> > Tested on Samsung SM-G9600(starqltechn)
>> > by chain-loading u-boot with stock bootloader.
>> >
>> > Signed-off-by: Dzmitry Sankouski <dsankouski at gmail.com>
>> > Cc: Ramon Fried <rfried.dev at gmail.com>
>> > Cc: Tom Rini <trini at konsulko.com>
>> > ---
>> > Changes for v2:
>> > - change functions return type to void, where possible
>> > - remove '.' from summary line
>> > Changes for v3:
>> > - move function open brace on new line
>> > - use tab between define name and value
>> > - define: wrap expression with braces, remove braces from constants
>> > Changes for v4:
>> > - add linux/delay.h header
>> >
>> >  MAINTAINERS                                   |   1 +
>> >  .../serial/msm-geni-serial.txt                |   6 +
>> >  drivers/serial/Kconfig                        |  17 +
>> >  drivers/serial/Makefile                       |   1 +
>> >  drivers/serial/serial_msm_geni.c              | 603 ++++++++++++++++++
>> >  5 files changed, 628 insertions(+)
>> >  create mode 100644 doc/device-tree-bindings/serial/msm-geni-serial.txt
>> >  create mode 100644 drivers/serial/serial_msm_geni.c
>>
>> Reviewed-by: Simon Glass <sjg at chromium.org>
>>
>> Some nits below
>>
>> >
>> > diff --git a/MAINTAINERS b/MAINTAINERS
>> > index 776ff703b9..52ddc99cda 100644
>> > --- a/MAINTAINERS
>> > +++ b/MAINTAINERS
>> > @@ -390,6 +390,7 @@ F:  drivers/gpio/msm_gpio.c
>> >  F:     drivers/mmc/msm_sdhci.c
>> >  F:     drivers/phy/msm8916-usbh-phy.c
>> >  F:     drivers/serial/serial_msm.c
>> > +F:     drivers/serial/serial_msm_geni.c
>> >  F:     drivers/smem/msm_smem.c
>> >  F:     drivers/usb/host/ehci-msm.c
>> >
>> > diff --git a/doc/device-tree-bindings/serial/msm-geni-serial.txt b/doc/device-tree-bindings/serial/msm-geni-serial.txt
>> > new file mode 100644
>> > index 0000000000..9eadc2561b
>> > --- /dev/null
>> > +++ b/doc/device-tree-bindings/serial/msm-geni-serial.txt
>> > @@ -0,0 +1,6 @@
>> > +Qualcomm GENI UART
>> > +
>> > +Required properties:
>> > +- compatible: must be "qcom,msm-geni-uart"
>> > +- reg: start address and size of the registers
>> > +- clock: interface clock (must accept baudrate as a frequency)
>> > diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
>> > index 93348c0929..b420a5720d 100644
>> > --- a/drivers/serial/Kconfig
>> > +++ b/drivers/serial/Kconfig
>> > @@ -278,6 +278,14 @@ config DEBUG_UART_S5P
>> >           will need to provide parameters to make this work. The driver will
>> >           be available until the real driver-model serial is running.
>> >
>> > +config DEBUG_UART_MSM_GENI
>>
>> Do you need this? Most drivers just use the existing DEBUG_UART Kconfig.
>
>
> Documentation for CONFIG_DEBUG_UART says:
> `- Enable the CONFIG for your UART to tell it to provide this interface
>        (e.g. CONFIG_DEBUG_UART_NS16550)`
> Debug functionality is controlled by chip specific CONFIG_DEBUG_UART_*.
> So no serial driver uses  plain DEBUG_UART for adding debug functionality.

Ah yes. Well I suppose I am allow to forgot something I wrote 6 years ago.

For my own information, the reason is basically because we can only
have one debug UART, but can have multiple UART drivers with driver
model. So we need to select which to use as a debug UART.

It is a bit unfortunate, since in the vast majority of cases, we only
have a single UART driver in use.

Regards,
Simon


More information about the U-Boot mailing list