diff mbox

[U-Boot,031/172] arm: socfpga: misc: Add support for printing boot mode

Message ID 1438030335-10631-32-git-send-email-marex@denx.de
State Accepted
Delegated to: Marek Vasut
Headers show

Commit Message

Marek Vasut July 27, 2015, 8:49 p.m. UTC
Add support for printing from which device the SoCFPGA board booted.
This decodes the BSEL settings and prints it in human readable form.

Signed-off-by: Marek Vasut <marex@denx.de>
---
 arch/arm/mach-socfpga/misc.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox

Patch

diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
index 5175195..3982c29 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -100,12 +100,25 @@  int cpu_mmc_init(bd_t *bis)
 #endif
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
+const char * const bsel_str[] = {
+	"Reserved",
+	"FPGA (HPS2FPGA Bridge)",
+	"NAND Flash (1.8V)",
+	"NAND Flash (3.0V)",
+	"SD/MMC External Transceiver (1.8V)",
+	"SD/MMC Internal Transceiver (3.0V)",
+	"QSPI Flash (1.8V)",
+	"QSPI Flash (3.0V)",
+};
+
 /*
  * Print CPU information
  */
 int print_cpuinfo(void)
 {
+	const u32 bsel = readl(&sysmgr_regs->bootinfo) & 0x7;
 	puts("CPU:   Altera SoCFPGA Platform\n");
+	printf("BOOT:  %s\n", bsel_str[bsel]);
 	return 0;
 }
 #endif