From 245f5aef185e72d46bedccfcacc549f84dcd4e47 Mon Sep 17 00:00:00 2001 From: Inha Song Date: Mon, 4 Nov 2013 11:02:33 +0900 Subject: [PATCH] samsung: boot inform: add boot_inform_clear() to reset inform registers 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 Signed-off-by: Przemyslaw Marczak --- board/samsung/common/Makefile | 2 +- board/samsung/common/inform.c | 17 +++++++++++++++++ drivers/usb/gadget/f_thor.c | 4 ++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 board/samsung/common/inform.c diff --git a/board/samsung/common/Makefile b/board/samsung/common/Makefile index 7d2bb8c..52ccc84 100644 --- a/board/samsung/common/Makefile +++ b/board/samsung/common/Makefile @@ -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 index 0000000..4754e0d --- /dev/null +++ b/board/samsung/common/inform.c @@ -0,0 +1,17 @@ +#include +#include + +#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); +} + diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c index 02a670d..7845118 100644 --- a/drivers/usb/gadget/f_thor.c +++ b/drivers/usb/gadget/f_thor.c @@ -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: -- 2.7.4