All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Stephan Gerhold <stephan@gerhold.net>
Cc: u-boot@lists.denx.de, Ramon Fried <rfried.dev@gmail.com>
Subject: Re: [PATCH] serial: serial_msm: Ensure BAM/single character mode are disabled
Date: Tue, 6 Jul 2021 18:50:58 -0400	[thread overview]
Message-ID: <20210706225058.GQ9516@bill-the-cat> (raw)
In-Reply-To: <20210628084009.3098-1-stephan@gerhold.net>

[-- Attachment #1: Type: text/plain, Size: 2345 bytes --]

On Mon, Jun 28, 2021 at 10:40:09AM +0200, Stephan Gerhold wrote:

> At the moment, the U-Boot serial_msm driver does not initialize the
> UART_DM_DMEN register with the required value. Usually this does not
> cause any problems, because there is Qualcomm's LK bootloader running
> before U-Boot which initializes the register with the correct value.
> 
> It's important that this register is initialized correctly, because
> the U-Boot driver does not make use of the BAM/DMA or single character
> mode functionality of the UART controller. A different bootloader
> before U-Boot might initialize the register differently.
> 
> For example, on DragonBoard 410c U-Boot can also be installed to the
> "aboot" partition (replacing LK entirely). In this case U-Boot is
> loaded directly by SBL, which seems to use the single-character mode
> for some reason. In single character mode there is always just one
> char in the FIFO, instead of the 4 characters expected by
> msm_serial_fetch(). It also causes issues with "earlycon" later in
> the Linux kernel, which tries to output 4 chars at once,
> but only the first char will be written.
> 
> This causes early UART log in Linux to be corrupted like this:
> 
>     [ 00ano:ameoi .Q1B[ 00ac _idaM00080oo'ahani-lcle._20). 15NdNii 5 SPMSJ20:U2
>     [ 00rkoolmsamel
>     [ 00Fw ]elamletopsioble
>     [ 00ore
> 
> instead of
> 
>     [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd030]
>     [    0.000000] Machine model: Qualcomm Technologies, Inc. APQ 8016 SBC
>     [    0.000000] earlycon: msm_serial_dm0 at MMIO 0x00000000078b0000 (options '')
>     [    0.000000] printk: bootconsole [msm_serial_dm0] enabled
> 
> Make sure to initialize UART_DM_DMEN correctly to fix this issue
> when loading U-Boot directly after SBL (instead of through LK).
> 
> There is no functional difference when loading U-Boot through LK
> since LK also initializes UART_DM_DMEN to 0x0. [1]
> 
> [1]: https://git.linaro.org/landing-teams/working/qualcomm/lk.git/tree/platform/msm_shared/uart_dm.c?h=dragonboard410c-LA.BR.1.2.7-03810-8x16.0-linaro3#n203
> 
> Cc: Ramon Fried <rfried.dev@gmail.com>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

      parent reply	other threads:[~2021-07-06 22:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28  8:40 [PATCH] serial: serial_msm: Ensure BAM/single character mode are disabled Stephan Gerhold
2021-06-28 17:15 ` Ramon Fried
2021-06-28 18:59   ` Stephan Gerhold
2021-06-28 19:04     ` Ramon Fried
2021-06-28 19:16       ` Stephan Gerhold
2021-06-29  5:16         ` Ramon Fried
2021-06-29 11:06           ` Stephan Gerhold
2021-06-29 11:16             ` Ramon Fried
2021-06-29 11:16 ` Ramon Fried
2021-07-06 22:50 ` Tom Rini [this message]

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=20210706225058.GQ9516@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=rfried.dev@gmail.com \
    --cc=stephan@gerhold.net \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.