From patchwork Mon Jan 7 13:51:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 209925 X-Patchwork-Delegate: trini@ti.com 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 031672C0094 for ; Tue, 8 Jan 2013 00:51:38 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 19E694A04E; Mon, 7 Jan 2013 14:51:37 +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 Dsn+udzPWBnS; Mon, 7 Jan 2013 14:51:36 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9840D4A03F; Mon, 7 Jan 2013 14:51:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 124F34A03F for ; Mon, 7 Jan 2013 14:51:34 +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 rtA97db4VFNQ for ; Mon, 7 Jan 2013 14:51:33 +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-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by theia.denx.de (Postfix) with ESMTPS id 0E7784A03E for ; Mon, 7 Jan 2013 14:51:32 +0100 (CET) Received: by mail-wg0-f45.google.com with SMTP id dq12so9497145wgb.0 for ; Mon, 07 Jan 2013 05:51:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=F8xwPyl14d5o0hncQH20/pg6UfZlZBXg6zwozVPg9Y8=; b=hGEN0j8Px/ENMeP3LvyZ+0bWEw2zzxnGvS+ZknGZC21s5nvgpIjhFaWo22wdMbr+0f XriYmJqjtvVMKa5iQEMoUWNbEkP6fXc7ZQlF7sKJX1JP1xbJc4uTaWImYakbpadZA8tw 7jGHfkjTcwg7DGiJJ9nL2zeMpUIXP/VNtmG1H9YQ4GFz3xTt4RkFlf7U0g9wJORdBDID rt4TjsE7JkOApwDcy6jd/CqIQawW2lZs+KgC3SeeYtr992g3mNLqmy2U7hL/FbTGvj3G hq8PZhjkP/XQdEupjGdMVs9QcgeQkILBoyanTGnG7w8q++kDTXh/5oP/gOJezPT3eX7R peWg== X-Received: by 10.194.85.234 with SMTP id k10mr95600165wjz.53.1357566691780; Mon, 07 Jan 2013 05:51:31 -0800 (PST) Received: from localhost.localdomain (11.90.21.95.dynamic.jazztel.es. [95.21.90.11]) by mx.google.com with ESMTPS id p2sm13788055wic.7.2013.01.07.05.51.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 05:51:30 -0800 (PST) From: Javier Martinez Canillas To: Tom Rini Date: Mon, 7 Jan 2013 14:51:20 +0100 Message-Id: <1357566680-29376-1-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 1.7.7.6 X-Gm-Message-State: ALoCoQnTKe79ePHNREBWZ9U0f7qPezUB/P/TinA9I33lk8xyakNEFptDfEdPzGmPG13zUQ+QIinj Cc: Javier Martinez Canillas , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 1/1] omap4: allow the use of a plain text env file instead boot scripts 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de For production systems it is better to use script images since they are protected by checksums and carry valuable information like name and timestamp. Also, you can't validate the content passed to env import. But for development, it is easier to use the env import command and plain text files instead of script-images. Since both OMAP4 supported boards (Panda and TI SDP4430) are used primarily for development, this patch allows U-Boot to load env var from a text file in case that an boot.scr script-image is not present. The variable uenvcmd (if existent) will be executed (using run) after uEnv.txt was loaded. If uenvcmd doesn't exist the default boot sequence will be started. Signed-off-by: Javier Martinez Canillas Acked-by: Nishanth Menon --- Changes since v2: - Comment the advantages and drawbacks of using env import instead of boot scripts as explained by Wolfgang Denk. - Don't break existing users/distributions that rely on boot.scr by looking for uEnv.txt only if boot.scr does not exist as suggested by Tom Rini. include/configs/omap4_common.h | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h index a32369a..dfdfea9 100644 --- a/include/configs/omap4_common.h +++ b/include/configs/omap4_common.h @@ -159,6 +159,9 @@ "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \ "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ "source ${loadaddr}\0" \ + "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \ + "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ + "env import -t ${loadaddr} ${filesize}\0" \ "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ "mmcboot=echo Booting from mmc${mmcdev} ...; " \ "run mmcargs; " \ @@ -166,12 +169,20 @@ #define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev}; if mmc rescan; then " \ + "echo SD/MMC found on device ${mmcdev};" \ "if run loadbootscript; then " \ "run bootscript; " \ "else " \ - "if run loaduimage; then " \ - "run mmcboot; " \ - "fi; " \ + "if run loadbootenv; then " \ + "run importbootenv; " \ + "fi;" \ + "if test -n ${uenvcmd}; then " \ + "echo Running uenvcmd ...;" \ + "run uenvcmd;" \ + "fi;" \ + "fi;" \ + "if run loaduimage; then " \ + "run mmcboot; " \ "fi; " \ "fi"