blob: c9a40f5925dbe9c13324ba7aaaa9049f5480d690 [file] [log] [blame]
Stephan Gerhold14fdf072021-12-01 20:01:11 +01001/*
2 * Copyright (c) 2021, Stephan Gerhold <stephan@gerhold.net>
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch.h>
8#include <common/debug.h>
9#include <drivers/delay_timer.h>
10#include <lib/mmio.h>
11#include <lib/psci/psci.h>
12#include <plat/common/platform.h>
13
14#include <msm8916_mmap.h>
15
16static void __dead2 msm8916_system_reset(void)
17{
18 mmio_write_32(MPM_PS_HOLD, 0);
19 mdelay(1000);
20
21 ERROR("PSCI: System reset failed\n");
22 panic();
23}
24
25static const plat_psci_ops_t msm8916_psci_ops = {
26 .system_off = msm8916_system_reset,
27 .system_reset = msm8916_system_reset,
28};
29
30/* Defined and used in msm8916_helpers.S */
31extern uintptr_t msm8916_entry_point;
32
33int plat_setup_psci_ops(uintptr_t sec_entrypoint,
34 const plat_psci_ops_t **psci_ops)
35{
36 msm8916_entry_point = sec_entrypoint;
37 *psci_ops = &msm8916_psci_ops;
38 return 0;
39}