xref: /rk3399_ARM-atf/lib/psci/psci_system_off.c (revision aa8d5f88e04ba6211e345ab7a3864e2d9fec682e)
1 /*
2  * Copyright (c) 2014-2017, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <stddef.h>
8 #include <arch_helpers.h>
9 #include <assert.h>
10 #include <console.h>
11 #include <debug.h>
12 #include <platform.h>
13 #include "psci_private.h"
14 
15 void __dead2 psci_system_off(void)
16 {
17 	psci_print_power_domain_map();
18 
19 	assert(psci_plat_pm_ops->system_off);
20 
21 	/* Notify the Secure Payload Dispatcher */
22 	if (psci_spd_pm && psci_spd_pm->svc_system_off) {
23 		psci_spd_pm->svc_system_off();
24 	}
25 
26 	console_flush();
27 
28 	/* Call the platform specific hook */
29 	psci_plat_pm_ops->system_off();
30 
31 	/* This function does not return. We should never get here */
32 }
33 
34 void __dead2 psci_system_reset(void)
35 {
36 	psci_print_power_domain_map();
37 
38 	assert(psci_plat_pm_ops->system_reset);
39 
40 	/* Notify the Secure Payload Dispatcher */
41 	if (psci_spd_pm && psci_spd_pm->svc_system_reset) {
42 		psci_spd_pm->svc_system_reset();
43 	}
44 
45 	console_flush();
46 
47 	/* Call the platform specific hook */
48 	psci_plat_pm_ops->system_reset();
49 
50 	/* This function does not return. We should never get here */
51 }
52