]> git.ipfire.org Git - people/ms/u-boot.git/blob - arch/arm/mach-imx/mx7/psci.S
imx: mx7: psci: add system power off support
[people/ms/u-boot.git] / arch / arm / mach-imx / mx7 / psci.S
1 /*
2 * Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
3 * Copyright 2017 NXP
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8 #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
19 .globl psci_cpu_on
20 psci_cpu_on:
21 push {r4, r5, lr}
22
23 mov r4, r0
24 mov r5, r1
25 mov r0, r1
26 mov r1, r2
27 bl psci_save_target_pc
28
29 mov r0, r4
30 mov r1, r5
31 ldr r2, =psci_cpu_entry
32 bl imx_cpu_on
33
34 pop {r4, r5, pc}
35
36 .globl psci_cpu_off
37 psci_cpu_off:
38
39 bl psci_cpu_off_common
40 bl psci_get_cpu_id
41 bl imx_cpu_off
42
43 1: wfi
44 b 1b
45
46 .globl psci_system_reset
47 psci_system_reset:
48 bl imx_system_reset
49
50 2: wfi
51 b 2b
52
53 .globl psci_system_off
54 psci_system_off:
55 bl imx_system_off
56
57 3: wfi
58 b 3b
59
60 .popsection