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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96FA7C433EF for ; Sun, 10 Oct 2021 21:45:03 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 53C1960EB4 for ; Sun, 10 Oct 2021 21:45:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 53C1960EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 41504832C3; Sun, 10 Oct 2021 23:44:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz [89.176.112.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id EA06F831CD; Sun, 10 Oct 2021 23:44:17 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Simon Glass , Tom Rini Subject: [PATCH] board_f: Copy GD to new GD even if relocation disabled Date: Sun, 10 Oct 2021 23:44:10 +0200 Message-Id: <20211010214410.870766-1-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sun, 10 Oct 2021 23:44:58 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 Even if U-Boot has relocation disabled via GD_FLG_SKIP_RELOC , the relocated stage of U-Boot still picks GD from new_gd location. The U-Boot itself is not relocated, but GD might be, so copy the GD to new GD location even if relocation is disabled. Signed-off-by: Marek Vasut Cc: Simon Glass Cc: Tom Rini --- common/board_f.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/board_f.c b/common/board_f.c index 3dc0eaa59c..2161a7411d 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -674,6 +674,7 @@ static int reloc_bloblist(void) static int setup_reloc(void) { if (gd->flags & GD_FLG_SKIP_RELOC) { + memcpy(gd->new_gd, (char *)gd, sizeof(gd_t)); debug("Skipping relocation due to flag\n"); return 0; } -- 2.33.0