Message ID | 1474860866-16406-46-git-send-email-sjg@chromium.org |
---|---|
State | Superseded |
Delegated to: | Bin Meng |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> 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 3sj8xS1C5hz9s65 for <incoming@patchwork.ozlabs.org>; Mon, 26 Sep 2016 13:45:16 +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=NB1V9WOM; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DCE54B39B3; Mon, 26 Sep 2016 05:40:31 +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 13sR0H_tsezA; Mon, 26 Sep 2016 05:40:31 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 542A8B39B2; Mon, 26 Sep 2016 05:37:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F51DA7760 for <u-boot@lists.denx.de>; Mon, 26 Sep 2016 05:35:58 +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 z50hYvYvY97q for <u-boot@lists.denx.de>; Mon, 26 Sep 2016 05:35:57 +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-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) by theia.denx.de (Postfix) with ESMTPS id 04A9EB381E for <u-boot@lists.denx.de>; Mon, 26 Sep 2016 05:35:20 +0200 (CEST) Received: by mail-io0-f173.google.com with SMTP id m186so169777259ioa.2 for <u-boot@lists.denx.de>; Sun, 25 Sep 2016 20:35:20 -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=QxaWRfQ/zvIzU4BQQx+Sr+xfsTX6YfTcsyaWS6qYqDI=; b=NB1V9WOMToGAb1PtbAx6PdR6ebigDi/B+Wbt3VlicO1BD6Ssy14ee89LFb+5wy/FiC Tys3AaTFjc5XputmXGRQQVefsLxL898GdCAX9UV0gEyjinGUtR9BSmu4sLRjIChRt/xi BhlWO1QcpQpsfCOmMMfEy/85WLfEzHfAAhE66ZCoCHX+HuK9niOZJ1ngxrzNXzUUzTkn gWh100f796DXwCk0kcV9MN/a8ADXIkCXxbYeTgR8ZhilU7ct9TiRIWLyrMvHHR218w0b vegBWR0MKtcWMmeS4VG4K5qrHEZdGLQF7mvHBFLogvR0Wud+EG3+B9vZZYP/gIqQPZTl xitQ== 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=QxaWRfQ/zvIzU4BQQx+Sr+xfsTX6YfTcsyaWS6qYqDI=; b=kf/lF9QZQuwK7oxTANxAd9T4xJqzIyyVv2G/qDDBms18s7nSd+gtLbg/j/Diji/dVl hnaAeh7XXgT3GGHZ6ihFBDceuTIH2e/bxUo6hhqQcSwIc7YQhltGBUTIpqUVPxlQ0EuJ ROsahSqZq40atMkJT0igjQkBZfbThgFNr3KXbFYBdAPfYC/buHHgtJUoBJhHmJLOH0tk yZ0DZlbAiy7XYCYQS6eaI4iAuKjDyb68/77Hy7gsyx/FFjFGi7Qh9PC6Isqwnc9I6fsY V8kGmQoShbPl7+lhU4SCrHU5vSyB4LUcJTx8CarvqTal2GtnDGTiJrelKXb9ldwdjvrb +djw== X-Gm-Message-State: AE9vXwMcOaXUF0jAdGbchDfcec+WJ2+yyWb1S+Cl8q72hisM4ZT96fylquxbdL5oILy2kG0U X-Received: by 10.107.30.11 with SMTP id e11mr20508224ioe.57.1474860919149; Sun, 25 Sep 2016 20:35:19 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:1005:12:61b7:f33c:9010:eb01]) by smtp.gmail.com with ESMTPSA id l38sm7524936iod.35.2016.09.25.20.35.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Sep 2016 20:35:12 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id D395022104F; Sun, 25 Sep 2016 21:35:07 -0600 (MDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Date: Sun, 25 Sep 2016 21:33:48 -0600 Message-Id: <1474860866-16406-46-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1474860866-16406-1-git-send-email-sjg@chromium.org> References: <1474860866-16406-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH 45/82] x86: board_r: Set the global data pointer after relocation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <http://lists.denx.de/mailman/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <http://lists.denx.de/mailman/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
diff --git a/common/board_r.c b/common/board_r.c index d959ad3..02800ca 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -974,6 +974,11 @@ init_fnc_t init_sequence_r[] = { void board_init_r(gd_t *new_gd, ulong dest_addr) { + /* Set up the new global data pointer */ +#if CONFIG_IS_ENABLED(X86_64) + arch_setup_gd(new_gd); +#endif + #ifdef CONFIG_NEEDS_MANUAL_RELOC int i; #endif
Since 'gd' is just a normal variable on 64-bit x86, it is relocated by the time we get to board_init_r(). The old 'gd' variable is passed in as parameter to board_init_r(), presumably for this situation. Assign it on 64-bit x86 so that gd points to the correct data. Options to improve this: - Make gd a fixed register and remove the board_init_r() parameter - Make all archs use this board_init_r() parameter Signed-off-by: Simon Glass <sjg@chromium.org> --- common/board_r.c | 5 +++++ 1 file changed, 5 insertions(+)