From patchwork Wed Aug 7 15:53:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 265552 X-Patchwork-Delegate: trini@ti.com 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 5740A2C00A3 for ; Thu, 8 Aug 2013 01:54:39 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6E7D84A095; Wed, 7 Aug 2013 17:54:32 +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 bvKdUUdyBiba; Wed, 7 Aug 2013 17:54:32 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 461C34A04F; Wed, 7 Aug 2013 17:54:24 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 654664A027 for ; Wed, 7 Aug 2013 17:54:17 +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 nWFiARiBuei6 for ; Wed, 7 Aug 2013 17:54:11 +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-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by theia.denx.de (Postfix) with ESMTPS id 4B3F14A029 for ; Wed, 7 Aug 2013 17:54:05 +0200 (CEST) Received: by mail-we0-f169.google.com with SMTP id n5so1738996wev.14 for ; Wed, 07 Aug 2013 08:54:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xtJa80EKoEwPf9tt+WiBhOAMWkLabcEORpxNcbn6GnU=; b=pqRlY+2Bdd3SAo0j+xI7/pT/Y25TGgCIIqRTsX5CeEo0i/OmVivZzsUdsNgYLaiUxz KneRbUsISpH65a3qQ6ePkY5Gs8pT/KlJw323x+LcIqru7pPD14cRq/RdXutxBwrJNvEl d7F7E1ultRu/yM2313EfD1PwP1adQT5U/nzBIA6rw/FRX/dUYmKyNT/XC9UpU3XJzeha ilrG9VcbLStG0ipcfohCYS0oi+Nq/xEoDxLeDH9sTBGKPtABhKCOHRZSgHsXWStEaPRO cqxXPPGOQjqS90QnAK1kpEkawNQrgN4FOvg5vWVXOeamMe4+cIHEn5dzJjPUlTc8ck9j iWNA== X-Gm-Message-State: ALoCoQkImRxlF66gIQEjh9q8JOwDzuTkY9Hx9NYExCXc72u84ctt0Jbl5ay6/7KTNKA9uDGHXVkT X-Received: by 10.194.78.78 with SMTP id z14mr834409wjw.32.1375890845025; Wed, 07 Aug 2013 08:54:05 -0700 (PDT) Received: from localhost.localdomain (65.54.21.95.dynamic.jazztel.es. [95.21.54.65]) by mx.google.com with ESMTPSA id hb2sm13302728wib.0.2013.08.07.08.54.01 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 07 Aug 2013 08:54:04 -0700 (PDT) From: Javier Martinez Canillas To: Tom Rini Date: Wed, 7 Aug 2013 17:53:19 +0200 Message-Id: <1375890799-30350-3-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1375890799-30350-1-git-send-email-javier.martinez@collabora.co.uk> References: <1375890799-30350-1-git-send-email-javier.martinez@collabora.co.uk> Cc: u-boot@lists.denx.de, Javier Martinez Canillas Subject: [U-Boot] [PATCH 2/2] OMAP3: igep00x0: allow booting with a FDT from MMC 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 IGEP boards now have Device Tree support in the mainline kernel. To boot an IGEP board using a DT, a uEnv.txt plain text file could be used to define a custom uenvcmd that will be run by the default boot command. It is more convenient to change the default boot command to allow loading a FDT if it is stored in the boot dir of the rootfs uSD/MMC partition. If no FDT is found then the defaul command tries to boot a zImage without a DT using legacy boot. Signed-off-by: Javier Martinez Canillas --- board/isee/igep00x0/igep00x0.c | 14 ++++++++++++++ include/configs/igep00x0.h | 13 ++++++++++++- 2 files changed, 26 insertions(+), 1 deletions(-) diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index 77a9bc6..7a7500b 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -138,6 +138,18 @@ int board_mmc_init(bd_t *bis) } #endif +void set_fdt(void) +{ + switch (gd->bd->bi_arch_number) { + case MACH_TYPE_IGEP0020: + setenv("dtbfile", "omap3-igep0020.dtb"); + break; + case MACH_TYPE_IGEP0030: + setenv("dtbfile", "omap3-igep0030.dtb"); + break; + } +} + /* * Routine: misc_init_r * Description: Configure board specific parts @@ -150,6 +162,8 @@ int misc_init_r(void) dieid_num_r(); + set_fdt(); + return 0; } diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h index b3c57f4..13d58a4 100644 --- a/include/configs/igep00x0.h +++ b/include/configs/igep00x0.h @@ -137,6 +137,9 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "usbtty=cdc_acm\0" \ "loadaddr=0x82000000\0" \ + "dtbaddr=0x81600000\0" \ + "bootdir=/boot\0" \ + "bootfile=zImage\0" \ "usbtty=cdc_acm\0" \ "console=ttyO2,115200n8\0" \ "mpurate=auto\0" \ @@ -167,10 +170,13 @@ "loadbootenv=load mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \ "importbootenv=echo Importing environment from mmc ...; " \ "env import -t $loadaddr $filesize\0" \ - "loadzimage=load mmc ${mmcdev} ${loadaddr} zImage\0" \ + "loadzimage=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}\0" \ + "loadfdt=load mmc ${mmcdev}:2 ${dtbaddr} ${bootdir}/${dtbfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootz ${loadaddr}\0" \ + "mmcbootfdt=echo Booting with DT from mmc ...; " \ + "bootz ${loadaddr} - ${dtbaddr}\0" \ "nandboot=echo Booting from onenand ...; " \ "run nandargs; " \ "onenand read ${loadaddr} 280000 400000; " \ @@ -187,6 +193,11 @@ "run uenvcmd;" \ "fi;" \ "if run loadzimage; then " \ + "if test -n $dtbfile; then " \ + "if run loadfdt; then " \ + "run mmcbootfdt;" \ + "fi;" \ + "fi;" \ "run mmcboot;" \ "fi;" \ "fi;" \