xref: /openbmc/u-boot/board/ti/ks2_evm/board_k2hk.c (revision 68968901)
1 /*
2  * K2HK EVM : Board initialization
3  *
4  * (C) Copyright 2012-2014
5  *     Texas Instruments Incorporated, <www.ti.com>
6  *
7  * SPDX-License-Identifier:     GPL-2.0+
8  */
9 
10 #include <common.h>
11 #include <asm/arch/hardware.h>
12 #include <asm/arch/emac_defs.h>
13 
14 DECLARE_GLOBAL_DATA_PTR;
15 
16 unsigned int external_clk[ext_clk_count] = {
17 	[sys_clk]	=	122880000,
18 	[alt_core_clk]	=	125000000,
19 	[pa_clk]	=	122880000,
20 	[tetris_clk]	=	125000000,
21 	[ddr3a_clk]	=	100000000,
22 	[ddr3b_clk]	=	100000000,
23 	[mcm_clk]	=	312500000,
24 	[pcie_clk]	=	100000000,
25 	[sgmii_srio_clk] =	156250000,
26 	[xgmii_clk]	=	156250000,
27 	[usb_clk]	=	100000000,
28 	[rp1_clk]	=	123456789
29 };
30 
31 static struct pll_init_data pll_config[] = {
32 	CORE_PLL_1228,
33 	PASS_PLL_983,
34 	TETRIS_PLL_1200,
35 };
36 
37 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
38 struct eth_priv_t eth_priv_cfg[] = {
39 	{
40 		.int_name	= "K2HK_EMAC",
41 		.rx_flow	= 22,
42 		.phy_addr	= 0,
43 		.slave_port	= 1,
44 		.sgmii_link_type = SGMII_LINK_MAC_PHY,
45 	},
46 	{
47 		.int_name	= "K2HK_EMAC1",
48 		.rx_flow	= 23,
49 		.phy_addr	= 1,
50 		.slave_port	= 2,
51 		.sgmii_link_type = SGMII_LINK_MAC_PHY,
52 	},
53 	{
54 		.int_name	= "K2HK_EMAC2",
55 		.rx_flow	= 24,
56 		.phy_addr	= 2,
57 		.slave_port	= 3,
58 		.sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
59 	},
60 	{
61 		.int_name	= "K2HK_EMAC3",
62 		.rx_flow	= 25,
63 		.phy_addr	= 3,
64 		.slave_port	= 4,
65 		.sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
66 	},
67 };
68 
69 int get_num_eth_ports(void)
70 {
71 	return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t);
72 }
73 #endif
74 
75 #ifdef CONFIG_BOARD_EARLY_INIT_F
76 int board_early_init_f(void)
77 {
78 	init_plls(ARRAY_SIZE(pll_config), pll_config);
79 	return 0;
80 }
81 #endif
82