blob: 4a55248db86e25e955087373c4239d88fe642379 [file] [log] [blame]
Juan Castillod5f13092014-08-12 11:17:06 +01001/*
Antonio Nino Diaz0b326282017-02-16 16:17:19 +00002 * Copyright (c) 2014-2017, ARM Limited and Contributors. All rights reserved.
Juan Castillod5f13092014-08-12 11:17:06 +01003 *
dp-arm82cb2c12017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Juan Castillod5f13092014-08-12 11:17:06 +01005 */
6
7#include <stddef.h>
8#include <arch_helpers.h>
Soby Mathewb234b2c2015-01-15 11:49:49 +00009#include <assert.h>
Antonio Nino Diaz0b326282017-02-16 16:17:19 +000010#include <console.h>
Juan Castillod5f13092014-08-12 11:17:06 +010011#include <debug.h>
12#include <platform.h>
13#include "psci_private.h"
14
Etienne Carriereaa8d5f82017-06-07 16:42:42 +020015void __dead2 psci_system_off(void)
Juan Castillod5f13092014-08-12 11:17:06 +010016{
Soby Mathew67487842015-07-13 14:10:57 +010017 psci_print_power_domain_map();
Juan Castillod5f13092014-08-12 11:17:06 +010018
Soby Mathewb234b2c2015-01-15 11:49:49 +000019 assert(psci_plat_pm_ops->system_off);
20
Juan Castillod5f13092014-08-12 11:17:06 +010021 /* 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
Antonio Nino Diaz0b326282017-02-16 16:17:19 +000026 console_flush();
27
Juan Castillod5f13092014-08-12 11:17:06 +010028 /* 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
Etienne Carriereaa8d5f82017-06-07 16:42:42 +020034void __dead2 psci_system_reset(void)
Juan Castillod5f13092014-08-12 11:17:06 +010035{
Soby Mathew67487842015-07-13 14:10:57 +010036 psci_print_power_domain_map();
Juan Castillod5f13092014-08-12 11:17:06 +010037
Soby Mathewb234b2c2015-01-15 11:49:49 +000038 assert(psci_plat_pm_ops->system_reset);
39
Juan Castillod5f13092014-08-12 11:17:06 +010040 /* 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
Antonio Nino Diaz0b326282017-02-16 16:17:19 +000045 console_flush();
46
Juan Castillod5f13092014-08-12 11:17:06 +010047 /* 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}