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 static struct pll_init_data core_pll_config[NUM_SPDS] = {
27 [SPD800] = CORE_PLL_799,
28 [SPD1000] = CORE_PLL_999,
29 [SPD1200] = CORE_PLL_1200,
33 0, 0, 1, 4, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
36 static struct pll_init_data tetris_pll_config[] = {
37 [SPD800] = TETRIS_PLL_800,
38 [SPD1000] = TETRIS_PLL_1000,
39 [SPD1200] = TETRIS_PLL_1200,
40 [SPD1350] = TETRIS_PLL_1350,
41 [SPD1400] = TETRIS_PLL_1400,
44 static struct pll_init_data pa_pll_config =
47 struct pll_init_data *get_pll_init_data(int pll)
50 struct pll_init_data *data;
54 speed = get_max_dev_speed(speeds);
55 data = &core_pll_config[speed];
58 speed = get_max_arm_speed(speeds);
59 data = &tetris_pll_config[speed];
62 data = &pa_pll_config;
71 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
72 struct eth_priv_t eth_priv_cfg[] = {
74 .int_name = "K2HK_EMAC",
78 .sgmii_link_type = SGMII_LINK_MAC_PHY,
79 .phy_if = PHY_INTERFACE_MODE_SGMII,
82 .int_name = "K2HK_EMAC1",
86 .sgmii_link_type = SGMII_LINK_MAC_PHY,
87 .phy_if = PHY_INTERFACE_MODE_SGMII,
90 .int_name = "K2HK_EMAC2",
94 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
95 .phy_if = PHY_INTERFACE_MODE_SGMII,
98 .int_name = "K2HK_EMAC3",
102 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
103 .phy_if = PHY_INTERFACE_MODE_SGMII,
107 int get_num_eth_ports(void)
109 return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t);
113 #ifdef CONFIG_BOARD_EARLY_INIT_F
114 int board_early_init_f(void)
122 #ifdef CONFIG_SPL_BUILD
123 void spl_init_keystone_plls(void)