blob: 89dcf880e89bf6fccd6b31081e44808746f6f882 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Peng Fand8c75bc2017-08-17 17:48:50 +08002/*
3 * Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
4 * Copyright 2017 NXP
Peng Fand8c75bc2017-08-17 17:48:50 +08005 */
6
Peng Fanfcd53ce2015-10-23 10:13:04 +08007#include <config.h>
8#include <linux/linkage.h>
9
10#include <asm/armv7.h>
11#include <asm/arch-armv7/generictimer.h>
12#include <asm/psci.h>
13
14 .pushsection ._secure.text, "ax"
15
16 .arch_extension sec
17
Peng Fanfcd53ce2015-10-23 10:13:04 +080018.globl psci_cpu_on
19psci_cpu_on:
Chen-Yu Tsai6e147952016-06-19 12:38:44 +080020 push {r4, r5, lr}
Peng Fanfcd53ce2015-10-23 10:13:04 +080021
Chen-Yu Tsai6e147952016-06-19 12:38:44 +080022 mov r4, r0
23 mov r5, r1
Peng Fanfcd53ce2015-10-23 10:13:04 +080024 mov r0, r1
Chen-Yu Tsai6e147952016-06-19 12:38:44 +080025 mov r1, r2
Patrick Delaunay68975f22018-04-16 10:15:08 +020026 mov r2, r3
27 bl psci_save
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
Anson Huangf20bc132018-01-07 14:34:31 +080046.globl psci_system_reset
47psci_system_reset:
48 bl imx_system_reset
49
502: wfi
51 b 2b
52
Anson Huangf46fb182018-01-07 14:34:32 +080053.globl psci_system_off
54psci_system_off:
55 bl imx_system_off
56
573: wfi
58 b 3b
59
Peng Fanfcd53ce2015-10-23 10:13:04 +080060 .popsection