Hai Pham | d3cf5c6 | 2020-10-27 19:06:51 +0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
Marek Vasut | 0fdbdfc | 2024-12-12 14:36:09 +0100 | [diff] [blame^] | 3 | * This file implements basic PSCI support for Renesas R-Car 64bit SoCs |
Hai Pham | d3cf5c6 | 2020-10-27 19:06:51 +0700 | [diff] [blame] | 4 | * |
| 5 | * Copyright (C) 2020 Renesas Electronics Corp. |
Hai Pham | d3cf5c6 | 2020-10-27 19:06:51 +0700 | [diff] [blame] | 6 | */ |
| 7 | |
Hai Pham | d3cf5c6 | 2020-10-27 19:06:51 +0700 | [diff] [blame] | 8 | #include <asm/io.h> |
| 9 | #include <asm/psci.h> |
| 10 | #include <asm/secure.h> |
| 11 | |
| 12 | int __secure psci_features(u32 function_id, u32 psci_fid) |
| 13 | { |
| 14 | switch (psci_fid) { |
| 15 | case ARM_PSCI_0_2_FN_PSCI_VERSION: |
| 16 | case ARM_PSCI_0_2_FN_SYSTEM_RESET: |
| 17 | return 0x0; |
| 18 | } |
| 19 | /* case ARM_PSCI_0_2_FN_CPU_ON: */ |
| 20 | /* case ARM_PSCI_0_2_FN_CPU_OFF: */ |
| 21 | /* case ARM_PSCI_0_2_FN_AFFINITY_INFO: */ |
| 22 | /* case ARM_PSCI_0_2_FN_MIGRATE_INFO_TYPE: */ |
| 23 | /* case ARM_PSCI_0_2_FN_SYSTEM_OFF: */ |
| 24 | return ARM_PSCI_RET_NI; |
| 25 | } |
| 26 | |
| 27 | u32 __secure psci_version(void) |
| 28 | { |
| 29 | return ARM_PSCI_VER_0_2; |
| 30 | } |
| 31 | |
| 32 | #define RST_BASE 0xE6160000 /* Domain0 */ |
| 33 | #define RST_SRESCR0 (RST_BASE + 0x18) |
| 34 | #define RST_SPRES 0x5AA58000 |
| 35 | |
| 36 | void __secure __noreturn psci_system_reset(void) |
| 37 | { |
| 38 | writel(RST_SPRES, RST_SRESCR0); |
| 39 | |
| 40 | while (1) |
| 41 | ; |
| 42 | } |
| 43 | |
| 44 | int psci_update_dt(void *fdt) |
| 45 | { |
| 46 | return 0; |
| 47 | } |