]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
746f985a ST |
2 | /** |
3 | * (C) Copyright 2014, Cavium Inc. | |
746f985a ST |
4 | **/ |
5 | ||
6 | #include <common.h> | |
9a3b4ceb | 7 | #include <cpu_func.h> |
9d922450 | 8 | #include <dm.h> |
2cf431c2 | 9 | #include <init.h> |
746f985a ST |
10 | #include <malloc.h> |
11 | #include <errno.h> | |
90526e9f | 12 | #include <net.h> |
401d1c4f | 13 | #include <asm/global_data.h> |
746f985a ST |
14 | #include <linux/compiler.h> |
15 | ||
3ed2ece5 | 16 | #include <cavium/atf.h> |
d473f0c6 | 17 | #include <asm/armv8/mmu.h> |
3ed2ece5 | 18 | |
746f985a | 19 | #if !CONFIG_IS_ENABLED(OF_CONTROL) |
746f985a ST |
20 | #include <dm/platform_data/serial_pl01x.h> |
21 | ||
8a8d24bd | 22 | static const struct pl01x_serial_plat serial0 = { |
746f985a ST |
23 | .base = CONFIG_SYS_SERIAL0, |
24 | .type = TYPE_PL011, | |
25 | .clock = 0, | |
26 | .skip_init = true, | |
27 | }; | |
28 | ||
20e442ab | 29 | U_BOOT_DRVINFO(thunderx_serial0) = { |
746f985a | 30 | .name = "serial_pl01x", |
caa4daa2 | 31 | .plat = &serial0, |
746f985a ST |
32 | }; |
33 | ||
8a8d24bd | 34 | static const struct pl01x_serial_plat serial1 = { |
746f985a ST |
35 | .base = CONFIG_SYS_SERIAL1, |
36 | .type = TYPE_PL011, | |
37 | .clock = 0, | |
38 | .skip_init = true, | |
39 | }; | |
40 | ||
20e442ab | 41 | U_BOOT_DRVINFO(thunderx_serial1) = { |
746f985a | 42 | .name = "serial_pl01x", |
caa4daa2 | 43 | .plat = &serial1, |
746f985a ST |
44 | }; |
45 | #endif | |
46 | ||
47 | DECLARE_GLOBAL_DATA_PTR; | |
48 | ||
d473f0c6 AG |
49 | static struct mm_region thunderx_mem_map[] = { |
50 | { | |
cd4b0c5f YS |
51 | .virt = 0x000000000000UL, |
52 | .phys = 0x000000000000UL, | |
d473f0c6 AG |
53 | .size = 0x40000000000UL, |
54 | .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_NON_SHARE, | |
55 | }, { | |
cd4b0c5f YS |
56 | .virt = 0x800000000000UL, |
57 | .phys = 0x800000000000UL, | |
d473f0c6 AG |
58 | .size = 0x40000000000UL, |
59 | .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | | |
60 | PTE_BLOCK_NON_SHARE, | |
61 | }, { | |
cd4b0c5f YS |
62 | .virt = 0x840000000000UL, |
63 | .phys = 0x840000000000UL, | |
d473f0c6 AG |
64 | .size = 0x40000000000UL, |
65 | .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | | |
66 | PTE_BLOCK_NON_SHARE, | |
67 | }, { | |
68 | /* List terminator */ | |
69 | 0, | |
70 | } | |
71 | }; | |
72 | ||
73 | struct mm_region *mem_map = thunderx_mem_map; | |
74 | ||
746f985a ST |
75 | int board_init(void) |
76 | { | |
77 | return 0; | |
78 | } | |
79 | ||
80 | int timer_init(void) | |
81 | { | |
82 | return 0; | |
83 | } | |
84 | ||
3ed2ece5 ST |
85 | int dram_init(void) |
86 | { | |
87 | ssize_t node_count = atf_node_count(); | |
88 | ssize_t dram_size; | |
89 | int node; | |
90 | ||
91 | printf("Initializing\nNodes in system: %zd\n", node_count); | |
92 | ||
93 | gd->ram_size = 0; | |
94 | ||
95 | for (node = 0; node < node_count; node++) { | |
96 | dram_size = atf_dram_size(node); | |
97 | printf("Node %d: %zd MBytes of DRAM\n", node, dram_size >> 20); | |
98 | gd->ram_size += dram_size; | |
99 | } | |
100 | ||
101 | gd->ram_size -= MEM_BASE; | |
102 | ||
103 | *(unsigned long *)CPU_RELEASE_ADDR = 0; | |
104 | ||
105 | puts("DRAM size:"); | |
106 | ||
107 | return 0; | |
108 | } | |
109 | ||
746f985a ST |
110 | /* |
111 | * Board specific reset that is system reset. | |
112 | */ | |
35b65dd8 | 113 | void reset_cpu(void) |
746f985a ST |
114 | { |
115 | } | |
116 | ||
117 | /* | |
118 | * Board specific ethernet initialization routine. | |
119 | */ | |
b75d8dc5 | 120 | int board_eth_init(struct bd_info *bis) |
746f985a ST |
121 | { |
122 | int rc = 0; | |
123 | ||
124 | return rc; | |
125 | } |