Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Hongbo Zhang | 4f6e610 | 2016-07-21 18:09:38 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2016 NXP Semiconductor. |
| 4 | * Author: Wang Dongsheng <dongsheng.wang@freescale.com> |
Hongbo Zhang | 4f6e610 | 2016-07-21 18:09:38 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <config.h> |
| 8 | #include <linux/linkage.h> |
| 9 | |
| 10 | #include <asm/armv7.h> |
| 11 | #include <asm/psci.h> |
| 12 | |
| 13 | .pushsection ._secure.text, "ax" |
| 14 | |
| 15 | .arch_extension sec |
| 16 | |
| 17 | .align 5 |
| 18 | |
| 19 | .globl psci_system_off |
| 20 | psci_system_off: |
| 21 | @ Get QIXIS base address |
| 22 | movw r1, #(QIXIS_BASE & 0xffff) |
| 23 | movt r1, #(QIXIS_BASE >> 16) |
| 24 | |
| 25 | ldrb r2, [r1, #QIXIS_PWR_CTL] |
| 26 | orr r2, r2, #QIXIS_PWR_CTL_POWEROFF |
| 27 | strb r2, [r1, #QIXIS_PWR_CTL] |
| 28 | |
| 29 | 1: wfi |
| 30 | b 1b |
| 31 | |
| 32 | .popsection |