Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BA09CC4332F for ; Sun, 20 Nov 2022 16:13:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 933F38534E; Sun, 20 Nov 2022 17:13:51 +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="ksW6QWZs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C432285467; Sun, 20 Nov 2022 17:13:50 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (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 3F62E85269 for ; Sun, 20 Nov 2022 17:13:48 +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 D753B60C7B; Sun, 20 Nov 2022 16:13:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4990C433D6; Sun, 20 Nov 2022 16:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668960826; bh=qfGj4xpLqqFIDDyF06TwnXZIoatOJoCiRN3dmMVhMPM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ksW6QWZs1oJMslbODzwR9MfpiCFrrCGeEdE05YwHgwVXE/JJJDd1zgNRVimRr2FqP e/0T2w9E/0WSrW8V2h3vrMYMBEgMRTSHr4DzGf3Dag1JlWYmx538/wamSrqTmCyf9m xySi4TH5W8sanRufs42DM5fveI03HLGCE2scQCMwO8D2v/9frG01q6CZ2fCkCsSWe5 BpatWvmoqPXUHJ5XN4A2mxpSryWiBsPXZK6HrrQ/tzMHhTcAv2ATUs0O8WmisYX7L4 rkCSMfQYUy/WwW/E53zM1+p7N93ynoGA9tXgwOHAnMYfdXahTsmImY8I7tBOSfobiB eFWrlmVj2y1OQ== Received: by pali.im (Postfix) id C503182F; Sun, 20 Nov 2022 17:13:42 +0100 (CET) Date: Sun, 20 Nov 2022 17:13:42 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Tom Rini Cc: u-boot@lists.denx.de, maemo-leste@lists.dyne.org, Sicelo , Merlijn Wajer , Ivaylo Dimitrov , Pavel Machek Subject: Re: [maemo-leste] Broken u-boot on n900 hw (possibly CONFIG_POSITION_INDEPENDENT) Message-ID: <20221120161342.shs7bnorp6myiw6g@pali> References: <20221009193317.5cwxcmntr6ziaphn@pali> <20221020200658.mby4a2rfxbw7j67v@pali> <20221021190955.mznki677gc4ogc7j@pali> <20221102000826.rmk45pdrbn5gwndz@pali> <20221109203328.xshcy76q53d5vxjn@pali> <20221119211301.pffzina66azietye@pali> <20221120153335.GF7282@bill-the-cat> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221120153335.GF7282@bill-the-cat> User-Agent: NeoMutt/20180716 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 On Sunday 20 November 2022 10:33:35 Tom Rini wrote: > On Sat, Nov 19, 2022 at 10:13:01PM +0100, Pali Rohár wrote: > > On Wednesday 09 November 2022 21:33:28 Pali Rohár wrote: > > > On Wednesday 02 November 2022 01:08:26 Pali Rohár wrote: > > > > On Friday 21 October 2022 21:09:55 Pali Rohár wrote: > > > > > On Thursday 20 October 2022 22:06:58 Pali Rohár wrote: > > > > > > On Monday 10 October 2022 23:30:21 Sicelo wrote: > > > > > > > On Sun, Oct 09, 2022 at 09:33:17PM +0200, Pali Rohár wrote: > > > > > > > > Hello! > > > > > > > > > > > > > > > > Current u-boot from master branch does not work on n900 hw. It does not > > > > > > > > show anything on display, there just nokia logo. > > > > > > > > > > > > > > > > In qemu it is working fine and all tests are passing. Also in qemu is > > > > > > > > display working without any problem. > > > > > > > > > > > > > > > > Could you help me to debug it? Maybe something is printed to serial > > > > > > > > console? Or maybe serial console could be used for printf-debugging? > > > > > > > > > > > > > > > > I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot > > > > > > > > option make it working again. But it requires to restoring older version > > > > > > > > of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT: > > > > > > > > > > > > > > > > git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S > > > > > > > > > > > > > > > > And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM). > > > > > > > > > > > > > > Hi > > > > > > > > > > > > > > I have a really crude serial console setup in place now, but very little > > > > > > > time, and even less experience with u-boot. I should be able to do the > > > > > > > tests for you on Saturday night (UTC+2). Perhaps over IRC might be a > > > > > > > good idea, in case I need some hand-holding, and if you still need the > > > > > > > help by then. > > > > > > > > > > > > > > Regards > > > > > > > Sicelo > > > > > > > > > > > > Well, I do not know where to start or how to instruct somebody who is > > > > > > not experienced with u-boot debugging. I think that the first step > > > > > > should be to look if U-Boot prints something on the serial console or > > > > > > not. If it prints then try to find via printf-driven-debugging place > > > > > > where it stuck. If it does not print anything on the console then try to > > > > > > setup debug early console, check if it prints something now and do same > > > > > > type of debugging. And if even early debug console does not work then > > > > > > probably initialize serial console directly in lowlevel_init.S file, > > > > > > prints something to serial, then move code for printing to later stage > > > > > > and try to figure out what is broken... > > > > > > > > > > Early debug uart console can be enabled by configs/nokia_rx51_defconfig options: > > > > > > > > > > CONFIG_DEBUG_UART=y > > > > > CONFIG_DEBUG_UART_OMAP=y > > > > > CONFIG_DEBUG_UART_SHIFT=2 > > > > > CONFIG_DEBUG_UART_BASE=0x49020000 > > > > > CONFIG_DEBUG_UART_CLOCK=48000000 > > > > > > > > > > And all debug verbose logs can be enabled by configs/nokia_rx51_defconfig options: > > > > > > > > > > CONFIG_DM_DEBUG=y > > > > > CONFIG_LOG=y > > > > > CONFIG_LOGLEVEL=9 > > > > > CONFIG_LOG_MAX_LEVEL=9 > > > > > CONFIG_LOG_DEFAULT_LEVEL=9 > > > > > > > > > > By compiling via 'make u-boot.bin KCPPFLAGS=-DLOG_DEBUG' > > > > > > > > Can somebody with serial console provide this debug output if there is > > > > something useful? > > > > > > Can somebody help me with this? > > > > Merlijn Wajer now sent me output from serial console: > > > > ... > > initcall: 0001ebd4 (relocated to 8fe0abd4) > > MMC: 0 > > - 0 'omap_hsmmc' > > - found > > 1 > > - 0 'omap_hsmmc' > > - 1 'omap_hsmmc' > > - found > > 2 > > - 0 'omap_hsmmc' > > - 1 'omap_hsmmc' > > - not found > > OMAP SD/MMC: 0, OMAP SD/MMC: 1 > > initcall: 0001ea8c (relocated to 8fe0aa8c) > > Loading Environment from ... Using default environment > > Destroy Hash Table: 8fe25a98 table = 00000000 > > Create Hash Table: N=387 > > > > After the "Create Hash Table: N=387" line there is nothing more. > > Repeated tests have same result, always stop at that line. > > > > In qemu after that line I see following output: > > > > INSERT: table 8fe25a98, filled 1/389 rv 8fd0e2f4 ==> name="bootcmd" value="run sdboot;run emmcboot;run attachboot;echo" > > INSERT: table 8fe25a98, filled 2/389 rv 8fd0e344 ==> name="bootdelay" value="30" > > INSERT: table 8fe25a98, filled 3/389 rv 8fd0f960 ==> name="baudrate" value="115200" > > DELETE CANDIDATE: "preboot" > > hdelete: DELETE key "preboot" > > DELETE ERROR ############################## > > INSERT: table 8fe25a98, filled 4/389 rv 8fd0e574 ==> name="loadaddr" value="0x80008000" > > ... > > > > In qemu is u-boot working fine. > > > > So it looks like that there is u-boot crash in environment code and only > > when running on real HW. > > > > Any idea? Could there be some relocation issue in u-boot env code? > > My first thought here is that something like 534f0fbd6520 ("arm64: Fix > relocation of env_addr if POSITION_INDEPENDENT=y") might be needed on > 32bit as well? > > -- > Tom Thank you Tom! This is really the issue. After I applied same fix for 32-bit ARM, U-Boot on real N900 HW booted. I will send a patch for it. Interesting is that same u-boot binary is working fine in qemu N900. And it works with and also without fix for env_addr.