diff mbox

[U-Boot,V2,12/13] arm: mx6: cm-fx6: define fallback boot devices for spl

Message ID 1446024210-16517-13-git-send-email-nikita@compulab.co.il
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Nikita Kiryanov Oct. 28, 2015, 9:23 a.m. UTC
Use spl alternate boot device feature to define fallback to
the main boot device as it is defined by hardware.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@konsulko.com>
---
Changes in V2:
	- No changes.

 board/compulab/cm_fx6/spl.c | 19 ++++++++++---------
 include/configs/cm_fx6.h    |  1 -
 2 files changed, 10 insertions(+), 10 deletions(-)

Comments

Tom Rini Nov. 3, 2015, 3:57 p.m. UTC | #1
On Wed, Oct 28, 2015 at 11:23:29AM +0200, Nikita Kiryanov wrote:

> Use spl alternate boot device feature to define fallback to
> the main boot device as it is defined by hardware.
> 
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Tom Rini <trini@konsulko.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
Stefano Babic Nov. 4, 2015, 9:47 a.m. UTC | #2
On 28/10/2015 10:23, Nikita Kiryanov wrote:
> Use spl alternate boot device feature to define fallback to
> the main boot device as it is defined by hardware.
> 
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Tom Rini <trini@konsulko.com>
> ---
> Changes in V2:
> 	- No changes.
> 
>  board/compulab/cm_fx6/spl.c | 19 ++++++++++---------
>  include/configs/cm_fx6.h    |  1 -
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/board/compulab/cm_fx6/spl.c b/board/compulab/cm_fx6/spl.c
> index d94ced9..d8328fd 100644
> --- a/board/compulab/cm_fx6/spl.c
> +++ b/board/compulab/cm_fx6/spl.c
> @@ -337,16 +337,17 @@ void board_init_f(ulong dummy)
>  	board_init_r(NULL, 0);
>  }
>  
> -void spl_board_init(void)
> +void board_boot_order(u32 *spl_boot_list)
>  {
> -	u32 boot_device = spl_boot_device();
> -
> -	if (boot_device == BOOT_DEVICE_SPI)
> -		puts("Booting from SPI flash\n");
> -	else if (boot_device == BOOT_DEVICE_MMC1)
> -		puts("Booting from MMC\n");
> -	else
> -		puts("Unknown boot device\n");
> +	spl_boot_list[0] = spl_boot_device();
> +	switch (spl_boot_list[0]) {
> +	case BOOT_DEVICE_SPI:
> +		spl_boot_list[1] = BOOT_DEVICE_MMC1;
> +		break;
> +	case BOOT_DEVICE_MMC1:
> +		spl_boot_list[1] = BOOT_DEVICE_SPI;
> +		break;
> +	}
>  }
>  
>  #ifdef CONFIG_SPL_MMC_SUPPORT
> diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
> index 0513204..180ea28 100644
> --- a/include/configs/cm_fx6.h
> +++ b/include/configs/cm_fx6.h
> @@ -230,7 +230,6 @@
>  
>  /* SPL */
>  #include "imx6_spl.h"
> -#define CONFIG_SPL_BOARD_INIT
>  #define CONFIG_SPL_MMC_SUPPORT
>  #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	0x80 /* offset 64 kb */
>  #define CONFIG_SYS_MONITOR_LEN	(CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS / 2 * 1024)
> 

Reviewed-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/board/compulab/cm_fx6/spl.c b/board/compulab/cm_fx6/spl.c
index d94ced9..d8328fd 100644
--- a/board/compulab/cm_fx6/spl.c
+++ b/board/compulab/cm_fx6/spl.c
@@ -337,16 +337,17 @@  void board_init_f(ulong dummy)
 	board_init_r(NULL, 0);
 }
 
-void spl_board_init(void)
+void board_boot_order(u32 *spl_boot_list)
 {
-	u32 boot_device = spl_boot_device();
-
-	if (boot_device == BOOT_DEVICE_SPI)
-		puts("Booting from SPI flash\n");
-	else if (boot_device == BOOT_DEVICE_MMC1)
-		puts("Booting from MMC\n");
-	else
-		puts("Unknown boot device\n");
+	spl_boot_list[0] = spl_boot_device();
+	switch (spl_boot_list[0]) {
+	case BOOT_DEVICE_SPI:
+		spl_boot_list[1] = BOOT_DEVICE_MMC1;
+		break;
+	case BOOT_DEVICE_MMC1:
+		spl_boot_list[1] = BOOT_DEVICE_SPI;
+		break;
+	}
 }
 
 #ifdef CONFIG_SPL_MMC_SUPPORT
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 0513204..180ea28 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -230,7 +230,6 @@ 
 
 /* SPL */
 #include "imx6_spl.h"
-#define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_MMC_SUPPORT
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	0x80 /* offset 64 kb */
 #define CONFIG_SYS_MONITOR_LEN	(CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS / 2 * 1024)