From patchwork Fri Apr 19 14:15:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 237986 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 6675B2C0216 for ; Sat, 20 Apr 2013 00:15:44 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B0E044A403; Fri, 19 Apr 2013 16:15:41 +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 XogHnabCks5q; Fri, 19 Apr 2013 16:15:41 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4F57E4A3F8; Fri, 19 Apr 2013 16:15:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2FA054A3F8 for ; Fri, 19 Apr 2013 16:15:38 +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 nCWD9HHPiH0V for ; Fri, 19 Apr 2013 16:15:37 +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-qe0-f47.google.com (mail-qe0-f47.google.com [209.85.128.47]) by theia.denx.de (Postfix) with ESMTPS id 3FB664A3F2 for ; Fri, 19 Apr 2013 16:15:35 +0200 (CEST) Received: by mail-qe0-f47.google.com with SMTP id w7so2667350qeb.34 for ; Fri, 19 Apr 2013 07:15:33 -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=FAiUCsqtevPs79+uNjAzBTeWcf06rk+BbyB4IU2VcKE=; b=ensGxD43EoQeWGUTI7rREF6Ld6jAexwreULgseiEN1F4VE5aIBgtiWakDQovNUpHhm x3WAn1Jt675AYEufWwOuTECsaKyemTbGj/lYadC03aTk6BqbH0VxGmKtTRSHzAlw1huz trlSwBP3K+0G04mlUCEw2T5gP0lx7J+FQhbdzIVF62udey3EQNX2hHAnNlu+4hF18a97 xrdND6mMBjfC2Vro267LnB1rC+RQ1KyGNsPEZRSsYqYyeOwUNYqovZFv42DtL6Q/WKVQ AMqw6LoHnwtB8cQrDQIWv1yVQ5dTiLmINqEyqzT56wb97xjVe7ayIr1SBjXwKfKS7/mY Dhyw== X-Received: by 10.224.17.72 with SMTP id r8mr14056067qaa.48.1366380933199; Fri, 19 Apr 2013 07:15:33 -0700 (PDT) Received: from localhost.localdomain ([187.64.220.204]) by mx.google.com with ESMTPS id ds5sm17873722qab.11.2013.04.19.07.15.31 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Apr 2013 07:15:32 -0700 (PDT) From: Fabio Estevam To: sbabic@denx.de Date: Fri, 19 Apr 2013 11:15:24 -0300 Message-Id: <1366380924-27047-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 v3] 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 --- 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 " \