From patchwork Mon May 13 18:36:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 243492 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 3C4892C0098 for ; Tue, 14 May 2013 04:37:25 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6DA594A099; Mon, 13 May 2013 20:37: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 6oT5WHAykG-t; Mon, 13 May 2013 20:37:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 575294A026; Mon, 13 May 2013 20:36:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4719B4A03A for ; Mon, 13 May 2013 20:36:53 +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 muFfYqU18Tc2 for ; Mon, 13 May 2013 20:36:48 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by theia.denx.de (Postfix) with ESMTPS id 3E5DB4A023 for ; Mon, 13 May 2013 20:36:35 +0200 (CEST) Received: by mail-we0-f170.google.com with SMTP id u54so6893255wes.1 for ; Mon, 13 May 2013 11:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=hh7oOkUEnUgiGZ2sW/PB2+O87s67uQ0XhKKz7WCo+uU=; b=0ynl3QsgrVPCXSJHryozuX7wmpfjKmsmpj8j9ZBT2wbFfhkWdZ9z7YXmOnZ4grsd5p yR9Qrmfl8fl6d8Hd9jigPHndxc7hcYuy7wk/vAMK1AWAx89IpbYeitMSScVTxCIj7/AS xXgRtm1r1Ay11Y54B+ky2uAF3ZL2KQ+qscAtzKsm7wAIzGa6dtDYtNnBFzni9cvlW3ZJ Kw/XD4ZdNMnCu6UXlBv7ysab0SKm1sG8CN+PeQA1tnsa1T2QHuA+r4bbpvowUC6BlyBm hcM/PgkZzRY+zHoTOhLzM1MXLZmSrU95Ug3kF+zXk/zh5gfZ8LX7sO7Bcs4iRaQ1TdaG JLWQ== X-Received: by 10.180.210.242 with SMTP id mx18mr21143709wic.14.1368470195344; Mon, 13 May 2013 11:36:35 -0700 (PDT) Received: from dell.be.48ers.dk ([2001:6f8:1434:0:6267:20ff:fe4e:21b6]) by mx.google.com with ESMTPSA id nf9sm17248033wic.3.2013.05.13.11.36.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 11:36:34 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.80) (envelope-from ) id 1Ubxbs-0002hE-Dp; Mon, 13 May 2013 20:36:32 +0200 From: Peter Korsgaard To: u-boot@lists.denx.de, trini@ti.com, sbabic@denx.de Date: Mon, 13 May 2013 20:36:28 +0200 Message-Id: <1368470190-10299-5-git-send-email-peter.korsgaard@barco.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368470190-10299-1-git-send-email-peter.korsgaard@barco.com> References: <1368470190-10299-1-git-send-email-peter.korsgaard@barco.com> Cc: Peter Korsgaard Subject: [U-Boot] [PATCHv3 4/6] spl_mmc: mmc_load_image_raw(): Add sector argument 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 So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard --- drivers/mmc/spl_mmc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index d250b40..d710c0d 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -32,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR; -static int mmc_load_image_raw(struct mmc *mmc) +static int mmc_load_image_raw(struct mmc *mmc, unsigned long sector) { unsigned long err; u32 image_size_sectors; @@ -42,10 +42,7 @@ static int mmc_load_image_raw(struct mmc *mmc) sizeof(struct image_header)); /* read image header to find the image size & load address */ - err = mmc->block_dev.block_read(0, - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, 1, - header); - + err = mmc->block_dev.block_read(0, sector, 1, header); if (err == 0) goto end; @@ -56,9 +53,8 @@ static int mmc_load_image_raw(struct mmc *mmc) mmc->read_bl_len; /* Read the header too to avoid extra memcpy */ - err = mmc->block_dev.block_read(0, - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, - image_size_sectors, (void *)spl_image.load_addr); + err = mmc->block_dev.block_read(0, sector, image_size_sectors, + (void *)spl_image.load_addr); end: if (err == 0) @@ -134,7 +130,8 @@ void spl_mmc_load_image(void) boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug("boot mode - RAW\n"); - err = mmc_load_image_raw(mmc); + err = mmc_load_image_raw(mmc, + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug("boot mode - FAT\n");