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 5F5C3C433FE for ; Fri, 4 Nov 2022 10:14:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A92B284F34; Fri, 4 Nov 2022 11:14:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="OTwqwEH0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9262E85190; Fri, 4 Nov 2022 11:14:19 +0100 (CET) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 439D884567 for ; Fri, 4 Nov 2022 11:14:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=lists.nick.betteridge@gmail.com Received: by mail-wr1-x431.google.com with SMTP id l14so6393373wrw.2 for ; Fri, 04 Nov 2022 03:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=XtTKeGTl3I1ZBuuICxCVKkJhdQsDj+kyRpQXmfSBEuI=; b=OTwqwEH0Wio5dyuBeIq2z69vBPSJk4D6E3e+knsMWsD2DH2zxcFGqJ7TsAOQSgc0dq 52sF3idObWi+9ejYTYQO+RfTbwciCC8FYelTQwQrppTxbcqIY9yabK5d+iccTgfnz/8A 6hLWMw1EMY0FlFRq59qChkDp56AHq4BYq6g7FA6uGoWZPkYXHdw1fGQOiPp/ncLpOEZf CHm7PuFu0CpHm87snf8XzmnuFIaWKDSlc8/1x7TWRD5g2ZvlvUU1Krxdq0ldXEvTi7J8 3y8uDtharNXaR4Wz0MvSMSTCOUZ7U9OJ2yQnGXwBC08QT0IklYZ4xePdyAqZQVKSxsbJ mGyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XtTKeGTl3I1ZBuuICxCVKkJhdQsDj+kyRpQXmfSBEuI=; b=EnTxRBDEUHo6Sw8aXETBoUrluU0rXD5xeOI06zCydkpMCOBxUd0zQ2YXFfZMJxM1JW vg7Vs3Eq7bRi+h5bU9EaVFhcYZevjKpvjvW5Npvf34EpBJnMz/TtzbQ/57ouZVYF1JkO 9LOhcNDUl/srhl+DNsn1tXHx4eRvfv4dfpKT0njPEqXwpW6GQ3cSCvM7a0/+4Q/xPn/9 D2CjdJi589e+d6ESp1HBbVfxsk0Vq+IT7UbyqcKLTpMmLddXyD/5y9Jn8NU/hegLp9B+ C7Ukm3JYBx6g1oMshgy6yjzockU7dpEHRa2kCehX10BgdqttwMG//crIOZ6b7r2NVaPO W4MA== X-Gm-Message-State: ACrzQf0J8rKQYKtc0q9Xf9ft6Wbrvr678ecbpS9AqUJ3REGb029WoQBB uoNm9gJONLr3vdANEkrkXmU= X-Google-Smtp-Source: AMsMyM4hSC2N2mT153hMU721ZdmPsfG7pqXrL7xOtm7s/u8AZdPzC9Y5yUcwVbKT8++IYfe76Dhjjw== X-Received: by 2002:a5d:6d89:0:b0:236:7d7d:1e79 with SMTP id l9-20020a5d6d89000000b002367d7d1e79mr22729830wrs.673.1667556856653; Fri, 04 Nov 2022 03:14:16 -0700 (PDT) Received: from [10.0.0.12] (static-90-255-244-241.vodafonexdsl.co.uk. [90.255.244.241]) by smtp.gmail.com with ESMTPSA id f26-20020a5d58fa000000b002305cfb9f3dsm2940969wrd.89.2022.11.04.03.14.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Nov 2022 03:14:16 -0700 (PDT) Message-ID: <19d8c742-606c-8bfb-9873-4689da77cdcb@gmail.com> Date: Fri, 4 Nov 2022 10:14:15 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: Running u-boot standalone hello_world on an image partition with qemu Content-Language: en-US To: Tom Rini Cc: u-boot@lists.denx.de References: <7ca7738f-1a47-dd45-fcf7-d0bde0280a02@gmail.com> <20221103180930.GT2116612@bill-the-cat> From: Lists Nick Betteridge In-Reply-To: <20221103180930.GT2116612@bill-the-cat> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 Hi Tom, Thanks for getting back to me >> I'm developing on an ubuntu x86 machine, trying to run the u-boot >> hello_world standalone application which resides on an image |sd.img| which >> contains a partition >> >> I've compiled u-boot (|v2022.10|) with |qemu-x86_64_defconfig| >> >> I run qemu with "|qemu-system-x86_64 -m 1024 -nographic -bios u-boot.rom >> -drive format=raw,file=sd.img"| >> >> u-boot starts up, doesn't find a script, doesn't detect tftp, and awaits a >> command. If I type |"ext4ls ide 0:1|", I can clearly see hello_world.bin >> (|3932704 hello_world.bin|). >> >> When I do a |ext4load ide 0:1 0x40000 hello_world.bin| (in preparation for >> |go 40000 This is another test|), qemu/u-boot restarts. >> >> 0x40000 is the |CONFIG_STANDALONE_LOAD_ADDR| for x86. >> >> I have also tried making an image of hello_world |"mkimage -n "Hello stand >> alone" -A x86_64 -O u-boot -T standalone -C none -a 0x40000 -d >> hello_world.bin -v hello_world.img|" and tried to load the image into >> 0x40000 with the intention of using |bootm| in case of cache issues - >> qemu/u-boot still resets. >> >> Could anyone possibly point out the basic mistake I'm making? > Using the standalone API on platforms where we support UEFI applications > is strongly discouraged. If some part of the UEFI support in U-Boot is > lacking for your use case we strongly encourage patches adding support > for that (as we're doing right now for enhancing SPI support). > All I'm trying to do at the moment is develop a standalone program usingqemu (with -kvm) on my x86 ubuntu machineĀ  and then target a platform (riscv or arm) at a later date. The instructions in Readme.standalone, loading at a load address of 0x40000, cause a restart of the boot process - mind you saying that, loading to a higher address (say 0x1000000) works but I'm unable to perform a 'go' as the non-relocatable standalone needs to be at 0x40000 (CONFIG_STANDALONE_LOAD_ADDR) If you can suggest a way forward for developing a u-boot standalone on an x86 machine, I would be hugely grateful! Thanks again Nick