blob: 8a434bd49685bafb787909098f8d8a7ce3232e3d [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>
Simon Glass274e0b02020-05-10 11:39:56 -06009#include <asm/cache.h>
Manivannan Sadhasivam604ecc82018-06-14 23:38:32 +053010#include <linux/arm-smccc.h>
11#include <linux/psci.h>
12#include <common.h>
13#include <asm/io.h>
14#include <asm/mach-types.h>
15#include <asm/psci.h>
16
17DECLARE_GLOBAL_DATA_PTR;
18
19/*
20 * dram_init - sets uboots idea of sdram size
21 */
22int dram_init(void)
23{
24 gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
25 return 0;
26}
27
28/* This is called after dram_init() so use get_ram_size result */
29int dram_init_banksize(void)
30{
31 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
32 gd->bd->bi_dram[0].size = gd->ram_size;
33
34 return 0;
35}
36
37static void show_psci_version(void)
38{
39 struct arm_smccc_res res;
40
41 arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
42
43 printf("PSCI: v%ld.%ld\n",
Amit Singh Tomarcae81932020-04-19 19:28:25 +053044 PSCI_VERSION_MAJOR(res.a0),
Manivannan Sadhasivam604ecc82018-06-14 23:38:32 +053045 PSCI_VERSION_MINOR(res.a0));
46}
47
48int board_init(void)
49{
50 show_psci_version();
51
52 return 0;
53}
54
55void reset_cpu(ulong addr)
56{
57 psci_system_reset();
58}