From patchwork Sun Dec 23 11:27:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikram Narayanan X-Patchwork-Id: 207968 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 71CF42C008E for ; Sun, 23 Dec 2012 22:34:03 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2154B4A029; Sun, 23 Dec 2012 12:33:59 +0100 (CET) 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 ZqSzQk+2XDsO; Sun, 23 Dec 2012 12:33:58 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BBA764A027; Sun, 23 Dec 2012 12:33:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A13074A027 for ; Sun, 23 Dec 2012 12:33:51 +0100 (CET) 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 aLA31W1hyEqt for ; Sun, 23 Dec 2012 12:33:48 +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-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by theia.denx.de (Postfix) with ESMTPS id 800864A021 for ; Sun, 23 Dec 2012 12:33:44 +0100 (CET) Received: by mail-pa0-f45.google.com with SMTP id bg2so3645194pad.32 for ; Sun, 23 Dec 2012 03:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:content-type:content-transfer-encoding; bh=UIv0D4pZnXznTq4FsnHf3xa9pP2UWVWI1fpDpaOngTk=; b=IfwYOTSXTOLsznP1d6GJWloXmpZY8ht7ubFtkzyoCcZiyoyBq3UiSpOf7lhEbfDr4j k73ua8OGzYfih8dVDnZ09cOFUH5YrDiQfJ/1rWLRh1Jbnk7TrjR8ExZKTorWA5g1gYAk j7GNwvMuxBIE24lvgyHq7XrscEl1jbtgoq6ahdeB6XfEhGTRTKx2Qnu2OxkGeFntFwqb J5p4YWyJEjj0nxvNRmltsAN4I+vBFMzB+emipQ+C9DSfi4A9TvEGCO5PTxp2D4aSYA5j +AKm8Kj7aRptJMNXVtqiKtRgoPfHD11KZ8ick3yhNdGX+jJ7e9SsuKJXoVLGvXGUFIz9 cxTA== X-Received: by 10.68.235.71 with SMTP id uk7mr57268254pbc.10.1356262054805; Sun, 23 Dec 2012 03:27:34 -0800 (PST) Received: from [115.184.104.188] ([115.184.104.188]) by mx.google.com with ESMTPS id d2sm10871764paw.19.2012.12.23.03.27.29 (version=SSLv3 cipher=OTHER); Sun, 23 Dec 2012 03:27:34 -0800 (PST) Message-ID: <50D6EA9C.30809@gmail.com> Date: Sun, 23 Dec 2012 16:57:24 +0530 From: Vikram Narayanan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] arm/bootstage: Move the bootstage call after gd init 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de bootstage_mark_name calls timer_get_boot_us which inturn calls the arch timer. The arch timer uses the gd pointer to save the lastinc count. A call to bootstage_mark_name here results in a data abort as gd is uninitialized. Signed-off-by: Vikram Narayanan Cc: Simon Glass Cc: Wolfgang Denk Cc: Albert Aribaud Acked-by: Simon Glass --- Though it is true that there are currently no users for this feature, it isn't good to see an abort when someone tries to use BOOTSTAGE. I was bugged by this error when trying to use this feature on i.Mx6Q based board. arch/arm/lib/board.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index e0cb635..2f09ab9 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -277,13 +277,13 @@ void board_init_f(ulong bootflag) void *new_fdt = NULL; size_t fdt_size = 0; - bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); - /* Pointer is writable since we allocated a register for it */ gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR) & ~0x07); /* compiler optimization barrier needed for GCC >= 3.4 */ __asm__ __volatile__("": : :"memory"); + bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); + memset((void *)gd, 0, sizeof(gd_t)); gd->mon_len = _bss_end_ofs;