1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
4  *
5  * (C) Copyright 2009
6  * Marvell Semiconductor <www.marvell.com>
7  * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
8  */
9 
10 #include <common.h>
11 #include <miiphy.h>
12 #include <net.h>
13 #include <asm/arch/orion5x.h>
14 #include <asm/global_data.h>
15 #include "../common/common.h"
16 #include <spl.h>
17 #include <ns16550.h>
18 #include <asm/mach-types.h>
19 
20 DECLARE_GLOBAL_DATA_PTR;
21 
board_init(void)22 int board_init(void)
23 {
24 	/* arch number of board */
25 	gd->bd->bi_arch_number = MACH_TYPE_EDMINI_V2;
26 
27 	/* boot parameter start at 256th byte of RAM base */
28 	gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
29 
30 	return 0;
31 }
32 
33 #if defined(CONFIG_CMD_NET) && defined(CONFIG_RESET_PHY_R)
34 /* Configure and enable MV88E1116 PHY */
reset_phy(void)35 void reset_phy(void)
36 {
37 	mv_phy_88e1116_init("egiga0", 8);
38 }
39 #endif /* CONFIG_RESET_PHY_R */
40 
41 /*
42  * SPL serial setup and NOR boot device selection
43  */
44 
45 #ifdef CONFIG_SPL_BUILD
46 
spl_board_init(void)47 void spl_board_init(void)
48 {
49 	preloader_console_init();
50 }
51 
spl_boot_device(void)52 u32 spl_boot_device(void)
53 {
54 	return BOOT_DEVICE_NOR;
55 }
56 
57 #endif /* CONFIG_SPL_BUILD */
58