Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Albert Aribaud | acc41ff | 2010-06-17 19:38:21 +0530 | [diff] [blame] | 2 | /* |
Albert ARIBAUD | 340983d | 2011-04-22 19:41:02 +0200 | [diff] [blame] | 3 | * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net> |
Albert Aribaud | acc41ff | 2010-06-17 19:38:21 +0530 | [diff] [blame] | 4 | * |
| 5 | * (C) Copyright 2009 |
| 6 | * Marvell Semiconductor <www.marvell.com> |
| 7 | * Written-by: Prafulla Wadaskar <prafulla@marvell.com> |
Albert Aribaud | acc41ff | 2010-06-17 19:38:21 +0530 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #include <common.h> |
| 11 | #include <miiphy.h> |
Simon Glass | 0c36441 | 2019-12-28 10:44:48 -0700 | [diff] [blame] | 12 | #include <net.h> |
Albert Aribaud | acc41ff | 2010-06-17 19:38:21 +0530 | [diff] [blame] | 13 | #include <asm/arch/orion5x.h> |
Wolfgang Denk | 7ec9e58 | 2011-12-09 12:14:28 +0100 | [diff] [blame] | 14 | #include "../common/common.h" |
Albert ARIBAUD | 2ac3792 | 2015-01-31 22:55:38 +0100 | [diff] [blame] | 15 | #include <spl.h> |
| 16 | #include <ns16550.h> |
Simon Glass | 0ffb9d6 | 2017-05-31 19:47:48 -0600 | [diff] [blame] | 17 | #include <asm/mach-types.h> |
Albert Aribaud | acc41ff | 2010-06-17 19:38:21 +0530 | [diff] [blame] | 18 | |
| 19 | DECLARE_GLOBAL_DATA_PTR; |
| 20 | |
Albert Aribaud | acc41ff | 2010-06-17 19:38:21 +0530 | [diff] [blame] | 21 | int board_init(void) |
| 22 | { |
| 23 | /* arch number of board */ |
| 24 | gd->bd->bi_arch_number = MACH_TYPE_EDMINI_V2; |
| 25 | |
| 26 | /* boot parameter start at 256th byte of RAM base */ |
| 27 | gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; |
| 28 | |
| 29 | return 0; |
| 30 | } |
Albert Aribaud | c5b205b | 2010-07-12 22:24:30 +0200 | [diff] [blame] | 31 | |
| 32 | #if defined(CONFIG_CMD_NET) && defined(CONFIG_RESET_PHY_R) |
| 33 | /* Configure and enable MV88E1116 PHY */ |
| 34 | void reset_phy(void) |
| 35 | { |
Simon Guinot | 0473b68 | 2012-06-05 13:16:00 +0000 | [diff] [blame] | 36 | mv_phy_88e1116_init("egiga0", 8); |
Albert Aribaud | c5b205b | 2010-07-12 22:24:30 +0200 | [diff] [blame] | 37 | } |
| 38 | #endif /* CONFIG_RESET_PHY_R */ |
Albert ARIBAUD | 2ac3792 | 2015-01-31 22:55:38 +0100 | [diff] [blame] | 39 | |
| 40 | /* |
| 41 | * SPL serial setup and NOR boot device selection |
| 42 | */ |
| 43 | |
| 44 | #ifdef CONFIG_SPL_BUILD |
| 45 | |
| 46 | void spl_board_init(void) |
| 47 | { |
| 48 | preloader_console_init(); |
| 49 | } |
| 50 | |
| 51 | u32 spl_boot_device(void) |
| 52 | { |
| 53 | return BOOT_DEVICE_NOR; |
| 54 | } |
| 55 | |
| 56 | #endif /* CONFIG_SPL_BUILD */ |