From patchwork Wed Jul 14 08:56:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 1505068 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gerhold.net header.i=@gerhold.net header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=T5F23C/q; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPrwT6qPQz9sXk for ; Wed, 14 Jul 2021 18:56:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2898980ECD; Wed, 14 Jul 2021 10:56:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gerhold.net header.i=@gerhold.net header.b="T5F23C/q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7A60D80F03; Wed, 14 Jul 2021 10:56:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [81.169.146.166]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6434280ECD for ; Wed, 14 Jul 2021 10:56:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=stephan@gerhold.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1626253000; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=6NngWtjEreRdoJ60NIU45WmQZIjezqly+rY5UhF+7HA=; b=T5F23C/qQQnoqxCmrF8cQjOWJbg+h9pOejEUmvdaqRoPx1dds6bLYoHDggO4G7Qqip dhACL2nYiuM3qbxw2YYxPO6YMwLxkQHD+JqqUrMI1r4sKbQFCoFWU8EfPrGVuZk/kvX2 f3fu5d7QRfRd9KZ2lwPOhF5p3DmFo/dd2beaHHguJX046xRp54Hnq2tkctW4B4VWY5uc Vm25joKo9Flp05WG2Db5I0yo9kbUNWFoWdR0VLws0cskWj5yX/oqEoEHp5tpBs+FH3B0 rcLTl+j39xRueDLOCQ/1MGEtxT4Y7l3gU6ciyt6E2WNGLqqaIXSE1ROUPuAGcU2dywgA m7eQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4m6Ijuk=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.28.1 DYNA|AUTH) with ESMTPSA id Y070ccx6E8udN8D (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 14 Jul 2021 10:56:39 +0200 (CEST) From: Stephan Gerhold To: u-boot@lists.denx.de Cc: Nicolas Dechesne , Ramon Fried , Stephan Gerhold Subject: [PATCH 1/3] board: dragonboard410c: Fix PHYS_SDRAM_1_SIZE Date: Wed, 14 Jul 2021 10:56:24 +0200 Message-Id: <20210714085626.5961-2-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210714085626.5961-1-stephan@gerhold.net> References: <20210714085626.5961-1-stephan@gerhold.net> MIME-Version: 1.0 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 The DragonBoard 410c has proprietary firmware from Qualcomm that reserves 8 MiB of memory for tz/smem/hyp/rmtfs/rfsa from 0x86000000 to 0x86800000. I'm not aware of any ATF (ARM Trusted Firmware) port for DB410c that would reserve 30 MiB of memory at the end of RAM. I suspect the comment might have been copied from hikey.h which has a very similar comment (and which actually does have an ATF port). Reducing the memory size just prevents U-Boot from using the end of the RAM, not the reserved region inbetween. Therefore we might as well display the correct DRAM size (1 GiB) instead of strange 986 MiB. Fixes: 626f048bbc14 ("board: Add Qualcomm Dragonboard 410C support") Signed-off-by: Stephan Gerhold Reviewed-by: Ramon Fried --- include/configs/dragonboard410c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h index 1f08508c4d..6474e57b29 100644 --- a/include/configs/dragonboard410c.h +++ b/include/configs/dragonboard410c.h @@ -16,8 +16,8 @@ /* Physical Memory Map */ #define PHYS_SDRAM_1 0x80000000 -/* 1008 MB (the last ~30Mb are secured for TrustZone by ATF*/ -#define PHYS_SDRAM_1_SIZE 0x3da00000 +/* Note: 8 MiB (0x86000000 - 0x86800000) are reserved for tz/smem/hyp/rmtfs/rfsa */ +#define PHYS_SDRAM_1_SIZE SZ_1G #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x7fff0) #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x80000) From patchwork Wed Jul 14 08:56:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 1505071 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gerhold.net header.i=@gerhold.net header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=b/2xjJwq; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPrwz0vb5z9sXb for ; Wed, 14 Jul 2021 18:57:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 10A86817D3; Wed, 14 Jul 2021 10:57:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gerhold.net header.i=@gerhold.net header.b="b/2xjJwq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 60AEC80FBA; Wed, 14 Jul 2021 10:56:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B37BB80EE5 for ; Wed, 14 Jul 2021 10:56:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=stephan@gerhold.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1626253000; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=X9Vl2NF+UPBLdqjjNz3sTC65fQ6jXrnFMeGuxjbkiRE=; b=b/2xjJwqhYGgQePUeS1RKDV9sKbFxIUFX27xPZEx0CycUcyGuSGr6ewQOxFJMWpUy7 aGZLvVVfGyCNJH/rtcoy4WzAMCcx3CsSHQjkQL7Pjx4qCWiK6cUTn9aLR8GVKUdLJzb4 WP91zbRlS2QHBYSPGcBf5zFihd7DSDeupm6Ujjj57Btd2Hao6M1rBUE9yUklCXxO7kmf Lpq3bOuy9Yf07qBiIRqNZD4+nS39MgUGsOYkQDS20QcDFlcp4gNu8r0PPBSxFJse4T8c AL0HPKqJFApaEVuOEX9/Oi6NdTC5PWdKGtprhKC5rZjI0Wp8/pAxZhVSENeXZdv35l9V OU3w== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4m6Ijuk=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.28.1 DYNA|AUTH) with ESMTPSA id Y070ccx6E8ueN8E (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 14 Jul 2021 10:56:40 +0200 (CEST) From: Stephan Gerhold To: u-boot@lists.denx.de Cc: Nicolas Dechesne , Ramon Fried , Stephan Gerhold Subject: [PATCH 2/3] board: dragonboard410c: Fix fastboot Date: Wed, 14 Jul 2021 10:56:25 +0200 Message-Id: <20210714085626.5961-3-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210714085626.5961-1-stephan@gerhold.net> References: <20210714085626.5961-1-stephan@gerhold.net> MIME-Version: 1.0 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 At the moment pressing the volume down key does not actually launch fastboot. This is because setting "bootdelay" to "-1" actually disables autoboot and drops to the U-Boot console. It does not execute the "bootcmd". The correct value for "bootdelay" here would be "-2", which disables the delay and key checking and would immediately execute the "bootcmd". However, even better in this case is using "preboot" to trigger Fastboot. The advantage is that running "fastboot continue" will actually continue the autoboot process instead of ending up in the U-Boot shell. Also make sure to unset "preboot" again immediately in case the user saves the environment after triggering fastboot. Cc: Ramon Fried Fixes: aa043ee91a47 ("db410c: automatically launch fastboot") Signed-off-by: Stephan Gerhold Reviewed-by: Ramon Fried --- board/qualcomm/dragonboard410c/dragonboard410c.c | 3 +-- configs/dragonboard410c_defconfig | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c index 3b71881cac..371b3262f8 100644 --- a/board/qualcomm/dragonboard410c/dragonboard410c.c +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c @@ -132,8 +132,7 @@ int misc_init_r(void) } if (dm_gpio_get_value(&resin)) { - env_set("bootdelay", "-1"); - env_set("bootcmd", "fastboot 0"); + env_set("preboot", "setenv preboot; fastboot 0"); printf("key_vol_down pressed - Starting fastboot.\n"); } diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig index dc9d0d893c..a46283f980 100644 --- a/configs/dragonboard410c_defconfig +++ b/configs/dragonboard410c_defconfig @@ -10,6 +10,7 @@ CONFIG_DISTRO_DEFAULTS=y # CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_FIT=y CONFIG_OF_BOARD_SETUP=y +CONFIG_USE_PREBOOT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_MISC_INIT_R=y From patchwork Wed Jul 14 08:56:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 1505070 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gerhold.net header.i=@gerhold.net header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=N7jPepBo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPrwm2vkDz9sXk for ; Wed, 14 Jul 2021 18:57:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D1239812A6; Wed, 14 Jul 2021 10:56:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gerhold.net header.i=@gerhold.net header.b="N7jPepBo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2EC2B80F27; Wed, 14 Jul 2021 10:56:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1A5B080EE9 for ; Wed, 14 Jul 2021 10:56:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=stephan@gerhold.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1626253001; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=XlI90kdtHWKz0OKLYsjuwzAoKgnXGzfieTeZgN6XJ5o=; b=N7jPepBovTf3db3LsUSvYd583V89k0/xjTk1MUoEoX6se5IEqzIEe0/OA/dJuEDTYp 4md3DTHzBXS2o33E/63b2QNXwcxkps/IhxcGV1Skmf2p9zsrL7baJR4PbRMDxjBFZbDt sUY5pmDD6jCS85Vghoj7ELYvGIOETimNY+WKz5wwm7HRR4BQruzM6mu6WRSJkm+4ovq/ 4PtUstU+Jhw9S9GTMDbKdAQyAU82LzKQr8odvMJMtJ3Fno+26p3bm3lXIeQIkg2vfmH1 VCSOhdN/hw8HYEGUtuLPqrx8KoqWKnx0uKaR4rDRRCAJlG19/8a/MMlF7KlC+2tMaODw t3rQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4m6Ijuk=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.28.1 DYNA|AUTH) with ESMTPSA id Y070ccx6E8ueN8F (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 14 Jul 2021 10:56:40 +0200 (CEST) From: Stephan Gerhold To: u-boot@lists.denx.de Cc: Nicolas Dechesne , Ramon Fried , Stephan Gerhold Subject: [PATCH 3/3] serial: serial_msm: Delay initialization to let pins stabilize Date: Wed, 14 Jul 2021 10:56:26 +0200 Message-Id: <20210714085626.5961-4-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210714085626.5961-1-stephan@gerhold.net> References: <20210714085626.5961-1-stephan@gerhold.net> MIME-Version: 1.0 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 For some reason, the DragonBoard 410c aborts autoboot immediately if U-Boot is started without LK. It looks like it picks up a single broken character via serial and therefore believes a key was pressed to abort autoboot. After some debugging, it seems like adding some delay after pinctrl setup but before UART initialization fixes the issue. It's also worth mentioning that unlike when booting from LK, the pinctrl setup is actually necessary when booting U-Boot without LK since UART is broken if the pinctrl line is removed. I suspect that reconfiguring the pins might take some time to stabilize and if the UART controller is enabled too quickly it will pick up some random noise. Adding a few milliseconds of delay fixes the issue and shouldn't have any other negative side effects. 3ms seems to be the minimum delay required in my tests, use 5ms instead just to be sure. Signed-off-by: Stephan Gerhold --- drivers/serial/serial_msm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c index d8dd5c1104..ac4d0824b9 100644 --- a/drivers/serial/serial_msm.c +++ b/drivers/serial/serial_msm.c @@ -18,6 +18,7 @@ #include #include #include +#include #include /* Serial registers - this driver works in uartdm mode*/ @@ -193,6 +194,9 @@ static int msm_uart_clk_init(struct udevice *dev) static void uart_dm_init(struct msm_serial_data *priv) { + /* Delay initialization for a bit to let pins stabilize if necessary */ + mdelay(5); + writel(priv->clk_bit_rate, priv->base + UARTDM_CSR); writel(0x0, priv->base + UARTDM_MR1); writel(MSM_BOOT_UART_DM_8_N_1_MODE, priv->base + UARTDM_MR2);