imx233: print power up source in the bootloader
Change-Id: I9ff4738b7efdb25ab57b0061f60c7fde58b9a0b5
diff --git a/bootloader/imx233.c b/bootloader/imx233.c
index d808fc8..2380dfa 100644
--- a/bootloader/imx233.c
+++ b/bootloader/imx233.c
@@ -35,6 +35,7 @@
#include "disk.h"
#include "panic.h"
#include "power.h"
+#include "power-imx233.h"
#include "system-target.h"
#include "fmradio_i2c.h"
#include "version.h"
@@ -126,6 +127,7 @@
//button_debug_screen();
printf("Boot version: %s", RBVERSION);
printf("arg=%x addr=%x", arg, addr);
+ printf("power up source: %x", __XTRACT(HW_POWER_STS, PWRUP_SOURCE));
#ifdef SANSA_FUZEPLUS
extern void imx233_mmc_disable_window(void);
diff --git a/firmware/target/arm/imx233/power-imx233.h b/firmware/target/arm/imx233/power-imx233.h
index 3a2452c..b38f9e5 100644
--- a/firmware/target/arm/imx233/power-imx233.h
+++ b/firmware/target/arm/imx233/power-imx233.h
@@ -157,6 +157,8 @@
#define HW_POWER_STS__CHRGSTS (1 << 11)
#define HW_POWER_STS__PSWITCH_BP 20
#define HW_POWER_STS__PSWITCH_BM (3 << 20)
+#define HW_POWER_STS__PWRUP_SOURCE_BP 24
+#define HW_POWER_STS__PWRUP_SOURCE_BM (0x3f << 24)
#define HW_POWER_BATTMONITOR (*(volatile uint32_t *)(HW_POWER_BASE + 0xe0))
#define HW_POWER_BATTMONITOR__ENBATADJ (1 << 10)