From patchwork Tue Dec 25 14:15:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 208106 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 B15002C00B0 for ; Wed, 26 Dec 2012 01:16:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D06994A01C; Tue, 25 Dec 2012 15:16:19 +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 4fdx58cTD3RU; Tue, 25 Dec 2012 15:16:19 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C4E0C4A01E; Tue, 25 Dec 2012 15:16:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DC7EB4A01E for ; Tue, 25 Dec 2012 15:15:56 +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 LUvW1w2GZaiw for ; Tue, 25 Dec 2012 15:15:54 +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-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by theia.denx.de (Postfix) with ESMTPS id 9924C4A01C for ; Tue, 25 Dec 2012 15:15:52 +0100 (CET) Received: by mail-we0-f180.google.com with SMTP id t57so3582989wey.25 for ; Tue, 25 Dec 2012 06:15:49 -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=tbnyahUhMrseIkp+IBDr7WHUUfdgmIXhg+529D7dIw0=; b=HknMSnmLyCIznEAnrKZWNn8PHWdS8lq4Xt9u0Cg6iTP6GCxovBMI3SAVXIzwOjr6eo F4S/8lTfCcE6rDWt0jkdnkkDMTz2ZBbd47yJ6n30rFdPvo8P45tyxmkR/Bpk29KnD2XF 1mBntWsgffxXuAAPmAu8VfCBbcXBlpLS5+uxcwqJInLu9XzmejO4yoahDhL8i3JND0Sd wI9JDqO5CgPou3HUVZCy4iaR5wMGT186D+tDB1sUnLTZTCIMQyXshpUt80M1Lxzr1v+c 2dmAKoXkcdOyT34b789bbmOIas2IrnPX/5Pkv6ZWQWHVchN2LDoaMHKZ6vnrIaF+cDld 5TdA== X-Received: by 10.194.21.70 with SMTP id t6mr39859049wje.42.1356444949583; Tue, 25 Dec 2012 06:15:49 -0800 (PST) Received: from localhost.localdomain (79.237.79.188.dynamic.jazztel.es. [188.79.237.79]) by mx.google.com with ESMTPS id bd6sm16787389wib.10.2012.12.25.06.15.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Dec 2012 06:15:48 -0800 (PST) From: Javier Martinez Canillas To: Tom Rini Date: Tue, 25 Dec 2012 15:15:23 +0100 Message-Id: <1356444923-16737-1-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 1.7.7.6 X-Gm-Message-State: ALoCoQkzLQqmbrk1FZma8KwbSRJat7l/b5M4GI6KnpCnmWbEZvuSH8oH9GnbBp81T/NPHwO0+BzK Cc: Javier Martinez Canillas , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/1] omap4: use 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 Based on commit cf073e49bc3502be1b48a0e3faf0cde9edbb89db for beagleboard Using the new env import command it is possible to use plain text files instead of script-images. Plain text files are much easier to handle. E.g. If your boot.scr contains the following: ----------------------------------- setenv dvimode 1024x768-16@60 run loaduimage run mmcboot ----------------------------------- you could create a file named uEnv.txt and use that instead of boot.scr: ----------------------------------- dvimode=1024x768-16@60 uenvcmd=run loaduimage; run mmcboot ----------------------------------- 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, therefore you could just use ----------------------------------- dvimode=1024x768-16@60 ----------------------------------- as uEnv.txt because loaduimage and mmcboot is part of the default boot sequence Signed-off-by: Javier Martinez Canillas --- include/configs/omap4_common.h | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h index a32369a..a821c01 100644 --- a/include/configs/omap4_common.h +++ b/include/configs/omap4_common.h @@ -156,9 +156,9 @@ "vram=${vram} " \ "root=${mmcroot} " \ "rootfstype=${mmcrootfstype}\0" \ - "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 +166,16 @@ #define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev}; if mmc rescan; then " \ - "if run loadbootscript; then " \ - "run bootscript; " \ - "else " \ - "if run loaduimage; then " \ - "run mmcboot; " \ - "fi; " \ + "echo SD/MMC found on device ${mmcdev};" \ + "if run loadbootenv; then " \ + "run importbootenv; " \ + "fi;" \ + "if test -n ${uenvcmd}; then " \ + "echo Running uenvcmd ...;" \ + "run uenvcmd;" \ + "fi;" \ + "if run loaduimage; then " \ + "run mmcboot; " \ "fi; " \ "fi"