trats2: add implementation of board_poweroff() and CONFIG_CMD_POWEROFF
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Fri, 21 Mar 2014 10:48:54 +0000 (11:48 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 10 Oct 2019 04:38:35 +0000 (13:38 +0900)
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>
board/samsung/trats2/trats2.c

index 84ff936..9858150 100644 (file)
@@ -334,3 +334,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