David Feng | 1291682 | 2013-12-14 11:47:37 +0800 | [diff] [blame] | 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> |
David Feng | d8bafe13 | 2015-01-31 11:55:29 +0800 | [diff] [blame] | 14 | #include <dm/platdata.h> |
| 15 | #include <dm/platform_data/serial_pl01x.h> |
David Feng | 1291682 | 2013-12-14 11:47:37 +0800 | [diff] [blame] | 16 | |
| 17 | DECLARE_GLOBAL_DATA_PTR; |
| 18 | |
David Feng | d8bafe13 | 2015-01-31 11:55:29 +0800 | [diff] [blame] | 19 | static const struct pl01x_serial_platdata serial_platdata = { |
| 20 | .base = V2M_UART0, |
| 21 | .type = TYPE_PL011, |
Linus Walleij | d280ea0 | 2015-04-14 10:01:35 +0200 | [diff] [blame] | 22 | .clock = CONFIG_PL011_CLOCK, |
David Feng | d8bafe13 | 2015-01-31 11:55:29 +0800 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | U_BOOT_DEVICE(vexpress_serials) = { |
| 26 | .name = "serial_pl01x", |
| 27 | .platdata = &serial_platdata, |
| 28 | }; |
| 29 | |
David Feng | 1291682 | 2013-12-14 11:47:37 +0800 | [diff] [blame] | 30 | int board_init(void) |
| 31 | { |
| 32 | return 0; |
| 33 | } |
| 34 | |
| 35 | int dram_init(void) |
| 36 | { |
David Feng | 1291682 | 2013-12-14 11:47:37 +0800 | [diff] [blame] | 37 | gd->ram_size = PHYS_SDRAM_1_SIZE; |
| 38 | return 0; |
| 39 | } |
| 40 | |
Liviu Dudau | 2d0cee1 | 2015-10-19 11:08:31 +0100 | [diff] [blame^] | 41 | void dram_init_banksize(void) |
| 42 | { |
| 43 | gd->bd->bi_dram[0].start = PHYS_SDRAM_1; |
| 44 | gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; |
| 45 | gd->bd->bi_dram[1].start = PHYS_SDRAM_2; |
| 46 | gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; |
| 47 | } |
| 48 | |
David Feng | 1291682 | 2013-12-14 11:47:37 +0800 | [diff] [blame] | 49 | /* |
| 50 | * Board specific reset that is system reset. |
| 51 | */ |
| 52 | void reset_cpu(ulong addr) |
| 53 | { |
| 54 | } |
| 55 | |
David Feng | 1291682 | 2013-12-14 11:47:37 +0800 | [diff] [blame] | 56 | /* |
| 57 | * Board specific ethernet initialization routine. |
| 58 | */ |
| 59 | int board_eth_init(bd_t *bis) |
| 60 | { |
| 61 | int rc = 0; |
| 62 | #ifdef CONFIG_SMC91111 |
| 63 | rc = smc91111_initialize(0, CONFIG_SMC91111_BASE); |
| 64 | #endif |
Linus Walleij | b31f9d7 | 2015-02-17 11:35:25 +0100 | [diff] [blame] | 65 | #ifdef CONFIG_SMC911X |
| 66 | rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); |
| 67 | #endif |
David Feng | 1291682 | 2013-12-14 11:47:37 +0800 | [diff] [blame] | 68 | return rc; |
| 69 | } |