public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/6] spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option
Date: Wed, 8 Feb 2017 11:21:55 -0600	[thread overview]
Message-ID: <20170208172200.13640-2-afd@ti.com> (raw)
In-Reply-To: <20170208172200.13640-1-afd@ti.com>

CONFIG_SPL_ABORT_ON_RAW_IMAGE causes SPL to abort and move on when it
encounters RAW images, express this same functionality as a positive
option enabling support for RAW images: CONFIG_SPL_RAW_IMAGE_SUPPORT

Signed-off-by: Andrew F. Davis <afd@ti.com>
---
 Kconfig                           | 7 +++++++
 README                            | 4 ----
 common/spl/spl.c                  | 9 +++++----
 include/configs/imx6_spl.h        | 4 ++--
 include/configs/socfpga_de1_soc.h | 2 +-
 include/spl.h                     | 2 +-
 6 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/Kconfig b/Kconfig
index 8f9ea97f3d..8ce2d8c3bb 100644
--- a/Kconfig
+++ b/Kconfig
@@ -291,6 +291,13 @@ config SYS_TEXT_BASE
 	help
 	  TODO: Move CONFIG_SYS_TEXT_BASE for all the architecture
 
+config SPL_RAW_IMAGE_SUPPORT
+	bool "Support SPL loading and booting of RAW images"
+	default y
+	help
+	  SPL will support loading and booting a RAW image when this option
+	  is y. If this is not set, SPL will move on to other available
+	  boot media to find a suitable image.
 
 config SYS_CLK_FREQ
 	depends on ARC || ARCH_SUNXI
diff --git a/README b/README
index ecb1710d01..127c77c4e2 100644
--- a/README
+++ b/README
@@ -3298,10 +3298,6 @@ FIT uImage format:
 		consider that a completely unreadable NAND block is bad,
 		and thus should be skipped silently.
 
-		CONFIG_SPL_ABORT_ON_RAW_IMAGE
-		When defined, SPL will proceed to another boot method
-		if the image it has loaded does not have a signature.
-
 		CONFIG_SPL_RELOC_STACK
 		Adress of the start of the stack SPL will use after
 		relocation.  If unspecified, this is equal to
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 766fb3d6f4..d564d4d2a2 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -146,16 +146,17 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
 		}
 #endif
 
-#ifdef CONFIG_SPL_ABORT_ON_RAW_IMAGE
-		/* Signature not found, proceed to other boot methods. */
-		return -EINVAL;
-#else
+#ifdef CONFIG_SPL_RAW_IMAGE_SUPPORT
 		/* Signature not found - assume u-boot.bin */
 		debug("mkimage signature not found - ih_magic = %x\n",
 			header->ih_magic);
 		spl_set_header_raw_uboot(spl_image);
+#else
+		/* RAW image not supported, proceed to other boot methods. */
+		return -EINVAL;
 #endif
 	}
+
 	return 0;
 }
 
diff --git a/include/configs/imx6_spl.h b/include/configs/imx6_spl.h
index c5a035fccf..acaf81b6b9 100644
--- a/include/configs/imx6_spl.h
+++ b/include/configs/imx6_spl.h
@@ -45,14 +45,14 @@
 #if defined(CONFIG_SPL_MMC_SUPPORT)
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
 #define CONFIG_SYS_MONITOR_LEN			409600	/* 400 KB */
-#define CONFIG_SPL_ABORT_ON_RAW_IMAGE
+#undef CONFIG_SPL_RAW_IMAGE_SUPPORT
 #endif
 
 /* SATA support */
 #if defined(CONFIG_SPL_SATA_SUPPORT)
 #define CONFIG_SPL_SATA_BOOT_DEVICE		0
 #define CONFIG_SYS_SATA_FAT_BOOT_PARTITION	1
-#define CONFIG_SPL_ABORT_ON_RAW_IMAGE
+#undef CONFIG_SPL_RAW_IMAGE_SUPPORT
 #endif
 
 /* Define the payload for FAT/EXT support */
diff --git a/include/configs/socfpga_de1_soc.h b/include/configs/socfpga_de1_soc.h
index 5e7a712cf5..52d292b752 100644
--- a/include/configs/socfpga_de1_soc.h
+++ b/include/configs/socfpga_de1_soc.h
@@ -51,6 +51,6 @@
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 
-#define CONFIG_SPL_ABORT_ON_RAW_IMAGE
+#undef CONFIG_SPL_RAW_IMAGE_SUPPORT
 
 #endif	/* __CONFIG_TERASIC_DE1_SOC_H__ */
diff --git a/include/spl.h b/include/spl.h
index bde44374ea..270798c988 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -85,7 +85,7 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image);
  * This parses the legacy image header information at @header and sets up
  * @spl_image according to what is found. If no image header is found, then
  * a raw image or bootz is assumed. If CONFIG_SPL_PANIC_ON_RAW_IMAGE is
- * enabled, then this causes a panic. If CONFIG_SPL_ABORT_ON_RAW_IMAGE is
+ * enabled, then this causes a panic. If CONFIG_SPL_RAW_IMAGE_SUPPORT is not
  * enabled then U-Boot gives up. Otherwise U-Boot sets up the image using
  * spl_set_header_raw_uboot(), or possibly the bootz header.
  *
-- 
2.11.0

  reply	other threads:[~2017-02-08 17:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 17:21 [U-Boot] [PATCH v3 0/6] Allow disabling non-FIT image loading from SPL Andrew F. Davis
2017-02-08 17:21 ` Andrew F. Davis [this message]
2017-02-09  4:21   ` [U-Boot] [PATCH v3 1/6] spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option Lokesh Vutla
2017-02-10 18:38   ` Simon Glass
2017-02-10 19:58     ` Andrew F. Davis
2017-02-14  5:23       ` Simon Glass
2017-02-08 17:21 ` [U-Boot] [PATCH v3 2/6] spl: Add option to enable SPL Legacy image support Andrew F. Davis
2017-02-09  4:22   ` Lokesh Vutla
2017-02-09 14:52     ` Andrew F. Davis
2017-02-10 18:38   ` Simon Glass
2017-02-08 17:21 ` [U-Boot] [PATCH v3 3/6] ARM: AM335x: Disable non-FIT based image loading for HS devices Andrew F. Davis
2017-02-10 18:39   ` Simon Glass
2017-02-08 17:21 ` [U-Boot] [PATCH v3 4/6] ARM: AM43xx: " Andrew F. Davis
2017-02-10 18:39   ` Simon Glass
2017-02-08 17:21 ` [U-Boot] [PATCH v3 5/6] ARM: AM57xx: " Andrew F. Davis
2017-02-10 18:39   ` Simon Glass
2017-02-08 17:22 ` [U-Boot] [PATCH v3 6/6] ARM: DRA7xx: " Andrew F. Davis
2017-02-10 18:39   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170208172200.13640-2-afd@ti.com \
    --to=afd@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox