[PATCH] zynq/spl: Explain unsupported boot mode more

Olliver Schinagl oliver at schinagl.nl
Thu Jan 23 09:28:38 CET 2020


When hit with an 'unsupported boot mode' error, a user would be happy to
know more, or the why. What boot mode is being tried. Was it as
expected. Since we know the selected boot mode at the point of failure,
lets print it so we have a better chance at figuring out what went
wrong.

Signed-off-by: Olliver Schinagl <oliver at schinagl.nl>
---
 arch/arm/mach-zynq/spl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-zynq/spl.c b/arch/arm/mach-zynq/spl.c
index 96ba90fb7a..4cc0324ba6 100644
--- a/arch/arm/mach-zynq/spl.c
+++ b/arch/arm/mach-zynq/spl.c
@@ -40,8 +40,10 @@ void spl_board_init(void)
 u32 spl_boot_device(void)
 {
 	u32 mode;
+	u8 boot_mode;
 
-	switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
+	boot_mode = (zynq_slcr_get_boot_mode() & ZYNQ_BM_MASK);
+	switch (boot_mode) {
 #ifdef CONFIG_SPL_SPI_SUPPORT
 	case ZYNQ_BM_QSPI:
 		puts("qspi boot\n");
@@ -64,7 +66,7 @@ u32 spl_boot_device(void)
 		mode = BOOT_DEVICE_RAM;
 		break;
 	default:
-		puts("Unsupported boot mode selected\n");
+		printf("Unsupported boot mode selected: 0x%x.\n", boot_mode);
 		hang();
 	}
 
-- 
2.20.1



More information about the U-Boot mailing list