From patchwork Thu Oct 22 12:01:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Kiryanov X-Patchwork-Id: 534375 X-Patchwork-Delegate: panto@antoniou-consulting.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 7C60F14131E for ; Thu, 22 Oct 2015 23:01:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=compulab.co.il header.i=@compulab.co.il header.b=DNb0Kj0C; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1FBC84B893; Thu, 22 Oct 2015 14:01:35 +0200 (CEST) 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 Cd76DbemW0xF; Thu, 22 Oct 2015 14:01:34 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6AAB54B882; Thu, 22 Oct 2015 14:01:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7DD714B89A for ; Thu, 22 Oct 2015 14:01:30 +0200 (CEST) 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 TLggR7bq-1AG for ; Thu, 22 Oct 2015 14:01:30 +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 compulab.co.il (softlayer.compulab.co.il [50.23.254.55]) by theia.denx.de (Postfix) with ESMTPS id 0E0DF4B88F for ; Thu, 22 Oct 2015 14:01:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=compulab.co.il; s=default; h=References:In-Reply-To:Message-Id:Date:Subject :Cc:To:From; bh=8I7GUrD+gNJuGT5tFwDCgSnICOfQrmAIlM6QpAKiAnw=; b=DNb0Kj0CYkppo fXXTQ51UVq1aB27VbGHN4fdlCjdWJZMNAv1hCQTqH1iDcYgKb34J7l7UY6us6WcS2VKGZvnaEsg1q xPP76YtyeXph66OiThZK+f3lHFc/zgR3en6M4yjj8nZCUeQglzqcz4kPnFfHuaJqrZDXcV5so1QZ4 7ccs=; Received: from [62.90.235.247] (port=45926 helo=zimbra-mta.compulab.co.il) by softlayer.compulab.co.il with esmtp (Exim 4.86) (envelope-from ) id 1ZpEYf-0001iz-Um; Thu, 22 Oct 2015 15:01:26 +0300 Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 0F69B48D590; Thu, 22 Oct 2015 15:01:25 +0300 (IDT) Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nEGtBLVUe4Cb; Thu, 22 Oct 2015 15:01:23 +0300 (IDT) Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id A0BFD48D572; Thu, 22 Oct 2015 15:01:23 +0300 (IDT) X-Virus-Scanned: amavisd-new at zimbra-mta.compulab.co.il Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8RGimm8u_pUX; Thu, 22 Oct 2015 15:01:23 +0300 (IDT) Received: from skynet.compulab.local (nikita-pc.compulab.local [192.168.11.211]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 8452448D529; Thu, 22 Oct 2015 15:01:23 +0300 (IDT) From: Nikita Kiryanov To: u-boot@lists.denx.de Date: Thu, 22 Oct 2015 15:01:12 +0300 Message-Id: <1445515280-21389-5-git-send-email-nikita@compulab.co.il> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445515280-21389-1-git-send-email-nikita@compulab.co.il> References: <1445515280-21389-1-git-send-email-nikita@compulab.co.il> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - softlayer.compulab.co.il X-AntiAbuse: Original Domain - lists.denx.de X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il X-Get-Message-Sender-Via: softlayer.compulab.co.il: acl_c_recent_authed_mail_ips_text_entry: nikita@compulab.co.il|compulab.co.il X-Authenticated-Sender: softlayer.compulab.co.il: nikita@compulab.co.il Cc: Tom Rini , Pantelis Antoniou , Guillaume GARDET Subject: [U-Boot] [PATCH 04/12] spl: mmc: remove #ifdef CONFIG_SPL_OS_BOOT check X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Implement default versions of falcon mode functions to make the CONFIG_SPL_OS_BOOT check in spl_mmc_load_image() unnecessary, thus reducing its #ifdef complexity. No functional changes. Signed-off-by: Nikita Kiryanov Cc: Igor Grinberg Cc: Paul Kocialkowski Cc: Pantelis Antoniou Cc: Tom Rini Cc: Simon Glass Cc: Guillaume GARDET Cc: Suriyan Ramasami --- common/spl/spl_ext.c | 6 ++++++ common/spl/spl_fat.c | 6 ++++++ common/spl/spl_mmc.c | 17 +++++++++-------- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c index 9d37fd3..a42fbd0 100644 --- a/common/spl/spl_ext.c +++ b/common/spl/spl_ext.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #ifdef CONFIG_SPL_EXT_SUPPORT @@ -135,5 +136,10 @@ defaults: return spl_load_image_ext(block_dev, partition, CONFIG_SPL_FS_LOAD_KERNEL_NAME); } +#else +int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition) +{ + return -ENOSYS; +} #endif #endif diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c index 350f7d9..0daadbe 100644 --- a/common/spl/spl_fat.c +++ b/common/spl/spl_fat.c @@ -13,6 +13,7 @@ #include #include #include +#include #include static int fat_registered; @@ -119,5 +120,10 @@ defaults: return spl_load_image_fat(block_dev, partition, CONFIG_SPL_FS_LOAD_KERNEL_NAME); } +#else +int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition) +{ + return -ENOSYS; +} #endif #endif diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index cfbda1a..f0c4d56 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -154,6 +154,15 @@ static int mmc_load_image_raw_os(struct mmc *mmc) return mmc_load_image_raw_sector(mmc, CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR); } +#else +int spl_start_uboot(void) +{ + return 1; +} +static int mmc_load_image_raw_os(struct mmc *mmc) +{ + return -ENOSYS; +} #endif void spl_mmc_load_image(void) @@ -179,13 +188,11 @@ void spl_mmc_load_image(void) case MMCSD_MODE_RAW: debug("spl: mmc boot mode: raw\n"); -#ifdef CONFIG_SPL_OS_BOOT if (!spl_start_uboot()) { err = mmc_load_image_raw_os(mmc); if (!err) return; } -#endif #if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION) err = mmc_load_image_raw_partition(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION); @@ -203,14 +210,12 @@ void spl_mmc_load_image(void) #ifdef CONFIG_SYS_MMCSD_FS_BOOT_PARTITION #ifdef CONFIG_SPL_FAT_SUPPORT -#ifdef CONFIG_SPL_OS_BOOT if (!spl_start_uboot()) { err = spl_load_image_fat_os(&mmc->block_dev, CONFIG_SYS_MMCSD_FS_BOOT_PARTITION); if (!err) return; } -#endif #ifdef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME err = spl_load_image_fat(&mmc->block_dev, CONFIG_SYS_MMCSD_FS_BOOT_PARTITION, @@ -220,14 +225,12 @@ void spl_mmc_load_image(void) #endif #endif #ifdef CONFIG_SPL_EXT_SUPPORT -#ifdef CONFIG_SPL_OS_BOOT if (!spl_start_uboot()) { err = spl_load_image_ext_os(&mmc->block_dev, CONFIG_SYS_MMCSD_FS_BOOT_PARTITION); if (!err) return; } -#endif #ifdef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME err = spl_load_image_ext(&mmc->block_dev, CONFIG_SYS_MMCSD_FS_BOOT_PARTITION, @@ -257,13 +260,11 @@ void spl_mmc_load_image(void) hang(); } -#ifdef CONFIG_SPL_OS_BOOT if (!spl_start_uboot()) { err = mmc_load_image_raw_os(mmc); if (!err) return; } -#endif #if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION) err = mmc_load_image_raw_partition(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION);