From patchwork Wed Jan 9 11:57:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 210701 X-Patchwork-Delegate: sbabic@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 57FBD2C00D0 for ; Wed, 9 Jan 2013 22:55:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1E9944A15D; Wed, 9 Jan 2013 12:55:07 +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 UXNbrA-PxjPN; Wed, 9 Jan 2013 12:55:06 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 511A74A155; Wed, 9 Jan 2013 12:54:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C03094A112 for ; Wed, 9 Jan 2013 12:54: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 lc1mG0jaXrr9 for ; Wed, 9 Jan 2013 12:54:35 +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-ye0-f174.google.com (mail-ye0-f174.google.com [209.85.213.174]) by theia.denx.de (Postfix) with ESMTPS id 499FD4A12C for ; Wed, 9 Jan 2013 12:54:22 +0100 (CET) Received: by mail-ye0-f174.google.com with SMTP id m6so294239yen.33 for ; Wed, 09 Jan 2013 03:54:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=w5nBTq6+0Wwu/ofrK5yoszuXAStAAdmuUtlPdfDYMYc=; b=ByNyDbBsjp57wP9pa95r4pq3CR8JWBnojtd6rtD6puZzGvAJNBCpIjn7UlqcenTvhf sB/k5PW93k/Kvl7vaKoGVAONMdZ6gjqmzDkbif/gppPl1FHAp3jDA3rOMGFAfmPgDCWW /3Hws4GpWe6ppYVieG7XFt30Xm7yof8V0dZ2a36B/X0Uwrm8Adn0h+09LWLti34TvLAe 3rmMWS/bKsYYHsF2Z4KkK5E65ehJD39Ug45mN1XlweVpDhBiO3P7+UTvMGl9vaq39Byt cFh2ZK26JvBDANiL7CXFJYqXHKEdG538HQqVxRwR4tngLy9eUF9dvcmnzQDfvGJWqk0b lvyA== X-Received: by 10.236.114.99 with SMTP id b63mr29930180yhh.103.1357732461784; Wed, 09 Jan 2013 03:54:21 -0800 (PST) Received: from nano.lab.ossystems.com.br.lab.ossystems.com.br ([177.35.64.121]) by mx.google.com with ESMTPS id k5sm1017945yhj.6.2013.01.09.03.54.19 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Jan 2013 03:54:21 -0800 (PST) From: Otavio Salvador To: U-Boot Mailing List Date: Wed, 9 Jan 2013 09:57:58 -0200 Message-Id: <1357732680-30245-5-git-send-email-otavio@ossystems.com.br> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1357732680-30245-1-git-send-email-otavio@ossystems.com.br> References: <1357732680-30245-1-git-send-email-otavio@ossystems.com.br> Cc: Fabio Estevam , Otavio Salvador Subject: [U-Boot] [PATCH v5 4/6] mx53loco: Add support to dynamically choose between fdt use or not 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 Signed-off-by: Otavio Salvador Acked-by: Jason Liu --- Changes in v5: - Change subject - Reword the warning Changes in v4: - Use a warning, instead of error when failing to fetch fdt - Drop exit use - Fix netboot - Use fdt instead of ftd Changes in v3: - Add loadfdt - Use loadfdt - Call exit to abort script Changes in v2: - Allow use of dynamic/static ip - Allow force use, or not, of fdt - Change 'auto' to 'try' include/configs/mx53loco.h | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index 996396b..cbc3a82 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -119,6 +119,10 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "script=boot.scr\0" \ "uimage=uImage\0" \ + "fdt_file=imx53-qsb.dtb\0" \ + "fdt_addr=0x71000000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ "mmcdev=0\0" \ "mmcpart=2\0" \ "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ @@ -128,15 +132,47 @@ "bootscript=echo Running bootscript from mmc ...; " \ "source\0" \ "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ + "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ - "bootm\0" \ + "if test ${boot_fdt} = yes; then " \ + "if run loadfdt; then " \ + "bootm ${loadaddr} - ${fdt_addr}; " \ + "else " \ + "if test ${boot_fdt} = try; then " \ + "bootm; " \ + "else " \ + "echo WARN: Cannot load the DT; " \ + "fi; " \ + "fi; " \ + "else " \ + "bootm; " \ + "fi;\0" \ "netargs=setenv bootargs console=ttymxc0,${baudrate} " \ "root=/dev/nfs " \ "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ "netboot=echo Booting from net ...; " \ "run netargs; " \ - "dhcp ${uimage}; bootm\0" \ + "if test ${ip_dyn} = yes; then " \ + "setenv get_cmd dhcp; " \ + "else " \ + "setenv get_cmd tftp; " \ + "fi; " \ + "${get_cmd} ${uimage}; " \ + "if test ${boot_fdt} = yes; then " \ + "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ + "bootm ${loadaddr} - ${fdt_addr}; " \ + "else " \ + "if test ${boot_fdt} = try; then " \ + "bootm; " \ + "else " \ + "echo ERROR: Cannot load the DT; " \ + "exit; " \ + "fi; " \ + "fi; " \ + "else " \ + "bootm; " \ + "fi;\0" #define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev}; if mmc rescan; then " \