1 /*
2  * (C) Copyright 2013
3  * David Feng <fenghua@phytium.com.cn>
4  * Sharma Bhupesh <bhupesh.sharma@freescale.com>
5  *
6  * SPDX-License-Identifier:	GPL-2.0+
7  */
8 #include <common.h>
9 #include <malloc.h>
10 #include <errno.h>
11 #include <netdev.h>
12 #include <asm/io.h>
13 #include <linux/compiler.h>
14 #include <dm/platdata.h>
15 #include <dm/platform_data/serial_pl01x.h>
16 #include "pcie.h"
17 
18 DECLARE_GLOBAL_DATA_PTR;
19 
20 static const struct pl01x_serial_platdata serial_platdata = {
21 	.base = V2M_UART0,
22 	.type = TYPE_PL011,
23 	.clock = CONFIG_PL011_CLOCK,
24 };
25 
26 U_BOOT_DEVICE(vexpress_serials) = {
27 	.name = "serial_pl01x",
28 	.platdata = &serial_platdata,
29 };
30 
31 int board_init(void)
32 {
33 	vexpress64_pcie_init();
34 	return 0;
35 }
36 
37 int dram_init(void)
38 {
39 	gd->ram_size = PHYS_SDRAM_1_SIZE;
40 	return 0;
41 }
42 
43 void dram_init_banksize(void)
44 {
45 	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
46 	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
47 	gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
48 	gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
49 }
50 
51 /*
52  * Board specific reset that is system reset.
53  */
54 void reset_cpu(ulong addr)
55 {
56 }
57 
58 /*
59  * Board specific ethernet initialization routine.
60  */
61 int board_eth_init(bd_t *bis)
62 {
63 	int rc = 0;
64 #ifdef CONFIG_SMC91111
65 	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
66 #endif
67 #ifdef CONFIG_SMC911X
68 	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
69 #endif
70 	return rc;
71 }
72