From patchwork Tue Mar 6 12:06:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 882022 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=c-s.fr Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zwbBV6yM6z9sgh for ; Tue, 6 Mar 2018 23:07:46 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 825F9C21F60; Tue, 6 Mar 2018 12:06:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 23023C21E16; Tue, 6 Mar 2018 12:06:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EA4BFC21DAF; Tue, 6 Mar 2018 12:06:25 +0000 (UTC) Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by lists.denx.de (Postfix) with ESMTPS id A4F32C21C8B for ; Tue, 6 Mar 2018 12:06:25 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3zwb8n25ttz9ttwF; Tue, 6 Mar 2018 13:06:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 35PUJ7kRV06q; Tue, 6 Mar 2018 13:06:17 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 3zwb8n1VDqz9ttCq; Tue, 6 Mar 2018 13:06:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 32A958B7FC; Tue, 6 Mar 2018 13:06:25 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id f0esczDpNNFq; Tue, 6 Mar 2018 13:06:25 +0100 (CET) Received: from po15720vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.5]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D7D468B7E1; Tue, 6 Mar 2018 13:06:24 +0100 (CET) Received: by po15720vm.idsi0.si.c-s.fr (Postfix, from userid 0) id D112F6F0E5; Tue, 6 Mar 2018 13:06:24 +0100 (CET) Message-Id: <3625abbc67e5e115a771105737fd39124a33dc92.1520334961.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy To: Tom Rini Date: Tue, 6 Mar 2018 13:06:24 +0100 (CET) Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3 01/15] powerpc, 8xx: initialisation global data X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Global data pointer has to be initialised Global data area has to be zeroised Signed-off-by: Christophe Leroy --- arch/powerpc/cpu/mpc8xx/cpu_init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/cpu/mpc8xx/cpu_init.c b/arch/powerpc/cpu/mpc8xx/cpu_init.c index dc601a12976..3c9c4b19753 100644 --- a/arch/powerpc/cpu/mpc8xx/cpu_init.c +++ b/arch/powerpc/cpu/mpc8xx/cpu_init.c @@ -12,6 +12,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + /* * Breath some life into the CPU... * @@ -24,6 +26,10 @@ void cpu_init_f(immap_t __iomem *immr) memctl8xx_t __iomem *memctl = &immr->im_memctl; ulong reg; + gd = (gd_t *)(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET); + /* Clear initial global data */ + memset((void *)gd, 0, sizeof(*gd)); + /* SYPCR - contains watchdog control (11-9) */ out_be32(&immr->im_siu_conf.sc_sypcr, CONFIG_SYS_SYPCR);