Sergey Temerkhanov | 746f985 | 2015-10-14 09:55:50 -0700 | [diff] [blame] | 1 | /** |
| 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 Temerkhanov | 3ed2ece | 2015-10-14 09:55:52 -0700 | [diff] [blame^] | 12 | #include <cavium/atf.h> |
| 13 | |
Sergey Temerkhanov | 746f985 | 2015-10-14 09:55:50 -0700 | [diff] [blame] | 14 | #if !CONFIG_IS_ENABLED(OF_CONTROL) |
| 15 | #include <dm/platdata.h> |
| 16 | #include <dm/platform_data/serial_pl01x.h> |
| 17 | |
| 18 | static const struct pl01x_serial_platdata serial0 = { |
| 19 | .base = CONFIG_SYS_SERIAL0, |
| 20 | .type = TYPE_PL011, |
| 21 | .clock = 0, |
| 22 | .skip_init = true, |
| 23 | }; |
| 24 | |
| 25 | U_BOOT_DEVICE(thunderx_serial0) = { |
| 26 | .name = "serial_pl01x", |
| 27 | .platdata = &serial0, |
| 28 | }; |
| 29 | |
| 30 | static const struct pl01x_serial_platdata serial1 = { |
| 31 | .base = CONFIG_SYS_SERIAL1, |
| 32 | .type = TYPE_PL011, |
| 33 | .clock = 0, |
| 34 | .skip_init = true, |
| 35 | }; |
| 36 | |
| 37 | U_BOOT_DEVICE(thunderx_serial1) = { |
| 38 | .name = "serial_pl01x", |
| 39 | .platdata = &serial1, |
| 40 | }; |
| 41 | #endif |
| 42 | |
| 43 | DECLARE_GLOBAL_DATA_PTR; |
| 44 | |
| 45 | int board_init(void) |
| 46 | { |
| 47 | return 0; |
| 48 | } |
| 49 | |
| 50 | int timer_init(void) |
| 51 | { |
| 52 | return 0; |
| 53 | } |
| 54 | |
Sergey Temerkhanov | 3ed2ece | 2015-10-14 09:55:52 -0700 | [diff] [blame^] | 55 | int 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 | |
| 77 | return 0; |
| 78 | } |
| 79 | |
Sergey Temerkhanov | 746f985 | 2015-10-14 09:55:50 -0700 | [diff] [blame] | 80 | /* |
| 81 | * Board specific reset that is system reset. |
| 82 | */ |
| 83 | void reset_cpu(ulong addr) |
| 84 | { |
| 85 | } |
| 86 | |
| 87 | /* |
| 88 | * Board specific ethernet initialization routine. |
| 89 | */ |
| 90 | int board_eth_init(bd_t *bis) |
| 91 | { |
| 92 | int rc = 0; |
| 93 | |
| 94 | return rc; |
| 95 | } |
| 96 | |
| 97 | #ifdef CONFIG_PCI |
| 98 | void pci_init_board(void) |
| 99 | { |
| 100 | printf("DEBUG: PCI Init TODO *****\n"); |
| 101 | } |
| 102 | #endif |