samsung: boot inform: add boot_inform_clear() to reset inform registers
authorInha Song <ideal.song@samsung.com>
Mon, 4 Nov 2013 02:02:33 +0000 (11:02 +0900)
committerLukasz Majewski <l.majewski@samsung.com>
Tue, 18 Mar 2014 15:49:00 +0000 (16:49 +0100)
Changes:
- define boot_inform_clear() in board/samsung/common/inform.c
- gadget thor: call boot_infor_clear() on RQT_CMD_REBOOT

Change-Id: I0c41734828718fe9c1e0aa59c44968a0560fdf78
Signed-off-by: Inha Song <ideal.song@samsung.com>
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
board/samsung/common/Makefile
board/samsung/common/inform.c [new file with mode: 0644]
drivers/usb/gadget/f_thor.c

index 7d2bb8c..52ccc84 100644 (file)
@@ -4,7 +4,7 @@
 #
 # SPDX-License-Identifier:     GPL-2.0+
 #
-
+obj-$(CONFIG_BOOT_INFORM) = inform.o
 obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
 obj-$(CONFIG_THOR_FUNCTION) += thor.o
 obj-$(CONFIG_CMD_USB_MASS_STORAGE) += ums.o
diff --git a/board/samsung/common/inform.c b/board/samsung/common/inform.c
new file mode 100644 (file)
index 0000000..4754e0d
--- /dev/null
@@ -0,0 +1,17 @@
+#include <common.h>
+#include <asm/arch/power.h>
+
+#define        CONFIG_NORMAL_INFORM    0x12345678
+
+void boot_inform_clear(void)
+{
+       struct exynos4_power *power =
+               (struct exynos4_power *)samsung_get_base_power();
+
+       /* clear INFORM3 - reset status */
+       writel(0, &power->inform3);
+
+       /* set INFORM2 for normal boot */
+       writel(CONFIG_NORMAL_INFORM, &power->inform2);
+}
+
index 02a670d..7845118 100644 (file)
@@ -131,6 +131,10 @@ static int process_rqt_cmd(const struct rqt_box *rqt)
                g_dnl_unregister();
                dfu_free_entities();
 
+#ifdef CONFIG_BOOT_INFORM
+               /* set normal boot */
+               boot_inform_clear();
+#endif
                run_command("reset", 0);
                break;
        case RQT_CMD_POWEROFF: