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 64FACC4332F for ; Sun, 25 Dec 2022 10:42:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 31702852B5; Sun, 25 Dec 2022 11:42:09 +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="TbZgggtc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 24B2D852CB; Sun, 25 Dec 2022 11:42:08 +0100 (CET) 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 0EE27852B0 for ; Sun, 25 Dec 2022 11:42:06 +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 89C0AB802C6 for ; Sun, 25 Dec 2022 10:42:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09746C433EF for ; Sun, 25 Dec 2022 10:42:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671964924; bh=gEoAjuWgJhqnl6jLgQpOxtJWNpTWyl2r74fgjvn+Kf8=; h=Date:From:To:Subject:References:In-Reply-To:From; b=TbZgggtcZYv6cbgR1SLbsiYUOT8MFd+QSBN5JYZrt112QFJkgj1t7U5OVK56KZtTq VVOlaOXYA6XmQlmy8ytVMC5p5n5eEB4FSvRb3TOlcirOWY2NnDHknnw67Bz0tSmGUF OC/CtyXbEJVo4AuKwfPRYXhfWsjTzl7RTAV1xRJEUYghkDlIdLzVDXekk/DKpSb3IA tw3P7B1dhJ6bHZ17SsdD986DVP8fxLWmytb7uWNdpJt1tOdh58yuCUlC8N4LSuFc8c W6Ih2EdwUt5Io8qpQvXJtoarYjYrQVwsI2bBEdrKkPKD4FrorXYBlPfyXhbNGEaLDc ayMQVdOKcILag== Received: by pali.im (Postfix) id EB2B37B1; Sun, 25 Dec 2022 11:42:00 +0100 (CET) Date: Sun, 25 Dec 2022 11:42:00 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: u-boot@lists.denx.de Subject: Freescale P2020 Internal Boot ROM Message-ID: <20221225104200.2npmj2j6fxcu63um@pali> References: <20221216215639.vj4kffhcresvamqp@pali> <20221222025415.GH3787616@bill-the-cat> <20221222074947.iqulzr3s77j5jbva@pali> <20221222142927.GK3787616@bill-the-cat> <20221222171306.2nzlippi6zcyhpiz@pali> <20221222173332.GM3787616@bill-the-cat> <20221222175640.kqtofoxaupfchfby@pali> <20221222182250.GO3787616@bill-the-cat> <20221222210242.opzl5qmregv6atyx@pali> <20221223003658.GP3787616@bill-the-cat> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221223003658.GP3787616@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 Thursday 22 December 2022 19:36:58 Tom Rini wrote: > On Thu, Dec 22, 2022 at 10:02:42PM +0100, Pali Rohár wrote: > > On Thursday 22 December 2022 13:22:50 Tom Rini wrote: > > > I suspect that how we fire up QEMU means that the issue you're > > > noting isn't triggered since we don't boot it from flash but instead > > > pass the binary. > > > > Yes, this sounds like that problematic part is not tested. To spot this > > issue some end-to-end test is needed... For flash setup - booting > > directly from the qemu flash (execute in place) without initialized RAM > > and letting u-boot to do it. For SD card setup - booting via BootROM > > (like it is on the real HW). Seems that SD card BootROM is not available > > on internet and no idea if it can be dumped from some Freescale CPU (it > > is even legal to do it?). So some alternative bootrom implementation for > > such testing is needed... which is lot of work. > > We do some things like this already, for other QEMU platforms (the > flash_impl variable is set to the shell script to create a flash image) > but, it's unlikely to be worth expending the effort here, the ROM QEMU > uses here isn't the Freescale one, but from openhackware. If somebody is interesting, Freescale P2020 Internal boot ROM for SDHC (maybe it is common with SPI) is at offset 0xFE000 in CCSR block. Hence it can be dumped from (32-bit) U-Boot by command: => md.b 0xffefe000 0x2000 At first 0x1000 bytes there is nothing and code starts at second part. During boot phase, it is mapped to the end of the (4GB) memory space and entry point is the last instruction. So boot rom is just 4kB long. In case somebody wants this dump, just send me an email.