Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Peng Fan | d8c75bc | 2017-08-17 17:48:50 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. |
| 4 | * Copyright 2017 NXP |
Peng Fan | d8c75bc | 2017-08-17 17:48:50 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
Peng Fan | fcd53ce | 2015-10-23 10:13:04 +0800 | [diff] [blame] | 7 | #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 Fan | fcd53ce | 2015-10-23 10:13:04 +0800 | [diff] [blame] | 18 | .globl psci_cpu_on |
| 19 | psci_cpu_on: |
Chen-Yu Tsai | 6e14795 | 2016-06-19 12:38:44 +0800 | [diff] [blame] | 20 | push {r4, r5, lr} |
Peng Fan | fcd53ce | 2015-10-23 10:13:04 +0800 | [diff] [blame] | 21 | |
Chen-Yu Tsai | 6e14795 | 2016-06-19 12:38:44 +0800 | [diff] [blame] | 22 | mov r4, r0 |
| 23 | mov r5, r1 |
Peng Fan | fcd53ce | 2015-10-23 10:13:04 +0800 | [diff] [blame] | 24 | mov r0, r1 |
Chen-Yu Tsai | 6e14795 | 2016-06-19 12:38:44 +0800 | [diff] [blame] | 25 | mov r1, r2 |
Patrick Delaunay | 68975f2 | 2018-04-16 10:15:08 +0200 | [diff] [blame] | 26 | mov r2, r3 |
| 27 | bl psci_save |
Peng Fan | fcd53ce | 2015-10-23 10:13:04 +0800 | [diff] [blame] | 28 | |
Chen-Yu Tsai | 6e14795 | 2016-06-19 12:38:44 +0800 | [diff] [blame] | 29 | mov r0, r4 |
| 30 | mov r1, r5 |
Peng Fan | fcd53ce | 2015-10-23 10:13:04 +0800 | [diff] [blame] | 31 | ldr r2, =psci_cpu_entry |
| 32 | bl imx_cpu_on |
| 33 | |
Chen-Yu Tsai | 6e14795 | 2016-06-19 12:38:44 +0800 | [diff] [blame] | 34 | pop {r4, r5, pc} |
Peng Fan | fcd53ce | 2015-10-23 10:13:04 +0800 | [diff] [blame] | 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 | |
Anson Huang | f20bc13 | 2018-01-07 14:34:31 +0800 | [diff] [blame] | 46 | .globl psci_system_reset |
| 47 | psci_system_reset: |
| 48 | bl imx_system_reset |
| 49 | |
| 50 | 2: wfi |
| 51 | b 2b |
| 52 | |
Anson Huang | f46fb18 | 2018-01-07 14:34:32 +0800 | [diff] [blame] | 53 | .globl psci_system_off |
| 54 | psci_system_off: |
| 55 | bl imx_system_off |
| 56 | |
| 57 | 3: wfi |
| 58 | b 3b |
| 59 | |
Peng Fan | fcd53ce | 2015-10-23 10:13:04 +0800 | [diff] [blame] | 60 | .popsection |