blob: b9267676dc65afc1e98d2297a0db1ac437c752fa [file] [log] [blame]
Sergey Temerkhanov69f7a032015-10-14 09:55:50 -07001/**
2 * (C) Copyright 2014, Cavium Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5**/
6
7#include <common.h>
8#include <malloc.h>
9#include <errno.h>
10#include <linux/compiler.h>
11
Sergey Temerkhanov223f74d2015-10-14 09:55:52 -070012#include <cavium/atf.h>
13
Sergey Temerkhanov69f7a032015-10-14 09:55:50 -070014#if !CONFIG_IS_ENABLED(OF_CONTROL)
15#include <dm/platdata.h>
16#include <dm/platform_data/serial_pl01x.h>
17
18static const struct pl01x_serial_platdata serial0 = {
19 .base = CONFIG_SYS_SERIAL0,
20 .type = TYPE_PL011,
21 .clock = 0,
22 .skip_init = true,
23};
24
25U_BOOT_DEVICE(thunderx_serial0) = {
26 .name = "serial_pl01x",
27 .platdata = &serial0,
28};
29
30static const struct pl01x_serial_platdata serial1 = {
31 .base = CONFIG_SYS_SERIAL1,
32 .type = TYPE_PL011,
33 .clock = 0,
34 .skip_init = true,
35};
36
37U_BOOT_DEVICE(thunderx_serial1) = {
38 .name = "serial_pl01x",
39 .platdata = &serial1,
40};
41#endif
42
43DECLARE_GLOBAL_DATA_PTR;
44
45int board_init(void)
46{
47 return 0;
48}
49
50int timer_init(void)
51{
Sergey Temerkhanov223f74d2015-10-14 09:55:52 -070052 return 0;
53}
54
55int dram_init(void)
56{
57 ssize_t node_count = atf_node_count();
58 ssize_t dram_size;
59 int node;
60
61 printf("Initializing\nNodes in system: %zd\n", node_count);
62
63 gd->ram_size = 0;
64
65 for (node = 0; node < node_count; node++) {
66 dram_size = atf_dram_size(node);
67 printf("Node %d: %zd MBytes of DRAM\n", node, dram_size >> 20);
68 gd->ram_size += dram_size;
69 }
70
71 gd->ram_size -= MEM_BASE;
72
73 *(unsigned long *)CPU_RELEASE_ADDR = 0;
74
75 puts("DRAM size:");
76
Sergey Temerkhanov69f7a032015-10-14 09:55:50 -070077 return 0;
78}
79
80/*
81 * Board specific reset that is system reset.
82 */
83void reset_cpu(ulong addr)
84{
85}
86
87/*
88 * Board specific ethernet initialization routine.
89 */
90int board_eth_init(bd_t *bis)
91{
92 int rc = 0;
93
94 return rc;
95}
96
97#ifdef CONFIG_PCI
98void pci_init_board(void)
99{
100 printf("DEBUG: PCI Init TODO *****\n");
101}
102#endif