blob: fc5eb34c8890a20271579953836020dae067884a [file] [log] [blame]
Peng Fand8c75bc2017-08-17 17:48:50 +08001/*
2 * Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
3 * Copyright 2017 NXP
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
Peng Fanfcd53ce2015-10-23 10:13:04 +08008#include <config.h>
9#include <linux/linkage.h>
10
11#include <asm/armv7.h>
12#include <asm/arch-armv7/generictimer.h>
13#include <asm/psci.h>
14
15 .pushsection ._secure.text, "ax"
16
17 .arch_extension sec
18
Peng Fanfcd53ce2015-10-23 10:13:04 +080019.globl psci_cpu_on
20psci_cpu_on:
Chen-Yu Tsai6e147952016-06-19 12:38:44 +080021 push {r4, r5, lr}
Peng Fanfcd53ce2015-10-23 10:13:04 +080022
Chen-Yu Tsai6e147952016-06-19 12:38:44 +080023 mov r4, r0
24 mov r5, r1
Peng Fanfcd53ce2015-10-23 10:13:04 +080025 mov r0, r1
Chen-Yu Tsai6e147952016-06-19 12:38:44 +080026 mov r1, r2
27 bl psci_save_target_pc
Peng Fanfcd53ce2015-10-23 10:13:04 +080028
Chen-Yu Tsai6e147952016-06-19 12:38:44 +080029 mov r0, r4
30 mov r1, r5
Peng Fanfcd53ce2015-10-23 10:13:04 +080031 ldr r2, =psci_cpu_entry
32 bl imx_cpu_on
33
Chen-Yu Tsai6e147952016-06-19 12:38:44 +080034 pop {r4, r5, pc}
Peng Fanfcd53ce2015-10-23 10:13:04 +080035
36.globl psci_cpu_off
37psci_cpu_off:
38
39 bl psci_cpu_off_common
40 bl psci_get_cpu_id
41 bl imx_cpu_off
42
431: wfi
44 b 1b
45
Peng Fanfcd53ce2015-10-23 10:13:04 +080046 .popsection