Commit 928f3248b3e81a9fdaa818cf3aa02e5daef7015d

Authored by Masahiro Yamada
1 parent 4a89a24e26

ARM: uniphier: support system reset functionality for PSCI

This supports the system reset via PSCI for ARMv7 SoCs.

Because the system reset is not supported on PSCI 0.1, let's define
CONFIG_ARMV7_PSCI_1_0. (it is supported since PSCI 0.2, but there
is no CONFIG to enable it in U-Boot for now.)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Showing 3 changed files with 18 additions and 2 deletions Side-by-side Diff

arch/arm/mach-uniphier/arm32/psci.c
... ... @@ -151,4 +151,9 @@
151 151  
152 152 return PSCI_RET_SUCCESS;
153 153 }
  154 +
  155 +void __secure psci_system_reset(u32 function_id)
  156 +{
  157 + reset_cpu(0);
  158 +}
arch/arm/mach-uniphier/reset.c
1 1 /*
2   - * Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
  2 + * Copyright (C) 2012-2014 Panasonic Corporation
  3 + * Copyright (C) 2015-2016 Socionext Inc.
  4 + * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
3 5 *
4 6 * SPDX-License-Identifier: GPL-2.0+
5 7 */
6 8  
7 9 #include <common.h>
8 10 #include <linux/io.h>
  11 +#include <asm/secure.h>
9 12  
10 13 #include "sc-regs.h"
11 14  
12   -void reset_cpu(unsigned long ignored)
  15 +/* If PSCI is enabled, this is used for SYSTEM_RESET function */
  16 +#ifdef CONFIG_ARMV7_PSCI
  17 +#define __SECURE __secure
  18 +#else
  19 +#define __SECURE
  20 +#endif
  21 +
  22 +void __SECURE reset_cpu(unsigned long ignored)
13 23 {
14 24 u32 tmp;
15 25  
include/configs/uniphier.h
... ... @@ -12,6 +12,7 @@
12 12 #define __CONFIG_UNIPHIER_COMMON_H__
13 13  
14 14 #define CONFIG_ARMV7_PSCI
  15 +#define CONFIG_ARMV7_PSCI_1_0
15 16 #define CONFIG_ARMV7_PSCI_NR_CPUS 4
16 17  
17 18 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10