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 unsigned int external_clk[ext_clk_count] = {
16 [sys_clk] = 122880000,
17 [alt_core_clk] = 125000000,
19 [tetris_clk] = 125000000,
20 [ddr3a_clk] = 100000000,
21 [ddr3b_clk] = 100000000,
24 unsigned int get_external_clk(u32 clk)
26 unsigned int clk_freq;
55 static struct pll_init_data core_pll_config[NUM_SPDS] = {
56 [SPD800] = CORE_PLL_799,
57 [SPD1000] = CORE_PLL_999,
58 [SPD1200] = CORE_PLL_1200,
62 0, 0, 1, 4, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
65 static struct pll_init_data tetris_pll_config[] = {
66 [SPD800] = TETRIS_PLL_800,
67 [SPD1000] = TETRIS_PLL_1000,
68 [SPD1200] = TETRIS_PLL_1200,
69 [SPD1350] = TETRIS_PLL_1350,
70 [SPD1400] = TETRIS_PLL_1400,
73 static struct pll_init_data pa_pll_config =
76 struct pll_init_data *get_pll_init_data(int pll)
79 struct pll_init_data *data;
83 speed = get_max_dev_speed(speeds);
84 data = &core_pll_config[speed];
87 speed = get_max_arm_speed(speeds);
88 data = &tetris_pll_config[speed];
91 data = &pa_pll_config;
100 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
101 struct eth_priv_t eth_priv_cfg[] = {
103 .int_name = "K2HK_EMAC",
107 .sgmii_link_type = SGMII_LINK_MAC_PHY,
108 .phy_if = PHY_INTERFACE_MODE_SGMII,
111 .int_name = "K2HK_EMAC1",
115 .sgmii_link_type = SGMII_LINK_MAC_PHY,
116 .phy_if = PHY_INTERFACE_MODE_SGMII,
119 .int_name = "K2HK_EMAC2",
123 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
124 .phy_if = PHY_INTERFACE_MODE_SGMII,
127 .int_name = "K2HK_EMAC3",
131 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
132 .phy_if = PHY_INTERFACE_MODE_SGMII,
136 int get_num_eth_ports(void)
138 return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t);
142 #ifdef CONFIG_BOARD_EARLY_INIT_F
143 int board_early_init_f(void)
151 #if defined(CONFIG_MULTI_DTB_FIT)
152 int board_fit_config_name_match(const char *name)
154 if (!strcmp(name, "keystone-k2hk-evm"))
161 #ifdef CONFIG_SPL_BUILD
162 void spl_init_keystone_plls(void)