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 5796AC433EF for ; Fri, 15 Oct 2021 15:02:21 +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 A0419600D4 for ; Fri, 15 Oct 2021 15:02:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A0419600D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=soeren-tempel.net 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 AD6E5836A5; Fri, 15 Oct 2021 17:02:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=soeren-tempel.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" (1024-bit key; unprotected) header.d=soeren-tempel.net header.i=@soeren-tempel.net header.b="Eomdxa9d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E7D448380F; Fri, 15 Oct 2021 14:54:10 +0200 (CEST) Received: from magnesium.8pit.net (magnesium.8pit.net [45.76.88.171]) by phobos.denx.de (Postfix) with ESMTP id 96D4481725 for ; Fri, 15 Oct 2021 14:54:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=soeren-tempel.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=soeren@soeren-tempel.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=9GkjZaR/mB 4NQndm6hQZq4MEkT4WnAaeaXZZQxNBOm0=; h=from:subject:to:date; d=soeren-tempel.net; b=Eomdxa9d+CRCmGKM4fnXPHppRJr71EVTXjn5S2eEHYGgL77 EgRHJKR1wxtgAcoJo9huiW7bNFLXYAMO4tmJG/HDe1wzE9ugCAbHFa+l/uEM5yejhi1z73 yQxmB8n7kgaoyPtEOFdg4rKekhHIsxHZkc6VyQIKaFHyzgwFNiQR50= Received: from localhost (p200300f5ff094b00791982c903998e5e.dip0.t-ipconnect.de [2003:f5:ff09:4b00:7919:82c9:399:8e5e]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 5ed4681b (TLSv1.3:AEAD-AES256-GCM-SHA384:256:YES) for ; Fri, 15 Oct 2021 14:54:07 +0200 (CEST) Date: Fri, 15 Oct 2021 14:54:06 +0200 To: u-boot@lists.denx.de Subject: HiFive Unmatched: U-Boot stuck when loading Ramdisk From: =?UTF-8?Q?S=C3=B6ren?= Tempel Message-Id: <3JGPTMTJW4N96.3Q6M32G65IN1H@8pit.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Fri, 15 Oct 2021 17:02:17 +0200 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 Hello, I hope this is the right way to report u-boot issues. I tried to reach out to the RISC-V subsystem maintainer beforehand but didn't receive a response, hence sending this to the ML. We are currently working on Alpine Linux support for the Hifive Unmatched and at least two of our developers have access to a board presently. While working on Alpine support, we noticed that U-Boot with sifive_unmatched_defconfig gets stuck while loading the Alpine initramfs. The last message received on the SiFive UART is: Loading Ramdisk to ffa72000, end fffffc19 ... Afterwards, U-Boot is stuck. We ran into this problem on two different boards independently. Both with u-boot-2021.10 as well as u-boot master (78e786decb6c8783568044c98891e64289cbf59c). I noticed that if I set initrd_high manually (i.e. change the address region the Ramdisk is loaded to) everything works as expected. For example, `setenv initrd_high 0x85000000`. Maybe the default address region used for the Ramdisk overlaps with the U-Boot stack/text region or something? I am not familiar with U-Boot internals, but briefly looking at the code and how the default Ramdisk address region is calculated, it seems to me that many boards set CONFIG_SYS_BOOTMAPSZ but the board configuration for the Unmatched and Unleashed doesn't. If I set it manually everything works as expected. For example: diff --git a/include/configs/sifive-unmatched.h b/include/configs/sifive-u= nmatched.h index d63a5f62fb..e1d3cb4ec4 100644 --- a/include/configs/sifive-unmatched.h +++ b/include/configs/sifive-unmatched.h @@ -25,6 +25,7 @@ #endif +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) #define CONFIG_SYS_SDRAM_BASE 0x80000000 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + S= Z_2M) This causes the Ramdisk to be loaded to 8f9f7000, end 8ffffb3d by default which, looking at the Unmatched memory map, seems to be a more sensible address region for the Ramdisk: Moving Image from 0x84000000 to 0x80200000, end=3D811a9000 ## Flattened Device Tree blob at 88000000 Booting using the fdt blob at 0x88000000 Loading Ramdisk to 8f9f7000, end 8ffffb3d ... OK Loading Device Tree to 000000008f9f1000, end 000000008f9f660b ... OK If there is a better place to report this issue let me know. If you need more information to reproduce/debug this issue I would be very happy to help. Greetings, S=C3=B6ren