From patchwork Fri Dec 28 19:17:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 208530 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 8E3A52C00D8 for ; Sat, 29 Dec 2012 06:16:12 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 59B964A15F; Fri, 28 Dec 2012 20:15:13 +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 FmOHA5nmSjeC; Fri, 28 Dec 2012 20:15:13 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BBB044A16D; Fri, 28 Dec 2012 20:14:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4FEB84A14C for ; Fri, 28 Dec 2012 20:14:14 +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 hjHGJyTwLhtd for ; Fri, 28 Dec 2012 20:14:11 +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-yh0-f49.google.com (mail-yh0-f49.google.com [209.85.213.49]) by theia.denx.de (Postfix) with ESMTPS id 185EF4A134 for ; Fri, 28 Dec 2012 20:13:52 +0100 (CET) Received: by mail-yh0-f49.google.com with SMTP id f43so49485yha.8 for ; Fri, 28 Dec 2012 11:13:51 -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=rqXRC22waRmd3iI82sJJ1VTlKZTNDJxg4iCLYfxldFE=; b=qNg7PLQyAsFpdTVPzo8T1dJI8yNsEJZ5pn8NZ09j6Af64mAVJ1/J4sxrF1q0MSIzb6 xHTtkdplqpKhf/LtQGPjz2LTqdBvZoaescFQrzP7gDhb5vPDag5jG+k+8i86T7BVP2Z1 6QDbK/12ZvrKJ7CoCdApcDUtPF3NRNC8R705ka7+xPFW9vDDxvniwFcYeuAz1/uLv4Ux lRFKp87jwm+S4rZmzL6ZUISLHqgkX7q78ZEXZgmGI7nJFJyIm0O4zkiOcfaFbhxK823k jbgXbh7/oc7bFNazSFXxSJFSRpV7ummzDeygCnIp8sfeM56wcNSOtAE7PMAfOqCS4hbF jgWQ== X-Received: by 10.236.133.225 with SMTP id q61mr23391329yhi.108.1356722031432; Fri, 28 Dec 2012 11:13:51 -0800 (PST) Received: from nano.home ([177.97.165.10]) by mx.google.com with ESMTPS id w1sm27317502anl.5.2012.12.28.11.13.49 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Dec 2012 11:13:50 -0800 (PST) From: Otavio Salvador To: U-Boot Mailing List Date: Fri, 28 Dec 2012 17:17:05 -0200 Message-Id: <1356722226-23186-6-git-send-email-otavio@ossystems.com.br> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1356722226-23186-1-git-send-email-otavio@ossystems.com.br> References: <1356722226-23186-1-git-send-email-otavio@ossystems.com.br> Cc: Fabio Estevam , Otavio Salvador Subject: [U-Boot] [PATCH v2 5/6] mx6qsabrelite: Add support to dynamically choose between ftd 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 v2: - Allow use of dynamic/static ip - Allow force use, or not, of fdt - Change 'auto' to 'try' include/configs/mx6qsabrelite.h | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h index ee86f9b..7ca12d9 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" \ + "ftd_file=imx6q-sabrelite.dtb\0" \ + "ftd_addr=0x11000000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ "mmcdev=0\0" \ "mmcpart=2\0" \ "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \ @@ -169,13 +173,43 @@ "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ - "bootm\0" \ + "if test ${boot_fdt} = yes; then " \ + "if fatload mmc ${mmcdev}:${mmcpart} ${ftd_addr} ${ftd_file}; then " \ + "bootm ${loadaddr} - ${ftd_addr}; " \ + "else " \ + "if test ${boot_fdt} = try; then " \ + "bootm; " \ + "else " \ + "echo ERROR: Cannot load the DT, aborting...; " \ + "fi;\0" \ + "fi;\0" \ + "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;\0" \ + "run ${get_cmd} ${uimage}; " \ + "if test ${boot_fdt} = no; then " \ + "if run ${get_cmd} ${ftd_addr} ${ftd_file}; then " \ + "bootm ${loadaddr} - ${ftd_addr}; " \ + "else " \ + "if test ${boot_fdt} = try; then " \ + "bootm; " \ + "else " \ + "echo ERROR: Cannot load the DT, aborting...; " \ + "fi;\0" \ + "fi;\0" \ + "else " \ + "bootm; " \ + "fi;\0" #define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev};" \