From patchwork Sun Nov 20 16:56:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1706962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=DtTpoWV7; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NFcBh1g15z23n6 for ; Mon, 21 Nov 2022 03:57:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 70B63854B8; Sun, 20 Nov 2022 17:56:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="DtTpoWV7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BE65385443; Sun, 20 Nov 2022 17:56:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A0E6C85369 for ; Sun, 20 Nov 2022 17:56:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C8B24CE0689; Sun, 20 Nov 2022 16:56:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5F01C433C1; Sun, 20 Nov 2022 16:56:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668963395; bh=GxuluV3t+5lmXw/xGjk8XKKoyFWEe2tKjQlq3H+H3kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DtTpoWV7vDBn85OWWnPpXkPKyquzUYGz1e78Fl5CkvnJ8arbN3bvROpN+nMa43WPP h844ynSaFr3j4bCZXGDxHG3dqMQ1nXpBmxnm+qbRosuxRTszMJw9D7rYUcLhXSiTFC mic/k2uQAGhf1fTpJiqBjNB4lUwLyvUeZXfneelbkLPS4AHT4gmlrQrZkrmG0D7Oex eGJx2Y6n7f4FMwQWq4Nj54dWwCQCgiV6Mz1Dh7fqq0wiidoqwLRTNuUwgrV9Q7CsgG BrgSgsUkTstbL6ia4K0w8Y647e2GmlLt1bDEq7FbNovTMSO5MsJ6Uvr8wftg1vMCaC GYPaZxyP/VnHA== Received: by pali.im (Postfix) id 6D4BF87E; Sun, 20 Nov 2022 17:56:33 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Tom Rini Cc: u-boot@lists.denx.de, maemo-leste@lists.dyne.org Subject: [PATCH 1/3] arm32: Fix relocation of env_addr if POSITION_INDEPENDENT=y Date: Sun, 20 Nov 2022 17:56:26 +0100 Message-Id: <20221120165628.14661-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221120165628.14661-1-pali@kernel.org> References: <20221120165628.14661-1-pali@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Apply commit 534f0fbd6520 ("arm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y") also for 32-bit ARM. This change fixes crashing of U-Boot on ARMv7 (Omap3 / Cortex-A8) Nokia N900 phone (real HW). Note that qemu emulator of this board with same u-boot.bin binary has not triggered this crash. Crash happened after U-Boot printed following debug lines to serial console: initcall: 0001ea8c (relocated to 8fe0aa8c) Loading Environment from ... Using default environment Destroy Hash Table: 8fe25a98 table = 00000000 Create Hash Table: N=387 Signed-off-by: Pali Rohár --- arch/arm/lib/crt0.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index 6d566dca5c81..a0311438b458 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -147,6 +147,11 @@ ENTRY(_main) ldr r1, =CONFIG_TEXT_BASE sub r1, r0 add lr, r1 +#if defined(CONFIG_SYS_RELOC_GD_ENV_ADDR) + ldr r0, [r9, #GD_ENV_ADDR] /* r0 = gd->env_addr */ + add r0, r0, r1 + str r0, [r9, #GD_ENV_ADDR] +#endif #endif ldr r0, [r9, #GD_RELOC_OFF] /* r0 = gd->reloc_off */ add lr, lr, r0 From patchwork Sun Nov 20 16:56:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1706961 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pWlXLB+/; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NFcBT3kLLz23n6 for ; Mon, 21 Nov 2022 03:57:05 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E99C88544F; Sun, 20 Nov 2022 17:56:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="pWlXLB+/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 43BE3854B3; Sun, 20 Nov 2022 17:56:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2D58785498 for ; Sun, 20 Nov 2022 17:56:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B0C9160C86; Sun, 20 Nov 2022 16:56:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE92DC433B5; Sun, 20 Nov 2022 16:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668963397; bh=+dkj7tPXktvMsIsTaWK/KkBcbSvU0EJnI2bG07cOc/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pWlXLB+/ur1+XtytTc+YjZc0uRbLUuo+LoAzkBVEZNunBdj9ELl7pCPlUZJ/MpPHN amjTj0FoRbGQYkAwbfR5VEkkf5tc1Wx1mqCjJj8/yB5w9wHQv/oLZgzVvC6RX02GmE xnxRwi1BnvmnWTtX6b+etW8xsO0JN7HwRXwcPv3tKDSKB44D67avaGtsQ/VL7sOhJW RqqvE2PKp/Wc2+G9fZIUWEjvswQZNJD89qV68dYUvHGxqskCB8VajM6ATh66SbKoB/ DhGtJsbdY8mZHjMeVnvJK1Y7K1EvfRXs1GFV2LmySLs7tSQD/uPpeLebOGcYYu3NTT dBaqkijlNEJQQ== Received: by pali.im (Postfix) id 91B9189C; Sun, 20 Nov 2022 17:56:34 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Tom Rini Cc: u-boot@lists.denx.de, maemo-leste@lists.dyne.org Subject: [PATCH 2/3] Nokia RX-51: Document debugging options and compile command Date: Sun, 20 Nov 2022 17:56:27 +0100 Message-Id: <20221120165628.14661-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221120165628.14661-1-pali@kernel.org> References: <20221120165628.14661-1-pali@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Add example command how to compile U-Boot and add new documentation section describing how to enable early debug UART and verbose log output for N900. Signed-off-by: Pali Rohár --- doc/board/nokia/rx51.rst | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/board/nokia/rx51.rst b/doc/board/nokia/rx51.rst index 7c6647bce22e..93502e2dfc05 100644 --- a/doc/board/nokia/rx51.rst +++ b/doc/board/nokia/rx51.rst @@ -9,6 +9,10 @@ on a real N900. It does very little hardware configuration because NOLO has already configured the board. It is only needed to enable the internal eMMC memory via the twl4030 regulator which is not enabled by NOLO. +.. code-block:: bash + + make CROSS_COMPILE=arm-linux-gnueabi- nokia_rx51_defconfig u-boot.bin + NOLO is expecting a kernel image and will treat any image it finds in OneNAND as such. This u-boot is intended to be flashed to the N900 like a kernel. In order to transparently boot the original kernel, it will be @@ -160,6 +164,34 @@ UBIFS support add following lines into file ``configs/nokia_rx51_defconfig``:: CONFIG_CMD_UBIFS=y CONFIG_MTD_UBI_BEB_LIMIT=10 +Early output +------------ + +Early U-Boot output can be enabled on serial console by adding following lines +into file ``configs/nokia_rx51_defconfig``:: + + CONFIG_DEBUG_UART=y + CONFIG_DEBUG_UART_OMAP=y + CONFIG_DEBUG_UART_SHIFT=2 + CONFIG_DEBUG_UART_BASE=0x49020000 + CONFIG_DEBUG_UART_CLOCK=48000000 + +Note that early output is not available on USB tty console. + +Verbose debug output +-------------------- + +Verbose debug output with maximal log level can be enabled by adding following +lines into file ``configs/nokia_rx51_defconfig``:: + + CONFIG_DM_DEBUG=y + CONFIG_LOG=y + CONFIG_LOGLEVEL=9 + CONFIG_LOG_MAX_LEVEL=9 + CONFIG_LOG_DEFAULT_LEVEL=9 + +And compiling U-Boot by additional make parameter ``KCPPFLAGS=-DLOG_DEBUG``. + Run in QEMU ----------- From patchwork Sun Nov 20 16:56:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1706960 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Ftksk6wE; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NFcBH19h9z23n6 for ; Mon, 21 Nov 2022 03:56:55 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F00B6854AC; Sun, 20 Nov 2022 17:56:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Ftksk6wE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 116A285369; Sun, 20 Nov 2022 17:56:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 06B99853E7 for ; Sun, 20 Nov 2022 17:56:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8BDBBB80B24; Sun, 20 Nov 2022 16:56:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 172EAC433D6; Sun, 20 Nov 2022 16:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668963396; bh=ZpSVlqrpKELZY3t7TrP0K0/+wqn6PeY4sB4bvLcQ+wY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ftksk6wE513OysIIrNpWYOPhLurdjmvEJKI+n9jiwakgSGsWOSxRCrDH9u5ZuDvP/ HoHdpspDvgT/CFYV2jL0kbZDmwYyt1z9FMNh0F8HugFXUmYrisauzY8YU+vXe0QWaW BB8uv+LRMseFZjWIExn3zCwNTkzQc8sCbeHympIrwkozOG+64oC5U1cOlzTyPF7ab2 tZA3aWigaqSWCOGniqjmeMHy7C5XJYu9DwQANt6tu9dm+h+Dbi7GfUB2p3cws5PB1w q3GcfsU3Z15fHU9J1Fb9IC4NrHi0SMW83zzW77sol3mYTw46BYLvzBcM+/gJj+HOGT 7H1PzTjbeUk3A== Received: by pali.im (Postfix) id C57BA82F; Sun, 20 Nov 2022 17:56:35 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Tom Rini Cc: u-boot@lists.denx.de, maemo-leste@lists.dyne.org Subject: [PATCH 3/3] Nokia RX-51: Do not overwrite standard $loadaddr variable Date: Sun, 20 Nov 2022 17:56:28 +0100 Message-Id: <20221120165628.14661-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221120165628.14661-1-pali@kernel.org> References: <20221120165628.14661-1-pali@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Instead of overwriting $loadaddr variable, use custom temporary $fileloadaddr variable. So scripts can access default/original address stored in $loadaddr at build time. Signed-off-by: Pali Rohár --- include/configs/nokia_rx51.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index a88cfe77d50c..99a020c3c71d 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -78,15 +78,16 @@ "kernaddr=0x82008000\0" \ "initrdaddr=0x84008000\0" \ "scriptaddr=0x86008000\0" \ + "fileloadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \ - "${loadaddr} ${mmcfile}\0" \ - "kernload=setenv loadaddr ${kernaddr};" \ + "${fileloadaddr} ${mmcfile}\0" \ + "kernload=setenv fileloadaddr ${kernaddr};" \ "setenv mmcfile ${mmckernfile};" \ "run fileload\0" \ - "initrdload=setenv loadaddr ${initrdaddr};" \ + "initrdload=setenv fileloadaddr ${initrdaddr};" \ "setenv mmcfile ${mmcinitrdfile};" \ "run fileload\0" \ - "scriptload=setenv loadaddr ${scriptaddr};" \ + "scriptload=setenv fileloadaddr ${scriptaddr};" \ "setenv mmcfile ${mmcscriptfile};" \ "run fileload\0" \ "scriptboot=echo Running ${mmcscriptfile} from mmc " \