From patchwork Wed Jun 15 13:21:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1643760 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=Wj1Rr7GS; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LNQy96Xvyz9tlf for ; Wed, 15 Jun 2022 23:24:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C811784511; Wed, 15 Jun 2022 15:22:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu 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=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="Wj1Rr7GS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 10607844D2; Wed, 15 Jun 2022 15:21:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 997D3844F1 for ; Wed, 15 Jun 2022 15:21:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x52f.google.com with SMTP id n28so16121190edb.9 for ; Wed, 15 Jun 2022 06:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7zCI3sCpSLnJ9gOiW082rzU3Y25b9X3S6KBcQL0wylo=; b=Wj1Rr7GSrfIGGSKnEY5g03bZcLbvYlKC9rxV8paoiQk7MJdyttX9RkSJa3rGZb+P6w ioM1yxPbXFesQoevRA65NIhaSrAPb3rYWJz3HlXox1WpkVL8afTnOo320mnKhEYji0IR 4hBQh+099QpgpKlLyU2Wof7t+1nwoA4P6XZcbALbhDnSr0C9vjoS4Dj7sb07JEa7r5kZ heZ+IVgQJNcvo2hKP0eSH6+nJ6I6lDZ92j0YMm5AtdeiaV56cR0PR5rLxgw8A5aPBF5p BW+GZ+98ZzstnzWOgSIfYWuC371P+/kpRxwueIHEuTzA2m6JcbOSr0QYKp76qjKXtP1R ZsUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7zCI3sCpSLnJ9gOiW082rzU3Y25b9X3S6KBcQL0wylo=; b=Kp8VZNWBbXEPC4/jGJ4RDqYKz8hAbj7U/gulxDwa5QE7rhSZ8R58om+iLRskCFC1Vg RDPXmIhvDe0g8O2FgxzFtbW3HQkA2MNDnTJsMtgGiwfRd/XtznAvxSHQJxbE/+FRevex PbtaPPP3crTHVd5skJvMxj4gSYGQBQ949K/jwhwIgyrZ9PhHbEANOF1KZCWSJ0vgFsVn 2NhlHKGRt00qEt14dFQ1l6YTUQCrmQZwG1ec87dBfaMkcHUbVYS1Sxqvqgf7m18Asnay fpETZH+EDjVlLcw0Oh0q4k5M/mrGVygGMZmJxQeVRb5Q1F8Ztzp1qWOt6gs5X8utzt59 bG0Q== X-Gm-Message-State: AJIora/mASaCIPN8mCx7MJMR9DnOC+qUB1aVecwuAtr6nPpMUDbnKNrP Ki5iHHyNh42Nka6gYgh8Qp5GNTEB7YfOJw== X-Google-Smtp-Source: ABdhPJw/d4+qCpa9kzKLTOxCZUHY9pH2ifoYBjIzmSvlA4v4+zqZeF0SSe+yr1PDZJeUyVblkRGbfA== X-Received: by 2002:a05:6402:1e8b:b0:41c:59f6:2c26 with SMTP id f11-20020a0564021e8b00b0041c59f62c26mr12952077edf.156.1655299311682; Wed, 15 Jun 2022 06:21:51 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id en11-20020a056402528b00b004315f96fd24sm9205515edb.31.2022.06.15.06.21.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 06:21:51 -0700 (PDT) From: Michal Simek X-Google-Original-From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Michal Simek , Ovidiu Panait Subject: [PATCH v4 16/23] microblaze: Remove _start symbol handling at U-Boot start Date: Wed, 15 Jun 2022 15:21:12 +0200 Message-Id: <044b727c33dfbe662f68512d0da0775a4805f360.1655299267.git.michal.simek@amd.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean Right now U-Boot runs all the time from the same address where it is loaded but going to full relocation code starting address doesn't need to be fixed and can be simply discovered from reading PC register. That's why use r20 to get PC address and subtract offset from the beginning to get starting address. Signed-off-by: Michal Simek --- (no changes since v1) arch/microblaze/cpu/start.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S index c3d925c1d151..db3998f54505 100644 --- a/arch/microblaze/cpu/start.S +++ b/arch/microblaze/cpu/start.S @@ -14,15 +14,16 @@ .global _start _start: mts rmsr, r0 /* disable cache */ + mfs r20, rpc + addi r20, r20, -4 mts rslr, r0 - addi r8, r0, _start - mts rshr, r8 + mts rshr, r20 #if defined(CONFIG_SPL_BUILD) addi r1, r0, CONFIG_SPL_STACK_ADDR #else - add r1, r0, r8 + add r1, r0, r20 #endif addi r1, r1, -4 /* Decrement SP to top of memory */