From patchwork Sun Jul 14 21:58:48 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: 258908 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 E35C72C00E3 for ; Mon, 15 Jul 2013 08:05:27 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DDB4C4A019; Mon, 15 Jul 2013 00:05:23 +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 zMjDxXy0PFuy; Mon, 15 Jul 2013 00:05:23 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C43934A03A; Mon, 15 Jul 2013 00:05:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5B6054A03A for ; Mon, 15 Jul 2013 00:05: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 H15cg22a-Jz6 for ; Mon, 15 Jul 2013 00:05:11 +0200 (CEST) X-Greylist: delayed 356 seconds by postgrey-1.27 at theia; Mon, 15 Jul 2013 00:05:04 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-f176.google.com (mail-we0-f176.google.com [74.125.82.176]) by theia.denx.de (Postfix) with ESMTPS id 34FA84A039 for ; Mon, 15 Jul 2013 00:05:04 +0200 (CEST) Received: by mail-we0-f176.google.com with SMTP id t56so9325976wes.7 for ; Sun, 14 Jul 2013 15:05:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=ARe5Aa+2jASpa0lcHyXUVvN35kzQ8MKMF2byaNwAVCQ=; b=e76O24S9NFnV97aIP3J2CAJqpd6sB/9pzBehH7QfLX2NUWVUPPQlYKeAsFddCU+DEJ UyMe+vh4/Dfz7RvlDLI7v8CmeULfzHXqyrqpad3bo0yn3+zyHK7IjULnjE0TrsG+jas6 AFSZQr+T74C0qEyqZgf0ZeAI/K+ok5Kez22nOgYDBJnx68fImEJc7eaYHCKr12D+2bXc vWmloKZNR8pUJdcmLAlbv2JP8fgMMBAX0Qm8cuIPtUK1+sbkSmJdfgli22Y7Ik2Zw019 LM3jkgp5R2c1lMn6akVDUbYWoRZlGoJCVLn0kRg9x4tmBK/age10IXAhB+vuBwoYhAsa zgtg== X-Received: by 10.194.104.74 with SMTP id gc10mr29714184wjb.48.1373839137506; Sun, 14 Jul 2013 14:58:57 -0700 (PDT) Received: from localhost.localdomain (79.54.21.95.dynamic.jazztel.es. [95.21.54.79]) by mx.google.com with ESMTPSA id u7sm11213541wiw.9.2013.07.14.14.58.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 14 Jul 2013 14:58:56 -0700 (PDT) From: Javier Martinez Canillas To: Tom Rini Date: Sun, 14 Jul 2013 23:58:48 +0200 Message-Id: <1373839128-12907-1-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 1.7.7.6 X-Gm-Message-State: ALoCoQkYvf1uYp4Kj38HsbvBksEJRf4Nn3A29jZnrOPBJZni/+Ka4JiiRbs/6sa0dNT4WkYWm6+q Cc: u-boot@lists.denx.de, Javier Martinez Canillas Subject: [U-Boot] [PATCH 1/1] 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 a uSD/MMC partition. If no FDT is found then the command behaves just as it used so this change won't break existing setup for current users. Signed-off-by: Javier Martinez Canillas --- board/isee/igep00x0/igep00x0.c | 14 ++++++++++++++ include/configs/igep00x0.h | 9 +++++++++ 2 files changed, 23 insertions(+), 0 deletions(-) diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index 0d4679d..fdd2773 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -154,6 +154,18 @@ int board_mmc_init(bd_t *bis) } #endif +void set_fdt(void) +{ + switch (gd->bd->bi_arch_number) { + case MACH_TYPE_IGEP0020: + setenv("fdtfile", "omap3-igep0020.dtb"); + break; + case MACH_TYPE_IGEP0030: + setenv("fdtfile", "omap3-igep0030.dtb"); + break; + } +} + /* * Routine: misc_init_r * Description: Configure board specific parts @@ -166,6 +178,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 1d8090b..72752af 100644 --- a/include/configs/igep00x0.h +++ b/include/configs/igep00x0.h @@ -149,6 +149,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "usbtty=cdc_acm\0" \ "loadaddr=0x82000000\0" \ + "fdtaddr=0x81600000\0" \ "usbtty=cdc_acm\0" \ "console=ttyO2,115200n8\0" \ "mpurate=auto\0" \ @@ -180,9 +181,12 @@ "importbootenv=echo Importing environment from mmc ...; " \ "env import -t $loadaddr $filesize\0" \ "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ + "loadfdt=fatload mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ + "mmcbootfdt=echo Booting with DT from mmc ...; " \ + "bootm ${loadaddr} - ${fdtaddr}\0" \ "nandboot=echo Booting from onenand ...; " \ "run nandargs; " \ "onenand read ${loadaddr} 280000 400000; " \ @@ -199,6 +203,11 @@ "run uenvcmd;" \ "fi;" \ "if run loaduimage; then " \ + "if test -n $fdtfile; then " \ + "if run loadfdt; then " \ + "run mmcbootfdt;" \ + "fi;" \ + "fi;" \ "run mmcboot;" \ "fi;" \ "fi;" \