From patchwork Fri Jul 11 04:23:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 368943 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 A8789140085 for ; Fri, 11 Jul 2014 14:24:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 90B2CB37E6; Fri, 11 Jul 2014 06:24:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 nROfYVAFf6Py; Fri, 11 Jul 2014 06:24:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E9EB3B37B0; Fri, 11 Jul 2014 06:24:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B134FB37C2 for ; Fri, 11 Jul 2014 06:24:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 BEI6Zbw7HyAG for ; Fri, 11 Jul 2014 06:24:01 +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-qc0-f202.google.com (mail-qc0-f202.google.com [209.85.216.202]) by theia.denx.de (Postfix) with ESMTPS id 80106B37AE for ; Fri, 11 Jul 2014 06:23:57 +0200 (CEST) Received: by mail-qc0-f202.google.com with SMTP id x13so104874qcv.3 for ; Thu, 10 Jul 2014 21:23:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G85vCsjhbjaVtFBoShrFfZ2dn3U6l2NB1LHM27OwwZc=; b=FleZHtQZMXz+iXHFIqZMEXfBnIRb9kh8msrD+ssMlMi65b7i4KmTFmm1Ym6z21+eUl OI2ByMDroiVH7Il24mTz+ufCEaklfbheMaUPQO1t5eN1q6eNLY2QXWLJcEUxDEPdIq2w N+zyjz/KW3T1FWkg8awzMO42weFdO1gEYAIunv+EqYNzFZ+WbTgCnNu4tJKSa//fKBXc czP+4W8+/1cnO+IY3B8257qPaPhzbkwu5X9FI1l/QSxXnbkavtk8K035P2uNldf7FqL4 EfCMQhrooAtM+h/ux5PzOo98fQGt+dmY3AOqkGY3TGLKDw4t+WHWht6DyERwXviXJe7L 0CiQ== X-Gm-Message-State: ALoCoQni2yvfIfpap2ZpVk+SiuNt12D/oo0rqxj1e/Gu8KkVV5E+5YUwSnwjkypgUIDk7aCmyjfI X-Received: by 10.236.124.100 with SMTP id w64mr16167814yhh.57.1405052636339; Thu, 10 Jul 2014 21:23:56 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id c50si91210yhl.7.2014.07.10.21.23.56 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 21:23:56 -0700 (PDT) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 3AAEF31C340; Thu, 10 Jul 2014 21:23:56 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id DB7EE220DBE; Thu, 10 Jul 2014 22:23:55 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Thu, 10 Jul 2014 22:23:27 -0600 Message-Id: <1405052613-20987-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1405052613-20987-1-git-send-email-sjg@chromium.org> References: <1405052613-20987-1-git-send-email-sjg@chromium.org> Cc: Jeroen Hofstee Subject: [U-Boot] [PATCH v3 3/9] sandbox: Set up global data before board_init_f() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de At present sandbox defines CONFIG_SYS_GENERIC_GLOBAL_DATA, meaning that the global_data pointer is set up in board_init_f(). If we set up and zero the global data before calling board_init_f() then we don't need to define CONFIG_SYS_GENERIC_GLOBAL_DATA. Make this change to simplify the init process. Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None arch/sandbox/cpu/start.c | 5 +++++ arch/sandbox/include/asm/config.h | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index aad3b8b..5289291 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -218,6 +219,7 @@ SANDBOX_CMDLINE_OPT_SHORT(terminal, 't', 1, int main(int argc, char *argv[]) { struct sandbox_state *state; + gd_t data; int ret; ret = state_init(); @@ -236,6 +238,9 @@ int main(int argc, char *argv[]) if (state->ram_buf_rm && state->ram_buf_fname) os_unlink(state->ram_buf_fname); + memset(&data, '\0', sizeof(data)); + gd = &data; + /* Do pre- and post-relocation init */ board_init_f(0); diff --git a/arch/sandbox/include/asm/config.h b/arch/sandbox/include/asm/config.h index 6c1bff9..ec7729e 100644 --- a/arch/sandbox/include/asm/config.h +++ b/arch/sandbox/include/asm/config.h @@ -7,7 +7,6 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ -#define CONFIG_SYS_GENERIC_GLOBAL_DATA #define CONFIG_SANDBOX_ARCH /* Used by drivers/spi/sandbox_spi.c and arch/sandbox/include/asm/state.h */