2 * K2HK EVM : Board initialization
4 * (C) Copyright 2012-2014
5 * Texas Instruments Incorporated, <www.ti.com>
7 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/arch/clock.h>
12 #include <asm/arch/hardware.h>
13 #include <asm/ti-common/keystone_net.h>
15 DECLARE_GLOBAL_DATA_PTR
;
17 unsigned int external_clk
[ext_clk_count
] = {
18 [sys_clk
] = 122880000,
19 [alt_core_clk
] = 125000000,
21 [tetris_clk
] = 125000000,
22 [ddr3a_clk
] = 100000000,
23 [ddr3b_clk
] = 100000000,
26 unsigned int get_external_clk(u32 clk
)
28 unsigned int clk_freq
;
57 static struct pll_init_data core_pll_config
[NUM_SPDS
] = {
58 [SPD800
] = CORE_PLL_799
,
59 [SPD1000
] = CORE_PLL_999
,
60 [SPD1200
] = CORE_PLL_1200
,
64 0, 0, 1, 4, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
67 static struct pll_init_data tetris_pll_config
[] = {
68 [SPD800
] = TETRIS_PLL_800
,
69 [SPD1000
] = TETRIS_PLL_1000
,
70 [SPD1200
] = TETRIS_PLL_1200
,
71 [SPD1350
] = TETRIS_PLL_1350
,
72 [SPD1400
] = TETRIS_PLL_1400
,
75 static struct pll_init_data pa_pll_config
=
78 struct pll_init_data
*get_pll_init_data(int pll
)
81 struct pll_init_data
*data
;
85 speed
= get_max_dev_speed(speeds
);
86 data
= &core_pll_config
[speed
];
89 speed
= get_max_arm_speed(speeds
);
90 data
= &tetris_pll_config
[speed
];
93 data
= &pa_pll_config
;
102 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
103 struct eth_priv_t eth_priv_cfg
[] = {
105 .int_name
= "K2HK_EMAC",
109 .sgmii_link_type
= SGMII_LINK_MAC_PHY
,
110 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
113 .int_name
= "K2HK_EMAC1",
117 .sgmii_link_type
= SGMII_LINK_MAC_PHY
,
118 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
121 .int_name
= "K2HK_EMAC2",
125 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
126 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
129 .int_name
= "K2HK_EMAC3",
133 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
134 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
138 int get_num_eth_ports(void)
140 return sizeof(eth_priv_cfg
) / sizeof(struct eth_priv_t
);
144 #ifdef CONFIG_BOARD_EARLY_INIT_F
145 int board_early_init_f(void)
153 #if defined(CONFIG_MULTI_DTB_FIT)
154 int board_fit_config_name_match(const char *name
)
156 if (!strcmp(name
, "keystone-k2hk-evm"))
163 #ifdef CONFIG_SPL_BUILD
164 void spl_init_keystone_plls(void)