blob: a230692c9e046ee89a78209fd1d615dc3e6cb3d8 [file] [log] [blame]
Hai Phamd3cf5c62020-10-27 19:06:51 +07001// SPDX-License-Identifier: GPL-2.0
2/*
Marek Vasut0fdbdfc2024-12-12 14:36:09 +01003 * This file implements basic PSCI support for Renesas R-Car 64bit SoCs
Hai Phamd3cf5c62020-10-27 19:06:51 +07004 *
5 * Copyright (C) 2020 Renesas Electronics Corp.
Hai Phamd3cf5c62020-10-27 19:06:51 +07006 */
7
Hai Phamd3cf5c62020-10-27 19:06:51 +07008#include <asm/io.h>
9#include <asm/psci.h>
10#include <asm/secure.h>
11
12int __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
27u32 __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
36void __secure __noreturn psci_system_reset(void)
37{
38 writel(RST_SPRES, RST_SRESCR0);
39
40 while (1)
41 ;
42}
43
44int psci_update_dt(void *fdt)
45{
46 return 0;
47}