From patchwork Wed Jun 15 10:03:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1643580 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=CerHW0GJ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4LNLZG6FM9z9t6h for ; Wed, 15 Jun 2022 20:07:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 66A48844DF; Wed, 15 Jun 2022 12:04:48 +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="CerHW0GJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EA698844AD; Wed, 15 Jun 2022 12:04:36 +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-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (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 C40A8844B7 for ; Wed, 15 Jun 2022 12:04:33 +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-ej1-x62f.google.com with SMTP id o7so22187177eja.1 for ; Wed, 15 Jun 2022 03:04:33 -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=CerHW0GJvS/U7NX/OaQ43yel2eF+Ht8U6le4jm8aASyS8jvUTGKPREiO0l5xaYHkKi HCSAsXoIrvhVKqj8XbWE/IVYzO4Z7AfJhuQS7rZXuOPAsqeAK4DOd8MfjWk5ezEWLlRQ zfrhIelgVeJhf0YVolm3Y5oRhX5plW3vRtcp+nnxNb+CK73zKZEq1KOOMQ9uYkXHsagE 608F+/GQqQmOvIBLY5S7CJGs00FNHo6L+IlpLupxF9UEz3mdhCGH9o3S3sfn7y30kz2s fJaVccJnma6MZANcJ8xNcKfJe41+0xLzBucJAwrc0kaAwLc4OfwRxjVQ01Kpgz86AZCC JcQg== 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=K2x/0fUq6iLnj1ItjxTTFCIaHQA5uwl+nJfGjMo7H4sA2RMyikuIZ/LTfCVYEtjMLZ DBlzVLnCAMIWUqRis6Z4I3Hlwd+p71DXAEJTyCSEXltQjU45n18ay1/T2V5mDq0SXgou Zy/HWDmy5+G5J58t3LoZoqqlCfIe+LHVwWqcUFMf3sEKP2JIwQZqqXmUJ6lqgyzGGtIh s8dCIkN/IB1XhoVv0TY8QxsPCmW4/7p/JLjGWKcsA49Xz/mLTq+5klu4dquF/RQlKhe3 3+LfhQZyk/eBrmaGe34FpKFSokRQGqPgeQ4zqnE/gji1j1xVarjIabhka2orFb4nnlAi F2Xw== X-Gm-Message-State: AOAM5319w9KXszFKGLum6PNmVT2GhwPaZYosxoW7EmmEi9e/QZ8mlGjk qnoJWV/3oclEEMT8l6QD73WsksWxXH737Q== X-Google-Smtp-Source: ABdhPJy1l2TJGavqRmWHTOFqTTam3/WLrWH9A9UvyHk/Vcxn/CAUeroh9V3E4AHVdSiRKaZ8sHQ+Ig== X-Received: by 2002:a17:906:7a13:b0:712:fe7:8f1f with SMTP id d19-20020a1709067a1300b007120fe78f1fmr8331151ejo.98.1655287473248; Wed, 15 Jun 2022 03:04:33 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id n21-20020a5099d5000000b0042dccb44e88sm9109499edb.23.2022.06.15.03.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 03:04:32 -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 v3 16/23] microblaze: Remove _start symbol handling at U-Boot start Date: Wed, 15 Jun 2022 12:03:53 +0200 Message-Id: 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 */