From patchwork Thu Jul 11 13:55:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Waters X-Patchwork-Id: 258462 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 52C4F2C02C3 for ; Thu, 11 Jul 2013 23:56:57 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 496C64A1CB; Thu, 11 Jul 2013 15:56:47 +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 sG3XfbrF1T4d; Thu, 11 Jul 2013 15:56:47 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4BF9F4A200; Thu, 11 Jul 2013 15:56:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 42DB14A1F7 for ; Thu, 11 Jul 2013 15:56:22 +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 v19IGj5R86lE for ; Thu, 11 Jul 2013 15:56:19 +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 exchange07.timesys.com (exchange07.timesys.com [209.114.137.116]) by theia.denx.de (Postfix) with ESMTPS id EE9A94A1CE for ; Thu, 11 Jul 2013 15:56:15 +0200 (CEST) Received: from jjw-desktop.timesys.com (192.168.3.96) by exchange07.timesys.com (192.168.1.221) with Microsoft SMTP Server id 8.1.436.0; Thu, 11 Jul 2013 09:56:03 -0400 From: Justin Waters To: Date: Thu, 11 Jul 2013 09:55:00 -0400 Message-ID: <1373550903-474-4-git-send-email-justin.waters@timesys.com> X-Mailer: git-send-email 1.7.9.6 In-Reply-To: <1373550903-474-1-git-send-email-justin.waters@timesys.com> References: <1373550903-474-1-git-send-email-justin.waters@timesys.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 3/6] am335x_evm: Rework bootcmd to handle two MMC devs 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The BeagleBone Black can boot from either the MMC card or eMMC chip on board. We should try both interfaces. This modification also allows a graceful fallback if a device exists but boot images are not present on it. Changes for v2: * Fix boot partition - it should always show up as mmcblk0p2 * Fix missing FDT load Signed-off-by: Justin Waters --- include/configs/am335x_evm.h | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index ea68b57..0df0e7a 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -128,9 +128,23 @@ "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ "loaduimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ - "mmcboot=echo Booting from mmc ...; " \ - "run mmcargs; " \ - "bootm ${loadaddr} - ${fdtaddr}\0" \ + "mmcboot=mmc dev ${mmcdev}; " \ + "if mmc rescan; then " \ + "echo SD/MMC found on device ${mmcdev};" \ + "if run loadbootenv; then " \ + "echo Loaded environment from ${bootenv};" \ + "run importbootenv;" \ + "fi;" \ + "if test -n $uenvcmd; then " \ + "echo Running uenvcmd ...;" \ + "run uenvcmd;" \ + "fi;" \ + "if run loaduimage; then " \ + "run loadfdt;" \ + "run mmcargs; " \ + "bootm ${loadaddr} - ${fdtaddr};" \ + "fi;" \ + "fi;\0" \ "spiboot=echo Booting from spi ...; " \ "run spiargs; " \ "sf probe ${spibusno}:0; " \ @@ -162,23 +176,11 @@ #define CONFIG_BOOTCOMMAND \ "run findfdt; " \ - "mmc dev ${mmcdev}; if mmc rescan; then " \ - "echo SD/MMC found on device ${mmcdev};" \ - "if run loadbootenv; then " \ - "echo Loaded environment from ${bootenv};" \ - "run importbootenv;" \ - "fi;" \ - "if test -n $uenvcmd; then " \ - "echo Running uenvcmd ...;" \ - "run uenvcmd;" \ - "fi;" \ - "if run loaduimage; then " \ - "run loadfdt;" \ - "run mmcboot;" \ - "fi;" \ - "else " \ - "run nandboot;" \ - "fi;" \ + "run mmcboot;" \ + "setenv mmcdev 1; " \ + "setenv bootpart 1:2; " \ + "run mmcboot;" \ + "run nandboot;" /* Clock Defines */ #define V_OSCK 24000000 /* Clock output from T2 */