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 680B0C4332F for ; Fri, 4 Nov 2022 10:26:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 09172851AE; Fri, 4 Nov 2022 11:26:26 +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="Ow1Szz/5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 21A37851B1; Fri, 4 Nov 2022 11:26:24 +0100 (CET) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 85670851A2 for ; Fri, 4 Nov 2022 11:26:21 +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-x435.google.com with SMTP id w14so6398694wru.8 for ; Fri, 04 Nov 2022 03:26:21 -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=ONXwJDYQ+9rAO2vdLMW0A9hx88/4E1FXf0iXQJR0MC0=; b=Ow1Szz/5xNd8OEHvCyDqnEMfc1s+6DXl8WaXmkj2hbmwvcDpM6kjjZZMdE5uvyRTyq t1rtA59SSN79y/g5d1iRm3owFOp/p0qfO14dLOLknZrmsDENqodK6xI8Kx5RQQYNDoER yxSMJtQ0lDtEN33H6AM7rZHbRon//bkCL8YkfLUPReWgU8R+hqxwuT/JeREItFxtsh8a QEIU/t2gr+l25GuC3zCylrf5ycT5E7eXxBR0hYdNRhZMg4/cR+OsIbhE2a39Ydf98xr3 VWxbfHGeEOhOoFj+fvGISfCJyw5QUJydLzBaqlAR9Iydi61a76is9P1UJ+r6gwbDAcMW 8Q/A== 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=ONXwJDYQ+9rAO2vdLMW0A9hx88/4E1FXf0iXQJR0MC0=; b=g849zjCiHO39xjmqS7ySCzJbJdp9QZAfX16m7fzHL0bguxm4WeSrRu+O8ZllgCXvsR /jksOmNqp+cRSz4D5qrORlfK+7e+6PMcvjyL7eLoU/GbbRCJQAOWr8+Mp70lT3B+uwSy edhrCDLgsX2S3cUfJJnTfxpyGsbI6FlKO60wvAZsNs6H0r0ZVlXTBOon2ueTX8PY4KkA MVEcVFXmQYK6W6RrT6R5G+6okYXJva3q/N1saUl690Iy2ChiBLDT+TSNGDhxGWH3PSJC nkrDDa24VlToT2seI1ZBnjgrjw/z+7Tonl/MT1r1EfUGbcH0t1QhyA6RLyMq8P1t/xZ4 XyBQ== X-Gm-Message-State: ACrzQf2CCm7iP+kHo6yfcrhhNu2ZJtqV13s4FHxq60EOBGY8/ODajYpF lRASJAyFf92nvNIFa6/LZO3OulPBtqk= X-Google-Smtp-Source: AMsMyM7HYejtoWnlM3a897cP1oRK+doNJrAgEAHf1dwnIV2jsFEwD/lxs/X3zclu4QzF73sDL5LEKg== X-Received: by 2002:a5d:5451:0:b0:236:69cc:5cd3 with SMTP id w17-20020a5d5451000000b0023669cc5cd3mr21740627wrv.23.1667557580889; Fri, 04 Nov 2022 03:26:20 -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 k8-20020a5d6288000000b00228cbac7a25sm3207779wru.64.2022.11.04.03.26.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Nov 2022 03:26:20 -0700 (PDT) Message-ID: <8c0fbb71-da7c-2137-c886-35d1838bd640@gmail.com> Date: Fri, 4 Nov 2022 10:26:19 +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: Simon Glass Cc: u-boot@lists.denx.de References: <7ca7738f-1a47-dd45-fcf7-d0bde0280a02@gmail.com> From: Lists Nick Betteridge In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Simon, 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? > > Is the app linked to start at that address. Could you try 'dcache off' > before the 'go'? Do you have a debugger? > The standalone Makefile sets up the start address at 0x40000 (CONFIG_STANDALONE_LOAD_ADDR), so I'm assuming that hello_world.bin is correctly linked to that address. I'm unable to even try 'dcache off' before 'go' as the 'ext4load' at CONFIG_STANDALONE_LOAD_ADDR causes a restart. As I mentioned to Tom Rini, all I'm trying to do at the moment is develop a standalone program using u-boot and qemu on my x86 ubuntu machine and then target a platform (riscv or arm) at a later date. Thanks again for your reply Nick