From patchwork Fri Apr 19 17:43:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 238074 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 AE4C12C0195 for ; Sat, 20 Apr 2013 03:44:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9333B4A41D; Fri, 19 Apr 2013 19:44:15 +0200 (CEST) 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 xR-JQI-Kbyiv; Fri, 19 Apr 2013 19:44:15 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C21934A413; Fri, 19 Apr 2013 19:44:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2AA5A4A413 for ; Fri, 19 Apr 2013 19:44:11 +0200 (CEST) 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 tonEN084nZLn for ; Fri, 19 Apr 2013 19:44:10 +0200 (CEST) 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-gh0-f173.google.com (mail-gh0-f173.google.com [209.85.160.173]) by theia.denx.de (Postfix) with ESMTPS id 40BF54A412 for ; Fri, 19 Apr 2013 19:44:08 +0200 (CEST) Received: by mail-gh0-f173.google.com with SMTP id g16so535194ghb.18 for ; Fri, 19 Apr 2013 10:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=DLHgGIyu+IsQmx4XWJ21sAK7xvIJ9rdUUnMh/vUQZCw=; b=WXLkKH2WQthatvajTAZeJdDD6mFsN3ziYwZlAuaPPWcebXeqVmv5LvscfykwTOE/e1 nK4xKoSbrHc2b8cTDg89GKxSrIJfWgZ/mQeo27N2KXczM+oo6cd2UMMONic/bfnlhXPU vC+gYMzQ6HGOZwsQFVBFimYeYNOhwdQDKrK9HBt2+id3LZa+XBPbVpVEzIEno7hTHAKM +mpK7dkpHQBle5vsPdLVqAc9ASH1Tcadwgdexe7AsfK9ImOLchGe4Qqnqx6BInQwn6UT iRhFrohhSRokbHA006vUcLJ1rgpbDq67EvbK78XbE7eRvP3MXBMZzf2lXQ7rGac6DzQq cY8A== X-Received: by 10.236.30.106 with SMTP id j70mr8853320yha.191.1366393447145; Fri, 19 Apr 2013 10:44:07 -0700 (PDT) Received: from localhost.localdomain ([187.64.220.204]) by mx.google.com with ESMTPS id h68sm25941878yhj.24.2013.04.19.10.44.05 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Apr 2013 10:44:06 -0700 (PDT) From: Fabio Estevam To: sbabic@denx.de Date: Fri, 19 Apr 2013 14:43:41 -0300 Message-Id: <1366393422-19558-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.7.9.5 Cc: Fabio Estevam , u-boot@lists.denx.de, otavio@ossystems.com.br Subject: [U-Boot] [PATCH v4 1/2] mx51evk: Update environment in order to allow booting a dt kernel 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 From: Fabio Estevam Update the environment as done in other imx boards to allow easy switching between booting a non-dt kernel and a dt kernel. Change CONFIG_LOADADDR to 0x92000000, so that we can have the: - uImage at 0x92000000 - imx51-babbage.dtb at 0x91000000 ,which are adequate locations in RAM to avoid overlapping. Boot tested the following kernels: - 2.6.35 from FSL (11.09 branch) - 3.9-rc7 non-dt - 3.9-rc7 dt Signed-off-by: Fabio Estevam Acked-by: Otavio Salvador --- Changes since v3: - None. Just make it part of a series now Changes since v2: - Mention the LOADADDR change in the commit log Changes since v1: - Do not remove mmcrootfstype - Fix typo in Subject - Improve commit log by adding the tested booted kernels include/configs/mx51evk.h | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h index cb3d938..4545a80 100644 --- a/include/configs/mx51evk.h +++ b/include/configs/mx51evk.h @@ -149,11 +149,15 @@ #define CONFIG_ETHPRIME "FEC0" -#define CONFIG_LOADADDR 0x90800000 /* loadaddr env var */ +#define CONFIG_LOADADDR 0x92000000 /* loadaddr env var */ #define CONFIG_EXTRA_ENV_SETTINGS \ "script=boot.scr\0" \ "uimage=uImage\0" \ + "fdt_file=imx51-babbage.dtb\0" \ + "fdt_addr=0x91000000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ "mmcdev=0\0" \ "mmcpart=2\0" \ "mmcroot=/dev/mmcblk0p3 rw\0" \ @@ -166,15 +170,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 || 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=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 || 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 ERROR: Cannot load the DT; " \ + "exit; " \ + "fi; " \ + "fi; " \ + "else " \ + "bootm; " \ + "fi;\0" #define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev}; if mmc rescan; then " \