From patchwork Tue Feb 10 21:35:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 438580 X-Patchwork-Delegate: albert.aribaud@free.fr 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 588051401AB for ; Wed, 11 Feb 2015 08:36:11 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 853D94B7EF; Tue, 10 Feb 2015 22:35:59 +0100 (CET) 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 DhTtzAphwnzr; Tue, 10 Feb 2015 22:35:59 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B1A0EA7423; Tue, 10 Feb 2015 22:35:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 440F94B7BD for ; Tue, 10 Feb 2015 22:35:40 +0100 (CET) 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 EdCKfvrOlW9o for ; Tue, 10 Feb 2015 22:35:40 +0100 (CET) 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-pa0-f74.google.com (mail-pa0-f74.google.com [209.85.220.74]) by theia.denx.de (Postfix) with ESMTPS id 2C9D24B7CF for ; Tue, 10 Feb 2015 22:35:34 +0100 (CET) Received: by mail-pa0-f74.google.com with SMTP id kx10so2689516pab.1 for ; Tue, 10 Feb 2015 13:35:32 -0800 (PST) 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=6kfzAYoyrfBEAK8FjBy4V6ssi9f0/E1fPzacCyjXWeQ=; b=fERsHpxTkRDNy14cpYAmKm7/PzTC39DBDQRkR/UrJR5Ru62C1pASA1u1tPcqqO63oZ 6nRXke9eHEfAYhjQAxldeDvhM/OIjSyrlB+0N+sN8YUMzzA5wkr67i7TQ4jWyVfDnRdw U55scI/Sv+wnn+NM7tUEIRJEhMx9+VvIiV6xYIy23bGcFRmCao7/utNef+oCD34HxogX bNNDKog6mt6Hyxuzr6PgpEaHFY319S8CJtVR202u6gHwApicGoRAUub4ENxx7SYjF53v iEUnhh2NS/29XX2jEXJca0ThI8MTPG/AFsY8Rrskm+WbWv944unFW6kH0Sy2+vqdVNXf d8bQ== X-Gm-Message-State: ALoCoQlpsLc7MsChhoBsS48waIxlx7lIl3YFgZ6bhUxm1uLt5T5InjN2D7bAPllM8JiyUotZYdHe X-Received: by 10.68.241.163 with SMTP id wj3mr22052676pbc.8.1423604132703; Tue, 10 Feb 2015 13:35:32 -0800 (PST) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id e3si41178igq.1.2015.02.10.13.35.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Feb 2015 13:35:32 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id OnEE3psv.1; Tue, 10 Feb 2015 13:35:32 -0800 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 578D62209F1; Tue, 10 Feb 2015 14:35:31 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Tue, 10 Feb 2015 14:35:10 -0700 Message-Id: <1423604113-24375-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1423604113-24375-1-git-send-email-sjg@chromium.org> References: <1423604113-24375-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v4 2/5] arm: spl: Avoid setting up a duplicate global data structure 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" This is already set up in crt0.S. We don't need a new structure and don't really want one in the 'data' section of the image, since it will be empty and crt0.S's changes will be ignored. As an interim measure, remove it only if CONFIG_DM is not defined. This allows us to press ahead with driver model in SPL and allow the stragglers to catch up. Signed-off-by: Simon Glass --- Changes in v4: - Squash the gdata revert patch into this one - Allow gdata to survive unless CONFIG_DM is defined, for now Changes in v3: None Changes in v2: - Remove gdata definition from ARM spl header file also arch/arm/include/asm/spl.h | 2 ++ arch/arm/lib/spl.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h index 8acd7cd..a6fdcf0 100644 --- a/arch/arm/include/asm/spl.h +++ b/arch/arm/include/asm/spl.h @@ -33,6 +33,8 @@ enum { /* Linker symbols. */ extern char __bss_start[], __bss_end[]; +#ifndef CONFIG_DM extern gd_t gdata; +#endif #endif diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c index c41850a..bd8c7d2 100644 --- a/arch/arm/lib/spl.c +++ b/arch/arm/lib/spl.c @@ -13,6 +13,7 @@ #include #include +#ifndef CONFIG_DM /* Pointer to as well as the global data structure for SPL */ DECLARE_GLOBAL_DATA_PTR; @@ -21,6 +22,7 @@ DECLARE_GLOBAL_DATA_PTR; * pafches that rely on it. The global_data area is set up in crt0.S. */ gd_t gdata __attribute__ ((section(".data"))); +#endif /* * In the context of SPL, board_init_f must ensure that any clocks/etc for @@ -33,8 +35,10 @@ void __weak board_init_f(ulong dummy) /* Clear the BSS. */ memset(__bss_start, 0, __bss_end - __bss_start); +#ifndef CONFIG_DM /* TODO: Remove settings of the global data pointer here */ gd = &gdata; +#endif board_init_r(NULL, 0); }