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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E53EC433F5 for ; Fri, 5 Nov 2021 15:20:18 +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 85C8160F70 for ; Fri, 5 Nov 2021 15:20:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 85C8160F70 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3DEA4836C4; Fri, 5 Nov 2021 16:20:15 +0100 (CET) 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="Yc7/vxL5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7647B836AC; Fri, 5 Nov 2021 16:20:12 +0100 (CET) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (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 93B59836C4 for ; Fri, 5 Nov 2021 16:20:05 +0100 (CET) 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-qk1-x732.google.com with SMTP id bl12so8969937qkb.13 for ; Fri, 05 Nov 2021 08:20:05 -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; bh=aD4MU4qRpapxKQYPmzV236+7xbtLedgO1IU38oefE5A=; b=Yc7/vxL5Vwd4wgx27nGwKnMzs+umKg6mJi7MgTl+whER8Y7n8c6UZ/H0mXGEcRwvTi u+gD+huL/d9HCHnIk3ARmL1E3xzHv4ZvCoCZGogotewjTp66LXxaz0L74vmOvJY1XJkm hnJ6NJvOMTHIB14T7FQB1dFHMrxeokkENGLK0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aD4MU4qRpapxKQYPmzV236+7xbtLedgO1IU38oefE5A=; b=q2ASSWk1n0zVaxzAfHk4+nkcKWYgSVAlS7TvC0qdFFqGJJR9Hr4f5stsrgJsjlpps3 eaCJhA4tDDgyMW3wecysKgdODF69CY8pektUCTLr0awWGMYxxxPXlyRx8SjjjhwnIsTW BiNUG1N6Q9pyN+vKGthPyuzw2Xop9KxuLhLKJXXTxR28keoGMt4mEe0jEcz1wDuZ3fcX 6Yi5qf7rEOg/rejRrVTCCS3DPEePaAVQ7AsrIZgEG3Cv8PPBhHwqoqmklv13gSkCxG0R k3AcIWlWbfXWylr1bD9FemIvf4yFRpY0NkmccAE30QC2rNL5rN1g+Rwfk0caz39q/e0O U/Ww== X-Gm-Message-State: AOAM532GyOkFzdv12542c1Bxz3guk0g1G9FWC6Z8Jchpsg1LYf8TwGnX WJeU27yuTg2a+AJjlHmFZSVjuQ== X-Google-Smtp-Source: ABdhPJwgSRpwxvl0YW2NQdOBjMV2auwCoyEOlcYT5dyrD9OZKE3csHDEk8dESGYOtHePp2qR4pvJ3A== X-Received: by 2002:a37:4553:: with SMTP id s80mr48760908qka.489.1636125604097; Fri, 05 Nov 2021 08:20:04 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-c94a-a4cb-a5af-4946.res6.spectrum.com. [2603:6081:7b01:cbda:c94a:a4cb:a5af:4946]) by smtp.gmail.com with ESMTPSA id r5sm5686008qkp.131.2021.11.05.08.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 08:20:03 -0700 (PDT) Date: Fri, 5 Nov 2021 11:20:01 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Stefan Roese , Marek =?iso-8859-1?Q?Beh=FAn?= , u-boot@lists.denx.de Subject: Re: A38x: Broken Linux kernel booting over UART Message-ID: <20211105152001.GV24579@bill-the-cat> References: <20211011101329.olxahslagwlpnh5u@pali> <20211011140321.GY7964@bill-the-cat> <20211011142548.35wvxhrvhiafghar@pali> <20211011143222.GE7964@bill-the-cat> <20211011143344.vyngtyi2h4dp6dvi@pali> <20211011144544.GF7964@bill-the-cat> <20211011154905.wuqf3rzpwkouucwx@pali> <20211105113821.4cb2kbaqysouy7pl@pali> <20211105143510.GT24579@bill-the-cat> <20211105151646.fgu42idv2esf6rcv@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="b3HDrgTSPI5RNpIl" Content-Disposition: inline In-Reply-To: <20211105151646.fgu42idv2esf6rcv@pali> X-Clacks-Overhead: GNU Terry Pratchett 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 --b3HDrgTSPI5RNpIl Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 05, 2021 at 04:16:46PM +0100, Pali Roh=E1r wrote: > On Friday 05 November 2021 10:35:10 Tom Rini wrote: > > On Fri, Nov 05, 2021 at 12:38:21PM +0100, Pali Roh=E1r wrote: > > > On Monday 11 October 2021 17:49:05 Pali Roh=E1r wrote: > > > > On Monday 11 October 2021 10:45:44 Tom Rini wrote: > > > > > On Mon, Oct 11, 2021 at 04:33:44PM +0200, Pali Roh=E1r wrote: > > > > > > On Monday 11 October 2021 10:32:22 Tom Rini wrote: > > > > > > > On Mon, Oct 11, 2021 at 04:25:48PM +0200, Pali Roh=E1r wrote: > > > > > > > > On Monday 11 October 2021 10:03:21 Tom Rini wrote: > > > > > > > > > On Mon, Oct 11, 2021 at 12:13:29PM +0200, Pali Roh=E1r wr= ote: > > > > > > > > >=20 > > > > > > > > > > Hello! > > > > > > > > > >=20 > > > > > > > > > > Current U-Boot master has broken booting of Linux kerne= l over UART on > > > > > > > > > > A38x. > > > > > > > > > >=20 > > > > > > > > > > After transferring image over UART it just prints: > > > > > > > > > >=20 > > > > > > > > > > CACHE: Misaligned operation at range [01000000, 014e5d9= 6] > > > > > > > > > > ## Total Size =3D 0x004e5d96 =3D 5135766 Bytes > > > > > > > > > > ## Start Addr =3D 0x01000000 > > > > > > > > > > Kernel image @ 0x1000000 [ 0x000000 - 0x4e0e60 ] > > > > > > > > > > FDT and ATAGS support not compiled in > > > > > > > > > >=20 > > > > > > > > > > resetting ... > > > > > > > > > >=20 > > > > > > > > > > It resets board and does not boot kernel. Note that I'm= trying to boot > > > > > > > > > > recent 5.15 kernel image, not something old. > > > > > > > > > >=20 > > > > > > > > > > I did git bisect and it found following commit which br= oke booting: > > > > > > > > > >=20 > > > > > > > > > > 9774462e34faaa64a91eb9c68b438a52d22bba6a is the first b= ad commit > > > > > > > > > > commit 9774462e34faaa64a91eb9c68b438a52d22bba6a > > > > > > > > > > Author: Tom Rini > > > > > > > > > > Date: Mon Aug 30 09:16:30 2021 -0400 > > > > > > > > > >=20 > > > > > > > > > > arm: Disable ATAGs support > > > > > > > > > >=20 > > > > > > > > > > Prior this commit booting working fine. > > > > > > > > > >=20 > > > > > > > > > > Do you have any idea what is with above commit? Or any = hints? > > > > > > > > >=20 > > > > > > > > > Can you provide the full log of what you're doing? And w= hat's in that > > > > > > > > > image you're passing, exactly? Thanks. > > > > > > > >=20 > > > > > > > > Here is full log: > > > > > > > >=20 > > > > > > > > $ make CROSS_COMPILE=3Darm-linux-gnueabihf- turris_omnia_de= fconfig > > > > > > > > ... > > > > > > > > $ make CROSS_COMPILE=3Darm-linux-gnueabihf- -j8 > > > > > > > > ... > > > > > > > > $ ./tools/kwboot -b ./u-boot-spl.kwb -B 5200000 -t /dev/tty= USB0 > > > > > > > > Patching image boot signature to UART > > > > > > > > Injecting binary header code for changing baudrate to 52000= 00 Bd > > > > > > > > Injecting code for changing baudrate back > > > > > > > > Aligning image header to Xmodem block size > > > > > > > > Sending boot message. Please reboot the target...- > > > > > > > > Waiting 2s and flushing tty > > > > > > > > Sending boot image header (115072 bytes)... > > > > > > > > 0 % [....................................................= =2E.................] > > > > > > > > ... > > > > > > > > 93 % [....................................................= =2E...... ] > > > > > > > > Done > > > > > > > >=20 > > > > > > > > U-Boot SPL 2021.10-00600-gf331497d3ad4 (Oct 11 2021 - 16:13= :39 +0200) > > > > > > > > High speed PHY - Version: 2.0 > > > > > > > > MiniPCIe/mSATA card detection... MiniPCIe > > > > > > > > Detected Device ID 6820 > > > > > > > > board SerDes lanes topology details: > > > > > > > > | Lane # | Speed | Type | > > > > > > > > -------------------------------- > > > > > > > > | 0 | 5 | PCIe0 | > > > > > > > > | 1 | 5 | USB3 HOST0 | > > > > > > > > | 2 | 5 | PCIe1 | > > > > > > > > | 3 | 5 | USB3 HOST1 | > > > > > > > > | 4 | 5 | PCIe2 | > > > > > > > > | 5 | 0 | SGMII2 | > > > > > > > > -------------------------------- > > > > > > > > High speed PHY - Ended Successfully > > > > > > > > mv_ddr: 14.0.0=20 > > > > > > > > DDR3 Training Sequence - Switching XBAR Window to FastPath = Window > > > > > > > > mv_ddr: completed successfully > > > > > > > > Disabling MCU watchdog... disabled > > > > > > > > Trying to boot from BOOTROM > > > > > > > > Returning to BootROM (return address 0xffff05c4)... > > > > > > > >=20 > > > > > > > > Changing baudrate to 5200000 Bd > > > > > > > >=20 > > > > > > > > Sending boot image data (747780 bytes)... > > > > > > > > 0 % [....................................................= =2E.................] > > > > > > > > ... > > > > > > > > 99 % [................................. = ] > > > > > > > > Done > > > > > > > > Finishing transfer > > > > > > > >=20 > > > > > > > > Changing baudrate back to 115200 Bd > > > > > > > >=20 > > > > > > > > [Type Ctrl-\ + c to quit] > > > > > > > >=20 > > > > > > > >=20 > > > > > > > > U-Boot 2021.10-00600-gf331497d3ad4 (Oct 11 2021 - 16:13:39 = +0200) > > > > > > > >=20 > > > > > > > > SoC: MV88F6820-A0 at 1600 MHz > > > > > > > > DRAM: 2 GiB (800 MHz, 32-bit, 2T, ECC not enabled) > > > > > > > > WDT: Started watchdog@20300 with servicing (60s timeout) > > > > > > > > MMC: mv_sdh: 0 > > > > > > > > Loading Environment from SPIFlash... SF: Detected s25fl164k= with page size 256 Bytes, erase size 4 KiB, total 8 MiB > > > > > > > > OK > > > > > > > > Model: Turris Omnia > > > > > > > > Turris Omnia: > > > > > > > > RAM size: 2048 MiB > > > > > > > > Serial Number: 0000000B00007B3C > > > > > > > > Regdomain set to ** > > > > > > > > Net: eth0: ethernet@70000, eth1: ethernet@30000, eth2: et= hernet@34000 > > > > > > > > =3D> > > > > > > > >=20 > > > > > > > > $ kermit > > > > > > > > C-Kermit>set line /dev/ttyUSB0 > > > > > > > > C-Kermit>set speed 115200 > > > > > > > > C-Kermit>set carrier-watch off > > > > > > > > C-Kermit>connect > > > > > > > > Connecting to /dev/ttyUSB0, speed 115200 > > > > > > > > Escape character: Ctrl-\ (ASCII 28, FS): enabled > > > > > > > > Type the escape character followed by C to get back, > > > > > > > > or followed by ? to see other options. > > > > > > > > ---------------------------------------------------- > > > > > > > >=20 > > > > > > > > =3D> echo $uart_boot > > > > > > > > loadb $kernel_addr_r 5200000 && part uuid mmc 0:1 partuuid = && setenv bootargs earlyprintk rootwait console=3DttyS0,115200 rootfstype= =3Dbtrfs root=3DPARTUUID=3D${partuuid} rootflags=3Dcommit=3D5,subvol=3D@ rw= cfg80211.freg=3D${regdomain} && bootz ${kernel_addr_r} > > > > > > > > =3D> run uart_boot > > > > > > > > ## Switch baudrate to 5200000 bps and press ENTER ... > > > > > > > > C-Kermit>set speed 5200000 > > > > > > > > ?No keywords match - 5200000 (,Transmission rate for /dev/t= tyUSB0 (bits per second)) > > > > > > > >=20 > > > > > > > > ?SET SPEED fails, speed is 5260273 > > > > > > > > C-Kermit>send /tmp/kernel > > > > > > > > C-Kermit>set speed 115200 > > > > > > > > /dev/ttyUSB0, 115200 bps > > > > > > > > C-Kermit>connect > > > > > > > > CACHE: Misaligned operation at range [01000000, 014e5d96] > > > > > > > > ## Total Size =3D 0x004e5d96 =3D 5135766 Bytes > > > > > > > > ## Start Addr =3D 0x01000000 > > > > > > > > ## Switch baudrate to 115200 bps and press ESC ... > > > > > > > > Kernel image @ 0x1000000 [ 0x000000 - 0x4e0e60 ] > > > > > > > > FDT and ATAGS support not compiled in > > > > > > > >=20 > > > > > > > > resetting ... > > > > > > >=20 > > > > > > > OK, and is /tmp/kernel something with an appended dtb then? > > > > > >=20 > > > > > > Yes, single image suitable for single kermit UART transfer: > > > > > > cat arch/arm/boot/zImage arch/arm/boot/dts/armada-385-turris-om= nia.dtb > /tmp/kernel > > > > >=20 > > > > > Well, OK, there we go. That's what you need to figure out how to= fix > > > > > booting of. You're hitting the panic in arch/arm/lib/bootm.c and= need > > > > > to make sure that (a) we do whatever is needed for appended dtb t= o be > > > > > found by the kernel still/again and (b) check that ourselves, bef= ore > > > > > panic or not, in that case. Before this was probably enabling AT= AGs, > > > > > but that wasn't (I think? I forget the magic behind appended dtb = as it's > > > > > been a while) actually used by Linux, just by U-Boot to not panic= at > > > > > that point. > > > >=20 > > > > Ok, thanks for hints. So seems that som unrelated code path via ata= gs > > > > was used even for DTS booting. I also do not remember details. I wi= ll > > > > try to debug it... > > >=20 > > > Hello Tom! > > >=20 > > > I would like to know, what is required to enable same boot atags > > > behavior like before applying that commit 9774462e34fa ("arm: Disable > > > ATAGs support")? > > >=20 > > > I have enabled following U-Boot option (as it seems to be enough): > > >=20 > > > CONFIG_SUPPORT_PASSING_ATAGS=3Dy > > >=20 > > > And also I have compiled kernel with following debug options: > > >=20 > > > CONFIG_DEBUG_LL=3Dy > > > CONFIG_DEBUG_MVEBU_UART0_ALTERNATE=3Dy > > > CONFIG_DEBUG_UNCOMPRESS=3Dy > > >=20 > > > (to see early kernel output on mvebu UART console). > > >=20 > > > But I see only these lines on UART: > > >=20 > > > Starting kernel ... > > >=20 > > > DTB:0x014E0798 (0x00004F96) > > > C:0x010000E0-0x014E5740->0x010AF400-0x01594A60 > > > DTB:0x0158FAB8 (0x00004F96) > > > Uncompressing Linux... done, booting the kernel. > > >=20 > > > And no more output. After some time watchdog reboots board. > > >=20 > > > Which means that something more in U-Boot is needed to enable atags > > > booting (with possible appended DTB). Or that mentioned commit really > > > broke booting. Any idea? > >=20 > > Looking at the U-Boot commit again, you had previously also been doing > > CMDLINE, INITRD and MEMORY ATAGs. Since I see this in the kernel: > > /* > > * Look for an appended DTB. If found, we cannot use i= t to > > * validate the calculated start of physical memory, as= its > > * memory nodes may need to be augmented by ATAGS store= d at > > * an offset from the same start of physical memory. > > */ > > we might well need to still pass at least the memory tag? No one has > > tried (I suspect) a completely empty ATAGs + appended DTB until more or > > less now. >=20 > Now I found it! Issue is with CMDLINE. Without CONFIG_CMDLINE_TAG kernel > does not see any cmdline passed by bootloader, it fallbacks to default > cmdline (which was empty for my zImage) and therefore has not printed > anything on UART (because console=3D... was not there). Missing rootfs > then caused freeze, timeout and board reset. So it looked like U-Boot > was not able to boot kernel at all, even everything worked fine. I > realized it with CONFIG_CMDLINE=3D"earlyprintk console=3DttyS0,115200" > kernel config option. >=20 > Compiling U-Boot with CONFIG_CMDLINE_TAG=3Dy fixed this issue as U-Boot > started passing cmdline to kernel again. >=20 >=20 > So now I have a question: Do we want to support booting zImage with > appended DTB in U-Boot when ATAGs support is now disabled by default? Based on your experience, yes, there are use cases for appended dtb booting still. So it should be at least documented what you need to do where in order for that to work, and perhaps some platforms will want to enable it by default. --=20 Tom --b3HDrgTSPI5RNpIl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmGFS6EACgkQFHw5/5Y0 tyz1BAv/ccp5BG4WxvU2LUgJ6pmT9PF/Jj8NVoi8m178lL4MH+BJUKAs5ctdIB0a N0bZjnSfmmlSdAnxkXjGR8d6IeR80BBqD+PZpFnF6kM6TN8v316JvOVOMY1V2tMZ jSczx452srquHswLLOeSFU9J33012GKOBkOqyJ6KykL5+EFS78XbHPjgS4uLRzEZ sKJ6WH9ojoHuRQDrIcrqlljjtWvwYqEwY+pdqYdI4bFSPBTUUpp28Lt20QjA/YjF KMnZoApTMdQp6Fzm2W6hWXSXW2iZ0OQMVrL9N3r1ueBC0OyFvDmO7ZHafRVhw9Pq 8QZfPuSzFDu8GqyuhRGzhcWO+bf/eq50ucO8N8hKYWHXxvcsvue2EO5oZsA8Ntvd JZCyh2igAGf/eKZjzUnxUPNVv7rSnV8QTgSZaF+SwEn9gMFhsUqJTqUyZ2WiXwI6 TGqD6v573w8wIVeq3vz4O8M28V1huxLTarULEVoIez9KBkOItSvQydEFjAbel+iS 9UoWqtSI =XMFH -----END PGP SIGNATURE----- --b3HDrgTSPI5RNpIl--