From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00036C07E96 for ; Tue, 6 Jul 2021 22:51:53 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 74BF661C60 for ; Tue, 6 Jul 2021 22:51:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74BF661C60 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7213882DCE; Wed, 7 Jul 2021 00:51:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="XU+XRmtK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A7DB82DD7; Wed, 7 Jul 2021 00:51:06 +0200 (CEST) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 999CF82DB6 for ; Wed, 7 Jul 2021 00:51:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf31.google.com with SMTP id h18so153822qve.1 for ; Tue, 06 Jul 2021 15:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rBRBQpCC3pWdccCq7mdVHKGIo3XJEhCs65qa7DZkpuk=; b=XU+XRmtKMUAFLLDhu5LuBbCCTqSCXyCR2M3xkFugI2Bwat31KhSwcI0NewUjeEl6/J PlLNT0In/3DONSwNKXeslA+F75sE9Y4Hulnj6I9ehjYJtWpvlki8JkUHSQvLxzXuFscZ UEJBzcVQJ5KhgBh5fUQ/6A9TcTpg4uljg9kj8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rBRBQpCC3pWdccCq7mdVHKGIo3XJEhCs65qa7DZkpuk=; b=fWb87ANrNY1duDnDDngcPvVHcGTJ08ZN5xdBsFzTpnJYY5jMvf6ywgMTcEYla8kssQ e0jHvZL8Gse9wAD2aA7RDVNJBcng99MlmZE91skiJsVfOmks42ypuIdxsRzCNprtsIXQ FUXAYzDHlYipnLAzu4C/Ze1LhXBrodRYXIc1e9jqaZwrPsIANbUMzXKD+mibfZt222Hl VlWjLM4Uf9PnYWCJxTGn+Sn7nGUkcFl+e0g4VMU1pf6Bc3SNeIURoaScpE4pVxx0I8Lf moDTqD/zKhlefs/bg4vMjexKZVbJJwLqRgySN15gqNP/B0O9vnEKkwytjvfqXS9yX7w4 w7/g== X-Gm-Message-State: AOAM531pZTayN8oeAJfdYc3CDrk9pEFouls8RcnFindTFMfVcmiIHXod sXxM14xGgZFQTC0huQJDG2KUEA5YrsQf8A== X-Google-Smtp-Source: ABdhPJxDHdmkwwtfx3/Nbsu6WmZaF2eyV1fhXSO8JzLed59MnSJU7ZQOIJm5Uqhe8HP7WkhhxWgS+w== X-Received: by 2002:a05:6214:2246:: with SMTP id c6mr20908187qvc.56.1625611860386; Tue, 06 Jul 2021 15:51:00 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-5120-5dda-66b4-5098.res6.spectrum.com. [2603:6081:7b01:cbda:5120:5dda:66b4:5098]) by smtp.gmail.com with ESMTPSA id f8sm3248421qtk.49.2021.07.06.15.50.59 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Jul 2021 15:50:59 -0700 (PDT) Date: Tue, 6 Jul 2021 18:50:58 -0400 From: Tom Rini To: Stephan Gerhold Cc: u-boot@lists.denx.de, Ramon Fried Subject: Re: [PATCH] serial: serial_msm: Ensure BAM/single character mode are disabled Message-ID: <20210706225058.GQ9516@bill-the-cat> References: <20210628084009.3098-1-stephan@gerhold.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+nE/WK0BYpJmhB0y" Content-Disposition: inline In-Reply-To: <20210628084009.3098-1-stephan@gerhold.net> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --+nE/WK0BYpJmhB0y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. >=20 > 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. >=20 > This causes early UART log in Linux to be corrupted like this: >=20 > [ 00ano:ameoi .Q1B[ 00ac _idaM00080oo'ahani-lcle._20). 15NdNii 5 SPMS= J20:U2 > [ 00rkoolmsamel > [ 00Fw ]elamletopsioble > [ 00ore >=20 > instead of >=20 > [ 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 (o= ptions '') > [ 0.000000] printk: bootconsole [msm_serial_dm0] enabled >=20 > Make sure to initialize UART_DM_DMEN correctly to fix this issue > when loading U-Boot directly after SBL (instead of through LK). >=20 > There is no functional difference when loading U-Boot through LK > since LK also initializes UART_DM_DMEN to 0x0. [1] >=20 > [1]: https://git.linaro.org/landing-teams/working/qualcomm/lk.git/tree/pl= atform/msm_shared/uart_dm.c?h=3Ddragonboard410c-LA.BR.1.2.7-03810-8x16.0-li= naro3#n203 >=20 > Cc: Ramon Fried > Signed-off-by: Stephan Gerhold > Reviewed-by: Ramon Fried Applied to u-boot/master, thanks! --=20 Tom --+nE/WK0BYpJmhB0y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDk3lEACgkQFHw5/5Y0 tyxwqQwAuordwUIfHK1f2v72vi7TbiFVnTzmIhYvI4SbUEs2b23XnBiS5NAogdBz 1iJtpWPtEseCZClJgXrk0Y2RLS2UiidzMk5xYHezZl5z5aNnNvTHuTGauTbJoaFb FyY82v5pHb+Iv965fV0VIbERg2ldoCdLMdX0QY6LCETkFGQLWH6cYVtfdrYM7jt2 HEodvxTklgskTspbpXs9LHJ+BQJT+RmltUcyDcnWrRLzRC/7hzjp6b0ls1B9D7Jx CTo4qiP3MA3OomQHr1dz88XyMzN1bTSaZlv4SonpZSQcITKFlUiqD5hu5/oBC7nv poWr/wwe2Ugy7ntC0EEbBUoXEGpRTDMFKGzMHOapxMFXf4DLaDSWeLzdQ1FGTcxi HRSvLMcdHsLf1CK2p8ww0udnmI9fHvbETIvVmRsNFeYHmueS4hlFoHlTAWi4danu KVCyCYOmfZ8auuApsyP0VYBJYfnH199NtfZS9TGMAm53UmvoYUL+mfJkasa3nqcs LzxTCgNc =Fcoy -----END PGP SIGNATURE----- --+nE/WK0BYpJmhB0y--