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 80A05C77B7F for ; Mon, 8 May 2023 09:40:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0546B857DF; Mon, 8 May 2023 11:40:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=etri.re.kr 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" (2048-bit key; unprotected) header.d=dooray.com header.i=@dooray.com header.b="Gj5obie6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7764585B19; Mon, 8 May 2023 11:40:49 +0200 (CEST) Received: from mscreen.etri.re.kr (mscreen.etri.re.kr [129.254.9.16]) (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 CB2EC856B2 for ; Mon, 8 May 2023 11:40:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=etri.re.kr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ckim@etri.re.kr Received: from unknown (HELO send001-relay.gov-dooray.com) (211.180.235.152) by 129.254.9.16 with ESMTP; 8 May 2023 18:40:33 +0900 X-Original-SENDERIP: 211.180.235.152 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: u-boot@lists.denx.de Received: from [10.162.225.112] (HELO smtp002-imp.gov-dooray.com) ([10.162.225.112]) by send001-relay.gov-dooray.com with SMTP id cab6db0f6458c391; Mon, 08 May 2023 18:40:33 +0900 DKIM-Signature: a=rsa-sha256; b=Gj5obie6LvkO3d3BFQHFM0oJakfLWO7qucPGSvL4SudeCf5Lecbi+EPy6n78OG4EU+BipRTYw6 AHdZIIkaCdcj9FdBCj/sU2yroGk8bKmHHwYb/Vkm43u6BtaA1d02Y+IMLEXsU3+zanaTzjRAcLYT E/iwKhyoERL4ABk3+Ygq64VP2omUByF3sswDK1aHToAEDCBQNiyPX79Q3/eY51HuZ/WubKVYTMSK i9Xfip/EV3/nzwipBj4hupF/ZDtTgH7gucvEwdyTFqj5TSnXVJ/deEzJbzfxNLCi8tkEWRQ3uqv3 CAmSpg7T0qMe8khxy1zvbH0H7BH9xsFpsNHWu52w==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=jBraSeXteBvyuKAbCNv2BeQFRdNobKXdHfNXgNTPwBA=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp002-imp.gov-dooray.com with SMTP id 721e50286458c390; Mon, 08 May 2023 18:40:33 +0900 From: "Chan Kim" To: "U-Boot Mailing List" , Subject: How should I build u-boot for qemu_arm64_defconfig and run it on arm64 qemu virt machine? Date: Mon, 8 May 2023 18:40:31 +0900 Message-ID: <004301d98191$21ace400$6506ac00$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdmBkR8heOJq1RZWRju5a9tPcl/Xiw== Content-Language: ko Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Hello experts, Today I tried this test from scratch. In my environment, CROSS_COMPILE=aarch64-none-elf. Under u-boot directory, when I do 'make CROSS_COMPILE=aarch64-none-elf- qemu_arm64_defconfig' and 'make -j28', I see this error at the end. aarch64-none-elf-ld.bfd: invalid length for memory region .sram after examining it, I added in include/configs/qemu-arm.h, #define CONFIG_SPL_MAX_SIZE value to 0x400000 After fixing it, I got another similar error for .sdram and I added in include/configs/qemu-arm.h, #define CONFIG_SPL_BSS_START_ADDR 0x40800000 #define CONFIG_SPL_BSS_MAX_SIZE 0x100000 Now I can do 'make -j28' with no error. But I found I have both 'u-boot' and 'spl/u-boot-spl' generated and I realized for this qemu_arm64_defconfig, CONFIG_SPL=y and I get both u-boot proper and u-boot spl. (SPL: secondary program loader, proper: main bootloader. SPL runs first and the proper runs next). Until now I did objcopy of the u-boot(proper) and then extended it to 0x400000 byte. (the pflash size of the virt machine which starts at address 0x00000000). $ aarch64-none-elf-objcopy -O binary u-boot.v2022.07/u-boot pflashp.img $ dd if=/dev/zero of=pflashp.img bs=1c count=1 seek=67108863 And the qemu command is : $ qemu-6.2.0/build/aarch64-softmmu/qemu-system-aarch64 -machine virt,gic-version=max,secure=on,virtualization=true -cpu max -drive if=pflash,file=pflashp.img -m 2G -nographic -device loader,file=linux-5.15.68/arch/arm64/boot/Image,addr=0x80200000 The qemu virt machine has RAM from 0x40000000 until 0xbfffffff. And I could see u-boot runs and it waits input for 3 seconds and outputs the u-boot prompt. This is running u-boot (proper) from address 0 but since I have u-boot-spl too, I should run it from u-boot-spl first, shouldn't I? How am I supposed to run u-boot-spl and u-boot on this qemu machine? (from lds files, it looks like they both start at address 0). (qemu machine is arm64 virt machine, qemu 6.2.0). Thank you. Chan Kim