From patchwork Wed Jul 22 15:48:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 498649 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 418431402AE for ; Thu, 23 Jul 2015 01:52:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=gHKywRnY; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7E9B94B833; Wed, 22 Jul 2015 17:51:43 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lLNFV4PaYR8T; Wed, 22 Jul 2015 17:51:43 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 93A024B7BD; Wed, 22 Jul 2015 17:51:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4FECF4B7AE for ; Wed, 22 Jul 2015 17:50:52 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EXn0MgG_GQm9 for ; Wed, 22 Jul 2015 17:50:52 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ig0-f174.google.com (mail-ig0-f174.google.com [209.85.213.174]) by theia.denx.de (Postfix) with ESMTPS id A52474B6BE for ; Wed, 22 Jul 2015 17:50:47 +0200 (CEST) Received: by igbpg9 with SMTP id pg9so136559658igb.0 for ; Wed, 22 Jul 2015 08:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lxg3v8BQm730HlR8sFngj4hDz6AkMgnEmP+qIV96KOo=; b=gHKywRnYScidS3ugROHsr4NE9zF7UKvB4V5HDsJdbAh2me87s4i7asxrUwiJmeEeHe buHgRmJY7KdmfnqtDziGu0VvZzcAdEE3GH8KrykOCtEvKsH5Yq+tQk5+7xQ+lvzYZ1JA XPYaPf8PE35EttRewYkmbgf/eQo2f4L8F8FGFW3kRHH8RgFXTsL78tVRtxhfayfbjwAo ZIYL/bX0KsXD82BBL4jxKkLlOKw7IlUvO9/H3Vsozg92QBRgfo5I28IJI3nKtmzx+Cp4 vBGniJIDEe+I/VHIVuWwK/3FMbU97rOOZBVFEFNy9N8BSy/JZ30FG6/Y0wt0cd1wfW0a KdTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=lxg3v8BQm730HlR8sFngj4hDz6AkMgnEmP+qIV96KOo=; b=JJ90AkwCSynxiuzbPKBoT8hywwgGIUXqGiKw0Vjz9tkDfRblMJPVm9Eun7dNRjRKmW yiYH0961gi2jwJpPy7XY91thlD2dU00TwZMV57KKh+mO+TSeZtK2reZ7HErl5vF1Glhd 9hu2bPVWt7JBKP8Ja5JRCe0vBpDfYb1RGfahShuKH1Efn5I6wRbP91Z0Gv/bLjLjECtH rw17f0xmOZIhsp7iiL4edHXj9g0vZG62YKOxrVioPbIGTGTBnPosxC2x/UvZhaM5z/IX VT4eQiHBJi/+dTCvlaw2LSm1NY4ESHWIrfan5A8jxX7h5YXOzyVevWDEbgpAyuqI1aM2 OGfA== X-Gm-Message-State: ALoCoQlvqildF5w9Q/B4RzM7hXKSKvKH+MZDJRdmviz954jxfs53XsXLmIsOed95eCJrR64CgbIk X-Received: by 10.50.13.10 with SMTP id d10mr35921388igc.20.1437580245938; Wed, 22 Jul 2015 08:50:45 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id g3sm1545987igi.10.2015.07.22.08.50.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 08:50:43 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 06677220EF6; Wed, 22 Jul 2015 09:50:41 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 22 Jul 2015 09:48:57 -0600 Message-Id: <1437580180-6405-6-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.4.3.573.g4eafbef In-Reply-To: <1437580180-6405-1-git-send-email-sjg@chromium.org> References: <1437580180-6405-1-git-send-email-sjg@chromium.org> Cc: Tom Rini , Sonic Zhang , Stephen Warren , "angelo@sysam.it" , Alexey Brodkin Subject: [U-Boot] [PATCH 05/48] Add a way to skip relocation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When running U-Boot as an EFI application we cannot relocate since we do not have relocation information. U-Boot has already been relocated to a suitable address. Add a global_data flag to control skipping relocation. Signed-off-by: Simon Glass --- common/board_f.c | 7 +++++++ include/asm-generic/global_data.h | 1 + 2 files changed, 8 insertions(+) diff --git a/common/board_f.c b/common/board_f.c index 21be26f..5e09c5f 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -664,6 +664,11 @@ static int reloc_fdt(void) static int setup_reloc(void) { + if (gd->flags & GD_FLG_SKIP_RELOC) { + debug("Skipping relocation due to flag\n"); + return 0; + } + #ifdef CONFIG_SYS_TEXT_BASE gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE; #ifdef CONFIG_M68K @@ -689,6 +694,8 @@ static int setup_reloc(void) static int jump_to_copy(void) { + if (gd->flags & GD_FLG_SKIP_RELOC) + return 0; /* * x86 is special, but in a nice way. It uses a trampoline which * enables the dcache if possible. diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index db0550b..086ee96 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -116,5 +116,6 @@ typedef struct global_data { #define GD_FLG_ENV_READY 0x00080 /* Env. imported into hash table */ #define GD_FLG_SERIAL_READY 0x00100 /* Pre-reloc serial console ready */ #define GD_FLG_FULL_MALLOC_INIT 0x00200 /* Full malloc() is ready */ +#define GD_FLG_SKIP_RELOC 0x00400 /* Don't relocate */ #endif /* __ASM_GENERIC_GBL_DATA_H */