diff mbox series

zynq/spl: Explain unsupported boot mode more

Message ID 20200123082838.23421-1-oliver@schinagl.nl
State Deferred
Delegated to: Michal Simek
Headers show
Series zynq/spl: Explain unsupported boot mode more | expand

Commit Message

Olliver Schinagl Jan. 23, 2020, 8:28 a.m. UTC
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@schinagl.nl>
---
 arch/arm/mach-zynq/spl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

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();
 	}