1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2014, Cavium Inc.
13 #include <asm/global_data.h>
14 #include <linux/compiler.h>
16 #include <cavium/atf.h>
17 #include <asm/armv8/mmu.h>
19 #if !CONFIG_IS_ENABLED(OF_CONTROL)
20 #include <dm/platform_data/serial_pl01x.h>
22 static const struct pl01x_serial_plat serial0 = {
23 .base = CONFIG_SYS_SERIAL0,
29 U_BOOT_DRVINFO(thunderx_serial0) = {
30 .name = "serial_pl01x",
34 static const struct pl01x_serial_plat serial1 = {
35 .base = CONFIG_SYS_SERIAL1,
41 U_BOOT_DRVINFO(thunderx_serial1) = {
42 .name = "serial_pl01x",
47 DECLARE_GLOBAL_DATA_PTR;
49 static struct mm_region thunderx_mem_map[] = {
51 .virt = 0x000000000000UL,
52 .phys = 0x000000000000UL,
53 .size = 0x40000000000UL,
54 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_NON_SHARE,
56 .virt = 0x800000000000UL,
57 .phys = 0x800000000000UL,
58 .size = 0x40000000000UL,
59 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
62 .virt = 0x840000000000UL,
63 .phys = 0x840000000000UL,
64 .size = 0x40000000000UL,
65 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
73 struct mm_region *mem_map = thunderx_mem_map;
87 ssize_t node_count = atf_node_count();
91 printf("Initializing\nNodes in system: %zd\n", node_count);
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;
101 gd->ram_size -= MEM_BASE;
103 *(unsigned long *)CPU_RELEASE_ADDR = 0;
111 * Board specific reset that is system reset.
118 * Board specific ethernet initialization routine.
120 int board_eth_init(struct bd_info *bis)