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