From patchwork Mon May 13 18:36:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 243490 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 60E502C009D for ; Tue, 14 May 2013 04:37:05 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F412D4A052; Mon, 13 May 2013 20:37:03 +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 CemsWkIgWfgX; Mon, 13 May 2013 20:37:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7860D4A020; Mon, 13 May 2013 20:36:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E95FC4A02A for ; Mon, 13 May 2013 20:36: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 pmiMvyN0vx9B for ; Mon, 13 May 2013 20:36:42 +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-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by theia.denx.de (Postfix) with ESMTPS id 9C6B04A019 for ; Mon, 13 May 2013 20:36:36 +0200 (CEST) Received: by mail-we0-f174.google.com with SMTP id x53so6604548wes.19 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=HtLtXsGEQs3/YJVH0rQylHytllV5ygOxl8khuPVLRkQ=; b=Lyh3WIBEdWlinxHBVI4Ew6GipaUjGB1Fa6I3AeG5v4FxP5E6kyV2sbVH8DXmn/AYM0 6kGx8Ox4bmnVngFSbWIhUKPnHIrgYQgeaJgZNTbJgnIPqqn2XpvP8CjZXjjJ3/Ili607 ZT/l94NhFuuomA5vHQi6SreJP7pkrWkpA14GwvQ7jCKMKla1cqPpdioPUtPUW/R7BPyV znBY6VJNbAKM+cnqzf4HBwAanOVhNXz0MiquWqYfJMAr5FXfXhbffF2ZkGnZig1tftIy p1AI/RiEiYnZPt5ORZA5QYlxFZBU6XzZDVrl5RDGbd6bWQESzjXT1s1CzaMjFu/9ApYy UUlw== X-Received: by 10.180.37.243 with SMTP id b19mr21287504wik.12.1368470195833; 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 nf9sm17247284wic.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-0002hL-Ew; 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:29 +0200 Message-Id: <1368470190-10299-6-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 5/6] spl_mmc: add Falcon mode support for raw variant 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 If Falcon mode support is enabled (and the system isn't directed into booting u-boot), it will instead try to load kernel from sector CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR and CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS of kernel argument parameters starting from sector CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR. Signed-off-by: Peter Korsgaard --- README | 10 ++++++++++ drivers/mmc/spl_mmc.c | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/README b/README index 595c05d..3bac95b 100644 --- a/README +++ b/README @@ -2915,6 +2915,16 @@ FIT uImage format: Address, size and partition on the MMC to load U-Boot from when the MMC is being used in raw mode. + CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR + Sector to load kernel uImage from when MMC is being + used in raw mode (for Falcon mode) + + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS + Sector and number of sectors to load kernel argument + parameters from when MMC is being used in raw mode + (for falcon mode) + CONFIG_SPL_FAT_SUPPORT Support for fs/fat/libfat.o in SPL binary diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index d710c0d..170fa38 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -63,6 +63,21 @@ end: return (err == 0); } +#ifdef CONFIG_SPL_OS_BOOT +static int mmc_load_image_raw_os(struct mmc *mmc) +{ + if (!mmc->block_dev.block_read(0, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS, + (void *)CONFIG_SYS_SPL_ARGS_ADDR)) { + printf("mmc args blk read error\n"); + return -1; + } + + return mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR); +} +#endif + #ifdef CONFIG_SPL_FAT_SUPPORT static int mmc_load_image_fat(struct mmc *mmc, const char *filename) { @@ -130,6 +145,9 @@ void spl_mmc_load_image(void) boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug("boot mode - RAW\n"); +#ifdef CONFIG_SPL_OS_BOOT + if (spl_start_uboot() || mmc_load_image_raw_os(mmc)) +#endif err = mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #ifdef CONFIG_SPL_FAT_SUPPORT