summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Marczak <p.marczak@samsung.com>2014-03-21 11:48:54 +0100
committerPrzemyslaw Marczak <p.marczak@samsung.com>2015-05-18 11:29:13 +0200
commite582fa54a7f2daefd03e4378407d028678e8825c (patch)
tree61d71ea518ac3e3e71f915380a39fb04d49f2f18
parente4fd32f2c972490324ce4c023ce0b6b8d3dc9ad5 (diff)
downloadu-boot-e582fa54a7f2daefd03e4378407d028678e8825c.tar.gz
u-boot-e582fa54a7f2daefd03e4378407d028678e8825c.tar.bz2
u-boot-e582fa54a7f2daefd03e4378407d028678e8825c.zip
trats2: add implementation of board_poweroff() and CONFIG_CMD_POWEROFF
This change adds implementation of function board_poweroff() which turns off the device off by setting PSHOLD gpio to low state which is a power off signal for main PMIC. Change-Id: Iae97fb81d7e7e243079ac18d03f4fd917c50b62e Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
-rw-r--r--board/samsung/trats2/trats2.c17
-rw-r--r--include/configs/trats2.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
index a7377497e5..03f1d7d68b 100644
--- a/board/samsung/trats2/trats2.c
+++ b/board/samsung/trats2/trats2.c
@@ -431,3 +431,20 @@ void exynos_lcd_misc_init(vidinfo_t *vid)
#endif
}
#endif /* LCD */
+
+#ifdef CONFIG_CMD_POWEROFF
+void board_poweroff(void)
+{
+ unsigned int val;
+ struct exynos4x12_power *power =
+ (struct exynos4x12_power *)samsung_get_base_power();
+
+ val = readl(&power->ps_hold_control);
+ val |= EXYNOS_PS_HOLD_CONTROL_EN_OUTPUT; /* set to output */
+ val &= ~EXYNOS_PS_HOLD_CONTROL_DATA_HIGH; /* set state to low */
+ writel(val, &power->ps_hold_control);
+
+ while (1);
+ /* Should not reach here */
+}
+#endif
diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index 95f2195765..4ba98a0a66 100644
--- a/include/configs/trats2.h
+++ b/include/configs/trats2.h
@@ -197,6 +197,7 @@ int get_soft_i2c_sda_pin(void);
#define CONFIG_POWER_MUIC_MAX77693
#define CONFIG_POWER_FG_MAX77693
#define CONFIG_POWER_BATTERY_TRATS2
+#define CONFIG_CMD_POWEROFF
/* Security subsystem - enable hw_rand() */
#define CONFIG_EXYNOS_ACE_SHA