From: Tim Harvey Date: Fri, 8 May 2015 18:28:25 -0700 Subject: [U-Boot] [PATCH 02/19] imx: ventana: display SPL boot device In-Reply-To: <1431134922-2535-1-git-send-email-tharvey@gateworks.com> References: <1431134922-2535-1-git-send-email-tharvey@gateworks.com> Message-ID: <1431134922-2535-3-git-send-email-tharvey@gateworks.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Display what device the SPL will fetch uboot.img from Signed-off-by: Tim Harvey --- board/gateworks/gw_ventana/gw_ventana_spl.c | 22 ++++++++++++++++++++++ include/configs/gw_ventana.h | 1 + 2 files changed, 23 insertions(+) diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c index 289a0b8..8fe0cae 100644 --- a/board/gateworks/gw_ventana/gw_ventana_spl.c +++ b/board/gateworks/gw_ventana/gw_ventana_spl.c @@ -570,6 +570,28 @@ void board_init_f(ulong dummy) board_init_r(NULL, 0); } +/* called from board_init_r after gd setup if CONFIG_SPL_BOARD_INIT defined */ +/* its our chance to print info about boot device */ +void spl_board_init(void) +{ + /* determine boot device from SRC_SBMR1 (BOOT_CFG[4:1]) or SRC_GPR9 */ + u32 boot_device = spl_boot_device(); + + switch (boot_device) { + case BOOT_DEVICE_MMC1: + puts("Booting from MMC\n"); + break; + case BOOT_DEVICE_NAND: + puts("Booting from NAND\n"); + break; + case BOOT_DEVICE_SATA: + puts("Booting from SATA\n"); + break; + default: + puts("Unknown boot device\n"); + } +} + void reset_cpu(ulong addr) { } diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h index 48919e8..dfe818e 100644 --- a/include/configs/gw_ventana.h +++ b/include/configs/gw_ventana.h @@ -8,6 +8,7 @@ #define __CONFIG_H /* SPL */ +#define CONFIG_SPL_BOARD_INIT #define CONFIG_SPL_NAND_SUPPORT #define CONFIG_SPL_MMC_SUPPORT #define CONFIG_SPL_FAT_SUPPORT -- 1.9.1