blob: 3add099fd9a3af70e5af6feb05cf1c5eb1e17922 [file] [log] [blame]
David Feng12916822013-12-14 11:47:37 +08001/*
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>
David Fengd8bafe132015-01-31 11:55:29 +080014#include <dm/platdata.h>
15#include <dm/platform_data/serial_pl01x.h>
Liviu Dudau2fdc9b72015-10-19 11:08:32 +010016#include "pcie.h"
David Feng12916822013-12-14 11:47:37 +080017
18DECLARE_GLOBAL_DATA_PTR;
19
David Fengd8bafe132015-01-31 11:55:29 +080020static const struct pl01x_serial_platdata serial_platdata = {
21 .base = V2M_UART0,
22 .type = TYPE_PL011,
Linus Walleijd280ea02015-04-14 10:01:35 +020023 .clock = CONFIG_PL011_CLOCK,
David Fengd8bafe132015-01-31 11:55:29 +080024};
25
26U_BOOT_DEVICE(vexpress_serials) = {
27 .name = "serial_pl01x",
28 .platdata = &serial_platdata,
29};
30
Ryan Harkinbc8d3bc2015-11-18 10:39:06 +000031/* This function gets replaced by platforms supporting PCIe.
32 * The replacement function, eg. on Juno, initialises the PCIe bus.
33 */
34__weak void vexpress64_pcie_init(void)
35{
36}
37
David Feng12916822013-12-14 11:47:37 +080038int board_init(void)
39{
Liviu Dudau2fdc9b72015-10-19 11:08:32 +010040 vexpress64_pcie_init();
David Feng12916822013-12-14 11:47:37 +080041 return 0;
42}
43
44int dram_init(void)
45{
David Feng12916822013-12-14 11:47:37 +080046 gd->ram_size = PHYS_SDRAM_1_SIZE;
47 return 0;
48}
49
Liviu Dudau2d0cee12015-10-19 11:08:31 +010050void dram_init_banksize(void)
51{
52 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
53 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
54 gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
55 gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
56}
57
David Feng12916822013-12-14 11:47:37 +080058/*
59 * Board specific reset that is system reset.
60 */
61void reset_cpu(ulong addr)
62{
63}
64
David Feng12916822013-12-14 11:47:37 +080065/*
66 * Board specific ethernet initialization routine.
67 */
68int board_eth_init(bd_t *bis)
69{
70 int rc = 0;
71#ifdef CONFIG_SMC91111
72 rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
73#endif
Linus Walleijb31f9d72015-02-17 11:35:25 +010074#ifdef CONFIG_SMC911X
75 rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
76#endif
David Feng12916822013-12-14 11:47:37 +080077 return rc;
78}