From mboxrd@z Thu Jan 1 00:00:00 1970 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 8D85BC19F2A for ; Thu, 11 Aug 2022 20:28:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 493BD84A6D; Thu, 11 Aug 2022 22:27:57 +0200 (CEST) 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="faT5f//d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 84D2184A65; Thu, 11 Aug 2022 22:27:51 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (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 9D1FE84A6C for ; Thu, 11 Aug 2022 22:27:47 +0200 (CEST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 51355612EA for ; Thu, 11 Aug 2022 20:27:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92111C433C1 for ; Thu, 11 Aug 2022 20:27:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660249665; bh=DnryPHEnSOquBwqMUontn7a2DjM1CfHmjd2YoML09Rs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=faT5f//dOHW7NX7fGtMyfLUzZz6MJJEEAq7pY50eqDmlLHID8qO/4gaeJWKwVmJRr oe+MFsG/jvWy0xn+wKdr2MVs7rHxSf1fp6UqHCyRzgwOoG7TapUSBZTicf4u0Em0na GOAMl/+j6qJSvLmL05OGnFoCYbS7VoGUR0i6vRGRzcYlmAOqqc19oDGjFPabb8hk/Y JSr/h1K8kE60y9QhRe9+7tJfgRAMReFg9zppbmkZ1SAgPysC3XDkaqg6X6TIIZ0C6m HTslq4qfKvwqlIOLtZuMu0XrQ/nsULLJMOJHYRmx2SpsU+R+CBcwWVFL7Y//iRgoEE gX+B+gJwJHDSQ== Received: by pali.im (Postfix) id 06B832777; Thu, 11 Aug 2022 22:27:43 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de Subject: [PATCH 4/5] Nokia RX-51: Simplify calculation of attached kernel image address Date: Thu, 11 Aug 2022 22:27:24 +0200 Message-Id: <20220811202725.24752-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220811202725.24752-1-pali@kernel.org> References: <20220811202725.24752-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Now when board starup code does not copy image to CONFIG_SYS_TEXT_BASE address there is no need to calculate all addresses from base address at runtime. The only address which needs to be calculated is attached kernel image address which can be simplified at compile time without need to know CONFIG_SYS_TEXT_BASE address or relocation address at the runtime. Signed-off-by: Pali Rohár --- board/nokia/rx51/lowlevel_init.S | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/board/nokia/rx51/lowlevel_init.S b/board/nokia/rx51/lowlevel_init.S index 4f76e80b20f1..c1785bc3f72f 100644 --- a/board/nokia/rx51/lowlevel_init.S +++ b/board/nokia/rx51/lowlevel_init.S @@ -6,11 +6,8 @@ #include -relocaddr: /* address of this relocaddr section after coping */ - .word . /* address of section (calculated at compile time) */ - -startaddr: /* address of u-boot after copying */ - .word CONFIG_SYS_TEXT_BASE +kernoffs: /* offset of kernel image from this address */ + .word KERNEL_OFFSET - (. - CONFIG_SYS_TEXT_BASE) kernaddr: /* address of kernel after copying */ .word KERNEL_ADDRESS @@ -18,9 +15,6 @@ kernaddr: /* address of kernel after copying */ kernsize: /* maximal size of kernel image */ .word KERNEL_MAXSIZE -kernoffs: /* offset of kernel image in loaded u-boot */ - .word KERNEL_OFFSET - imagesize: /* maximal size of image */ .word IMAGE_MAXSIZE @@ -53,16 +47,9 @@ save_boot_params: */ copy_kernel_start: - adr r0, relocaddr /* r0 - address of section relocaddr */ - ldr r1, relocaddr /* r1 - address of relocaddr after relocation */ - - /* r4 - calculated offset */ - sub r4, r0, r1 - /* r0 - start of kernel before */ - ldr r0, startaddr - add r0, r0, r4 - ldr r1, kernoffs + adr r0, kernoffs /* r0 - current address of kernoffs section */ + ldr r1, kernoffs /* r1 - offset of kernel image from kernoffs section */ add r0, r0, r1 /* r3 - start of kernel after */ -- 2.20.1