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 5D588C433EF for ; Mon, 10 Jan 2022 08:05:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ED99481A03; Mon, 10 Jan 2022 09:05:06 +0100 (CET) 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="htR/rFGs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3479881B86; Mon, 10 Jan 2022 09:05:05 +0100 (CET) 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 7847F81879 for ; Mon, 10 Jan 2022 09:04:57 +0100 (CET) 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; 10 Jan 2022 17:04:51 +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 cc3c414261dbe8a3; Mon, 10 Jan 2022 17:04:51 +0900 DKIM-Signature: a=rsa-sha256; b=htR/rFGsx/BAvI39i6sMPaR7ZtfKW1FgkZfZIxR3+WU7F6NDmFziSm7eBpzYX9vd55WX+HbZEP 5tR3nzDA5eyRZbwTadLg5BZsk+jpxX5zkbC4Xi401GY+XsVYXD8fZJzz45Hjs7pYz8ScAHHMAzV4 2UPB58UmDNJfhd6Lq5NvkXMf0ra/IqyA3UTPTk8U6CfVJSbu4+yGR/MS/00CiF29uJHOUqtqmyj4 qB1beICCXSFXqscVc54uD9hmsa7PA+20bI1M0KfuwGrmAn9wfqbSsx8ZRFsoeuaZq2UYCzdD2kUu jpy9ZcW4goBetmwpkEtFuMzblL2kxKBZMkKWa+3A==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=mfeLXEy3ZreIO5Ir1V/yi9UdCaXbuIt1DKWD0250ezI=; 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 eee9339e61dbe8a3; Mon, 10 Jan 2022 17:04:51 +0900 From: "Chan Kim" To: "U-Boot Mailing List" Subject: In arm64 case, how is fdt address passed to x0 before switching to linux? Date: Mon, 10 Jan 2022 17:04:49 +0900 Message-ID: <02aa01d805f8$bd743ed0$385cbc70$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdgF9eIQNjKuWBIjR0eiW6C+jJ6MAA== 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.2 at phobos.denx.de X-Virus-Status: Clean Hello experts, I'm doing debug for arm64 linux booting using u-boot-spl. Because I can use only 8MB on-chip ram in place of DDR located at 0x80000000 for now, I modified the spl code so that kernel image is placed at 0x80080000 and fdt is located at 0x80700000. (memcopy-ied from FIT image loaded at 0x80100000). I'm sure the cpu has switched to linux but don't see kernel messages. Because I can't use debugger for actual board now, I'm using qemu to find what's wrong using the emulation. So far the behavior is the same with the FPGA board. Now, the x0 register is supposed to point to fdt when linux is entered, but I found the x0 value was not set before switching to linux. I think this malfunction came from the modifications I made to the source made for our special situation. I searched common/spl/spl.c and arch/arm/lib/spl.c but couldn't find where x0 register is set. (the spl_image->fdt_address has been already set to 0x80700000 already). << common/spl/spl.c >> #ifdef CONFIG_SPL_OS_BOOT // set to yes case IH_OS_LINUX: debug("Jumping to Linux\n"); #if defined(CONFIG_SYS_SPL_ARGS_ADDR) // not set spl_fixup_fdt((void *)CONFIG_SYS_SPL_ARGS_ADDR); #endif spl_board_prepare_for_linux(); jump_to_image_linux(&spl_image); #endif << arch/arm/lib/spl.c >> #ifdef CONFIG_SPL_OS_BOOT // set to yes #ifdef CONFIG_ARM64 // set to yes void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) { debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg); cleanup_before_linux(); armv8_switch_to_el2((u64)spl_image->arg, 0, 0, 0, spl_image->entry_point, ES_TO_AARCH64); } #else void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) { unsigned long machid = 0xffffffff; #ifdef CONFIG_MACH_TYPE machid = CONFIG_MACH_TYPE; #endif Where in the u-boot-spl code is the x0 register set with fdt address? Any comment/advice will be really appreciated. Thank you! Chan Kim