[U-Boot] [PATCH] EXYNOS: Add API for power reset and shutdown

Rajeshwari Shinde rajeshwari.s at samsung.com
Thu Apr 4 09:06:05 CEST 2013


This patch adds API's to reset and shutdown the power of
EXYNOS boards
power_shutdown: powers off the board by deasserting PS_HOLD pin.
power_reset: this function software resets the Exynos board when called.

Signed-off-by: Che-Liang Chiou <clchiou at chromium.org>
Signed-off-by: Rajeshwari Shinde <rajeshwari.s at samsung.com>
---
 arch/arm/cpu/armv7/exynos/power.c        |   31 ++++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-exynos/power.h |   10 +++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/power.c b/arch/arm/cpu/armv7/exynos/power.c
index 6375a81..2b65bbe 100644
--- a/arch/arm/cpu/armv7/exynos/power.c
+++ b/arch/arm/cpu/armv7/exynos/power.c
@@ -113,6 +113,25 @@ void set_ps_hold_ctrl(void)
 }
 
 
+void exynos5_power_shutdown(void)
+{
+	struct exynos5_power *power =
+		(struct exynos5_power *)samsung_get_base_power();
+
+	clrbits_le32(&power->ps_hold_control, EXYNOS_PS_HOLD_CONTROL_DATA_HIGH);
+}
+
+void exynos5_power_reset(void)
+{
+	struct exynos5_power *power =
+		(struct exynos5_power *)samsung_get_base_power();
+
+	/* Clear inform1 so there's no change we think we've got a wake reset */
+	power->inform1 = 0;
+
+	setbits_le32(&power->swreset, 1);
+}
+
 static void exynos5_set_xclkout(void)
 {
 	struct exynos5_power *power =
@@ -140,3 +159,15 @@ void set_hw_thermal_trip(void)
 		setbits_le32(&power->ps_hold_control, POWER_ENABLE_HW_TRIP);
 	}
 }
+
+void power_shutdown(void)
+{
+	if (cpu_is_exynos5())
+		exynos5_power_shutdown();
+}
+
+void power_reset(void)
+{
+	if (cpu_is_exynos5())
+		exynos5_power_reset();
+}
diff --git a/arch/arm/include/asm/arch-exynos/power.h b/arch/arm/include/asm/arch-exynos/power.h
index 3549667..6844e0f 100644
--- a/arch/arm/include/asm/arch-exynos/power.h
+++ b/arch/arm/include/asm/arch-exynos/power.h
@@ -888,4 +888,14 @@ void set_ps_hold_ctrl(void);
  * source as XXTI
  */
 void set_xclkout(void);
+
+/*
+ * Power off the system; it should never return.
+ */
+void power_shutdown(void);
+
+/*
+ * Perform a software reset.
+ */
+void power_reset(void);
 #endif
-- 
1.7.4.4



More information about the U-Boot mailing list