From patchwork Mon Dec 15 14:19:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 421211 X-Patchwork-Delegate: sr@denx.de 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 16DEB14003E for ; Tue, 16 Dec 2014 01:20:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 106314B9C7; Mon, 15 Dec 2014 15:20:37 +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 mr+oSQ7rVEkp; Mon, 15 Dec 2014 15:20:36 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D20554B984; Mon, 15 Dec 2014 15:20:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8ECF54B972 for ; Mon, 15 Dec 2014 15:20:22 +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 gIzOQIlG4vtq for ; Mon, 15 Dec 2014 15:20:22 +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-qg0-f73.google.com (mail-qg0-f73.google.com [209.85.192.73]) by theia.denx.de (Postfix) with ESMTPS id 426F24B97A for ; Mon, 15 Dec 2014 15:20:18 +0100 (CET) Received: by mail-qg0-f73.google.com with SMTP id q107so476115qgd.2 for ; Mon, 15 Dec 2014 06:20:17 -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=gbTS28lix7HdvPqLAvboKHw86Cg/VDbAWkqzkW2goYo=; b=Uk1ora+0y2je8dSC6Um46bDfcjNJyzntcZ3rZAZFerFC2o++IZHbTXs6X3jU5kogCa Ain7fIce1j6KHFnK731Ex4iyGxVF2bueMYwyBo4qazlXOfe7EA9lgL0Li1HZm/lbwfQ3 nJxyUzYxxjK5uZA/JERatXBWlx7BnsD9B8cFIzioirrdM7bcMWZi1kR+4gMQD/rxeFcU qaSIV59IoB1k9FP/6PgNl3HxHIhlqxaF8EJaLDjmf8MISUK4v83EJlnggkOjFHb1X+h0 fEYICb5xUb06h8CkJzSRAJzxNGhEhkHiQc9Vs3MKdJmigV2WyoctKBZ3aSUinlQ8uERC BE6Q== X-Gm-Message-State: ALoCoQm0d+0DXNMAiAjWQFQSWHSQ4E1LnZmuPgVkH41vMY9AdSVpfL4y0yqrMdwYRRh7nOc1OwNy X-Received: by 10.236.103.164 with SMTP id f24mr25956546yhg.11.1418653217783; Mon, 15 Dec 2014 06:20:17 -0800 (PST) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id s23si472769yhf.0.2014.12.15.06.20.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Dec 2014 06:20:17 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id rrQJ7LDt.1; Mon, 15 Dec 2014 06:20:17 -0800 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id E1C472211AE; Mon, 15 Dec 2014 07:20:16 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Mon, 15 Dec 2014 07:19:41 -0700 Message-Id: <1418653194-16873-7-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1418653194-16873-1-git-send-email-sjg@chromium.org> References: <1418653194-16873-1-git-send-email-sjg@chromium.org> Cc: Kim Phillips , Kumar Gala , Andy Fleming , Stefan Roese Subject: [U-Boot] [PATCH 06/19] WIP: powerpc: ppc4xx: Somehow BSS is not cleared in RAMBOOT case X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 From: Stefan Roese (NOT TO APPLY) I'm really not sure why this doesn't work in the RAMBOOT case. But BSS is not cleared and because of this booting crashed / hangs at some stage later. Something with the GOT calculation / handling is incorrect. To get this going for now, just clear the BSS again in the C code. Signed-off-by: Stefan Roese Signed-off-by: Simon Glass --- arch/powerpc/lib/board.c | 3 +++ common/board_r.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index e6d5355..2455e45 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -108,6 +108,7 @@ DECLARE_GLOBAL_DATA_PTR; extern ulong __init_end; extern ulong __bss_end; ulong monitor_flash_len; +extern ulong __bss_start; #if defined(CONFIG_CMD_BEDBUG) #include @@ -611,6 +612,8 @@ void board_init_r(gd_t *id, ulong dest_addr) /* The Malloc area is immediately below the monitor copy in DRAM */ malloc_start = dest_addr - TOTAL_MALLOC_LEN; + memset(&__bss_start, 0, &__bss_end - &__bss_start); + #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) /* * The gd->arch.cpu pointer is set to an address in flash before diff --git a/common/board_r.c b/common/board_r.c index a301cc2..2f80425 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -1,4 +1,4 @@ -/* + /* * Copyright (c) 2011 The Chromium OS Authors. * (C) Copyright 2002-2006 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. @@ -886,6 +886,12 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) gd = new_gd; #endif +#ifdef CONFIG_GLACIER + ulong bss_start = (ulong)&__bss_start; + ulong bss_end = (ulong)&__bss_end; + memset((void *)bss_start, 0, bss_end - bss_start); +#endif + #ifdef CONFIG_NEEDS_MANUAL_RELOC for (i = 0; i < ARRAY_SIZE(init_sequence_r); i++) init_sequence_r[i] += gd->reloc_off;