blob: 409cbd319f2002eba52f6992c74b0a3b5bb3b692 [file] [log] [blame]
Manivannan Sadhasivam604ecc82018-06-14 23:38:32 +05301// SPDX-License-Identifier: GPL-2.0+
2/*
Amit Singh Tomarcae81932020-04-19 19:28:25 +05303 * Actions Semi Owl SoCs platform support.
Manivannan Sadhasivam604ecc82018-06-14 23:38:32 +05304 *
5 * Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
6 */
7
Simon Glassafb02152019-12-28 10:45:01 -07008#include <cpu_func.h>
Manivannan Sadhasivam604ecc82018-06-14 23:38:32 +05309#include <linux/arm-smccc.h>
10#include <linux/psci.h>
11#include <common.h>
12#include <asm/io.h>
13#include <asm/mach-types.h>
14#include <asm/psci.h>
15
16DECLARE_GLOBAL_DATA_PTR;
17
18/*
19 * dram_init - sets uboots idea of sdram size
20 */
21int dram_init(void)
22{
23 gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
24 return 0;
25}
26
27/* This is called after dram_init() so use get_ram_size result */
28int dram_init_banksize(void)
29{
30 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
31 gd->bd->bi_dram[0].size = gd->ram_size;
32
33 return 0;
34}
35
36static void show_psci_version(void)
37{
38 struct arm_smccc_res res;
39
40 arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
41
42 printf("PSCI: v%ld.%ld\n",
Amit Singh Tomarcae81932020-04-19 19:28:25 +053043 PSCI_VERSION_MAJOR(res.a0),
Manivannan Sadhasivam604ecc82018-06-14 23:38:32 +053044 PSCI_VERSION_MINOR(res.a0));
45}
46
47int board_init(void)
48{
49 show_psci_version();
50
51 return 0;
52}
53
54void reset_cpu(ulong addr)
55{
56 psci_system_reset();
57}