From patchwork Wed Jan 9 11:57:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 210698 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 AD7A22C00D0 for ; Wed, 9 Jan 2013 22:54:50 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 978B54A15C; Wed, 9 Jan 2013 12:54:47 +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 NxBBTFl6044P; Wed, 9 Jan 2013 12:54:47 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE0654A149; Wed, 9 Jan 2013 12:54:31 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 97F764A131 for ; Wed, 9 Jan 2013 12:54:27 +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 HLGQEdx2QPST for ; Wed, 9 Jan 2013 12:54:26 +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-gg0-f172.google.com (mail-gg0-f172.google.com [209.85.161.172]) by theia.denx.de (Postfix) with ESMTPS id 71FC64A0F8 for ; Wed, 9 Jan 2013 12:54:20 +0100 (CET) Received: by mail-gg0-f172.google.com with SMTP id r1so290997ggn.31 for ; Wed, 09 Jan 2013 03:54:19 -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=LmwCTyyHCo/KCNrr6Iofx1fwguvkgK91LBhh/GKTUZQ=; b=Upr2xPeCmZ8G+rMmVqxKVcb/7hVCIYg9JEtOCqrl+Ef4UQT6P3GbN1H10OOvczMXJl G5pRjOkJ2Yv0wQxoZa4KL1aLmvu2MT8rHs+QmwXDNvX1YtfPKUXptdHxl1beEh2gG7Fa Dgs7Xoy8GRr3IV97G3Xzf9nFKH+AKBIVVfpNBi66D3gCYC4sGNtH/+dHYp4NnygfSdGN o6kUlUPKMQ/vbZvHyH2F9kzaNqWmTlFdZA+HOELdC9fWUNf397cwQ0vQSDyg4nDXn9VR oibWR9xl/fxIfAZREo4NSxi1KAr6Azna3vmCb0ZH0WnaKbwM1OMZKwEv452w0651Cl1E joDQ== X-Received: by 10.236.9.36 with SMTP id 24mr76462534yhs.63.1357732459340; Wed, 09 Jan 2013 03:54:19 -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.17 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Jan 2013 03:54:18 -0800 (PST) From: Otavio Salvador To: U-Boot Mailing List Date: Wed, 9 Jan 2013 09:57:57 -0200 Message-Id: <1357732680-30245-4-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 3/6] mx28evk: 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 --- 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/mx28evk.h | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h index ac9522f..4a95156 100644 --- a/include/configs/mx28evk.h +++ b/include/configs/mx28evk.h @@ -290,6 +290,10 @@ "uimage=uImage\0" \ "console_fsl=ttyAM0\0" \ "console_mainline=ttyAMA0\0" \ + "fdt_file=imx28-evk.dtb\0" \ + "fdt_addr=0x41000000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ "mmcdev=0\0" \ "mmcpart=2\0" \ "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ @@ -300,15 +304,46 @@ "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=${console_mainline},${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 WARN: Cannot load the DT; " \ + "fi;" \ + "fi; " \ + "else " \ + "bootm; " \ + "fi;\0" #define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev}; if mmc rescan; then " \