From patchwork Thu Jan 10 19:45:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 211133 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 E77442C00DB for ; Fri, 11 Jan 2013 06:48:45 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 46C9B4A208; Thu, 10 Jan 2013 20:48:44 +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 BrwSuZZPXBCA; Thu, 10 Jan 2013 20:48:44 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 724164A21B; Thu, 10 Jan 2013 20:48:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BAF4B4A208 for ; Thu, 10 Jan 2013 20:48:41 +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 4aUYPpFr-VOp for ; Thu, 10 Jan 2013 20:48:41 +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-qc0-f171.google.com (mail-qc0-f171.google.com [209.85.216.171]) by theia.denx.de (Postfix) with ESMTPS id F189C4A204 for ; Thu, 10 Jan 2013 20:48:39 +0100 (CET) Received: by mail-qc0-f171.google.com with SMTP id d1so628807qca.16 for ; Thu, 10 Jan 2013 11:48:38 -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=ZmPeZ0VGP0nofCFnjsp0a3Hz+LgBTr4XPABhwRE6+Do=; b=x+D/AkJvcna/j2J/cPfty+Rv20rVriGyaLcVQqdKG6W+wFXkv60ktVGc8M7QDr6EX7 UZWFEEgRY1UTGe48TNHIhfL8f5Lb8Dywpjm3AIBapx0w1meoXLbe1Z68f7mBmormO5WF CB4u9ErbjiSU2kvGbpEbYj2Dcyb4WV2hAID5QozUdEaiGtTNk0G+pyjg+FZdEYyBFahr P783whp6hUdGu4tvIsfc7dUa4qHJt4a9MjU0is2WwnWyB9aEelyT6Hi6nVXEZ56U8ucL IjDkZ49zvgFcCru8XLbFxcmpO1AmvgV+wi+rIonm5h7MKCLQdWA7CK1SAksVhdOTGfu0 m1HA== X-Received: by 10.224.60.6 with SMTP id n6mr56894963qah.62.1357846900633; Thu, 10 Jan 2013 11:41:40 -0800 (PST) Received: from nano.lab.ossystems.com.br ([177.35.66.48]) by mx.google.com with ESMTPS id j20sm2109864qaq.17.2013.01.10.11.41.38 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Jan 2013 11:41:40 -0800 (PST) From: Otavio Salvador To: U-Boot Mailing List Date: Thu, 10 Jan 2013 17:45:08 -0200 Message-Id: <1357847109-3686-6-git-send-email-otavio@ossystems.com.br> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1357847109-3686-1-git-send-email-otavio@ossystems.com.br> References: <1357847109-3686-1-git-send-email-otavio@ossystems.com.br> Cc: Fabio Estevam , Otavio Salvador Subject: [U-Boot] [PATCH v6 5/6] mx6qsabrelite: 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 v6: - Fix netboot fdt 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/mx6qsabrelite.h | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h index ee86f9b..752f098 100644 --- a/include/configs/mx6qsabrelite.h +++ b/include/configs/mx6qsabrelite.h @@ -157,6 +157,10 @@ "console=ttymxc1\0" \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ + "fdt_file=imx6q-sabrelite.dtb\0" \ + "fdt_addr=0x11000000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ "mmcdev=0\0" \ "mmcpart=2\0" \ "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \ @@ -167,15 +171,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 || test ${boot_fdt} = try; 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},${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 || test ${boot_fdt} = try; 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};" \