* [U-Boot] [PATCH] EXYNOS: Add API for power reset and shutdown
@ 2013-04-04 7:06 Rajeshwari Shinde
2013-06-24 5:42 ` Minkyu Kang
0 siblings, 1 reply; 2+ messages in thread
From: Rajeshwari Shinde @ 2013-04-04 7:06 UTC (permalink / raw)
To: u-boot
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@chromium.org>
Signed-off-by: Rajeshwari Shinde <rajeshwari.s@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] EXYNOS: Add API for power reset and shutdown
2013-04-04 7:06 [U-Boot] [PATCH] EXYNOS: Add API for power reset and shutdown Rajeshwari Shinde
@ 2013-06-24 5:42 ` Minkyu Kang
0 siblings, 0 replies; 2+ messages in thread
From: Minkyu Kang @ 2013-06-24 5:42 UTC (permalink / raw)
To: u-boot
Dear Rajeshwari Shinde,
On 04/04/13 16:06, Rajeshwari Shinde wrote:
> 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@chromium.org>
> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@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)
> }
>
I know that is not related your patch.
But, please remove blank line.
>
> +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);
> +}
This function is same purpose with set_ps_hold_ctrl.
So please, add it to set_ps_hold_ctrl.
> +
> +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)
swreset?
> +{
> + if (cpu_is_exynos5())
> + exynos5_power_reset();
> +}
please move this function under the exynos5_power_reset.
or move exynos5_power_reset to here.
> 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.
> + */
please check comment rule.
One line comment should be.. /* .... */
> +void power_reset(void);
> #endif
>
Thanks,
Minkyu Kang.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-24 5:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 7:06 [U-Boot] [PATCH] EXYNOS: Add API for power reset and shutdown Rajeshwari Shinde
2013-06-24 5:42 ` Minkyu Kang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox