diff mbox

[U-Boot,v2,2/3] arm: spl: Provide for a board-specific loader

Message ID 1423331250-8040-2-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Hans de Goede
Headers show

Commit Message

Simon Glass Feb. 7, 2015, 5:47 p.m. UTC
Some boards have a special way of loading U-Boot that does not fit with
the existing SPL code. For example sunxi uses an 'FEL' mode where U-Boot
is loaded over USB. Add a CONFIG option and boot mode for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 arch/arm/include/asm/spl.h | 4 ++++
 common/spl/spl.c           | 5 +++++
 2 files changed, 9 insertions(+)

Comments

Siarhei Siamashka Feb. 8, 2015, 3:44 a.m. UTC | #1
On Sat,  7 Feb 2015 10:47:29 -0700
Simon Glass <sjg@chromium.org> wrote:

> Some boards have a special way of loading U-Boot that does not fit with
> the existing SPL code. For example sunxi uses an 'FEL' mode where U-Boot
> is loaded over USB. Add a CONFIG option and boot mode for this.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> Changes in v2: None
> 
>  arch/arm/include/asm/spl.h | 4 ++++
>  common/spl/spl.c           | 5 +++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h
> index 8acd7cd..17b6f54 100644
> --- a/arch/arm/include/asm/spl.h
> +++ b/arch/arm/include/asm/spl.h
> @@ -26,10 +26,14 @@ enum {
>  	BOOT_DEVICE_SPI,
>  	BOOT_DEVICE_SATA,
>  	BOOT_DEVICE_I2C,
> +	BOOT_DEVICE_BOARD,
>  	BOOT_DEVICE_NONE
>  };
>  #endif
>  
> +/* Board-specific load method */
> +void spl_board_load_image(void);
> +
>  /* Linker symbols. */
>  extern char __bss_start[], __bss_end[];
>  
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index daaeb50..ded0f30 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -229,6 +229,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>  		spl_sata_load_image();
>  		break;
>  #endif
> +#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE
> +	case BOOT_DEVICE_BOARD:
> +		spl_board_load_image();
> +		break;
> +#endif
>  	default:
>  #if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
>  		puts("SPL: Unsupported Boot Device!\n");

Acked-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
diff mbox

Patch

diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h
index 8acd7cd..17b6f54 100644
--- a/arch/arm/include/asm/spl.h
+++ b/arch/arm/include/asm/spl.h
@@ -26,10 +26,14 @@  enum {
 	BOOT_DEVICE_SPI,
 	BOOT_DEVICE_SATA,
 	BOOT_DEVICE_I2C,
+	BOOT_DEVICE_BOARD,
 	BOOT_DEVICE_NONE
 };
 #endif
 
+/* Board-specific load method */
+void spl_board_load_image(void);
+
 /* Linker symbols. */
 extern char __bss_start[], __bss_end[];
 
diff --git a/common/spl/spl.c b/common/spl/spl.c
index daaeb50..ded0f30 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -229,6 +229,11 @@  void board_init_r(gd_t *dummy1, ulong dummy2)
 		spl_sata_load_image();
 		break;
 #endif
+#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE
+	case BOOT_DEVICE_BOARD:
+		spl_board_load_image();
+		break;
+#endif
 	default:
 #if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 		puts("SPL: Unsupported Boot Device!\n");