Merge branch 'master' of git://git.denx.de/u-boot-sunxi
[platform/kernel/u-boot.git] / board / ucRobotics / bubblegum_96 / bubblegum_96.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Bubblegum-96 Boards Support
4  *
5  * Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
6  */
7
8 #include <linux/arm-smccc.h>
9 #include <linux/psci.h>
10 #include <common.h>
11 #include <asm/io.h>
12 #include <asm/mach-types.h>
13 #include <asm/psci.h>
14
15 DECLARE_GLOBAL_DATA_PTR;
16
17 /*
18  * dram_init - sets uboots idea of sdram size
19  */
20 int dram_init(void)
21 {
22         gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
23         return 0;
24 }
25
26 /* This is called after dram_init() so use get_ram_size result */
27 int dram_init_banksize(void)
28 {
29         gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
30         gd->bd->bi_dram[0].size = gd->ram_size;
31
32         return 0;
33 }
34
35 static void show_psci_version(void)
36 {
37         struct arm_smccc_res res;
38
39         arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
40
41         printf("PSCI:  v%ld.%ld\n",
42                PSCI_VERSION_MAJOR(res.a0),
43                 PSCI_VERSION_MINOR(res.a0));
44 }
45
46 int board_init(void)
47 {
48         show_psci_version();
49
50         return 0;
51 }
52
53 void reset_cpu(ulong addr)
54 {
55         psci_system_reset();
56 }