From patchwork Fri Apr 8 14:24:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Longchamp X-Patchwork-Id: 90349 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 8CBCCB6F76 for ; Sat, 9 Apr 2011 00:25:40 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CCE9A280CB; Fri, 8 Apr 2011 16:25:27 +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 t-xaiWyzavQV; Fri, 8 Apr 2011 16:25:27 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2BFF0280D1; Fri, 8 Apr 2011 16:24:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C5F24280C6 for ; Fri, 8 Apr 2011 16:24:31 +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 iQAvEvu14szx for ; Fri, 8 Apr 2011 16:24:30 +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.ch.keymile.com (mail.ch.keymile.com [193.17.201.103]) by theia.denx.de (Postfix) with SMTP id 2ACEE2809F for ; Fri, 8 Apr 2011 16:24:27 +0200 (CEST) Received: from SRVCHBER1212.ch.keymile.net ([172.31.32.9]) by eSafe SMTP Relay 1297237168; Fri, 08 Apr 2011 16:13:02 +0100 Received: from localhost.localdomain ([172.31.32.134]) by SRVCHBER1212.ch.keymile.net with Microsoft SMTPSVC(6.0.3790.4675); Fri, 8 Apr 2011 16:24:26 +0200 From: Valentin Longchamp To: u-boot@lists.denx.de Date: Fri, 8 Apr 2011 16:24:00 +0200 Message-Id: X-Mailer: git-send-email 1.7.0.5 In-Reply-To: In-Reply-To: References: References: X-OriginalArrivalTime: 08 Apr 2011 14:24:26.0412 (UTC) FILETIME=[AA10E6C0:01CBF5F8] X-ESAFE-STATUS: Mail allowed X-ESAFE-DETAILS: Cc: Valentin Longchamp , hs@denx.de, holger.brunck@keymile.com Subject: [U-Boot] [PATCH 10/30] arm/km: add addbootcount environment variable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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: Holger Brunck This environment variable is used to set the bootcount address for the kernel. Signed-off-by: Holger Brunck Acked-by: Heiko Schocher cc: Wolfgang Denk cc: Detlev Zundel cc: Valentin Longchamp Signed-off-by: Valentin Longchamp --- board/keymile/common/common.c | 7 +++++++ include/configs/km_arm.h | 3 +++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index 3a7980d..9ec0022 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -106,6 +106,13 @@ int set_km_env(void) varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM; sprintf((char *)buf, "0x%x", varaddr); setenv("varaddr", (char *)buf); + +#ifdef BOOTCOUNT_ADDR + unsigned int bootcountaddr; + bootcountaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM; + sprintf((char *)buf, "0x%x", bootcountaddr); + setenv("bootcountaddr", (char *)buf); +#endif return 0; } diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h index 70113d4..89f9d35 100644 --- a/include/configs/km_arm.h +++ b/include/configs/km_arm.h @@ -64,6 +64,9 @@ #define CONFIG_KM_KERNEL_ADDR 0x2000000 /* 4096KBytes */ #define CONFIG_KM_DEF_ENV_CPU \ + "addbootcount=" \ + "setenv bootargs ${bootargs} " \ + "bootcountaddr=${bootcountaddr}\0" \ "addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0" \ "boot=bootm ${actual_kernel_addr} - -\0" \ "cramfsloadfdt=echo \\\\c\0" \