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,
24 [mcm_clk] = 312500000,
25 [pcie_clk] = 100000000,
26 [sgmii_srio_clk] = 156250000,
27 [xgmii_clk] = 156250000,
28 [usb_clk] = 100000000,
32 static struct pll_init_data core_pll_config[] = {
39 0, 0, 1, 4, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
42 static struct pll_init_data tetris_pll_config[] = {
50 static struct pll_init_data pa_pll_config =
53 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
54 struct eth_priv_t eth_priv_cfg[] = {
56 .int_name = "K2HK_EMAC",
60 .sgmii_link_type = SGMII_LINK_MAC_PHY,
63 .int_name = "K2HK_EMAC1",
67 .sgmii_link_type = SGMII_LINK_MAC_PHY,
70 .int_name = "K2HK_EMAC2",
74 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
77 .int_name = "K2HK_EMAC3",
81 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
85 int get_num_eth_ports(void)
87 return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t);
91 #ifdef CONFIG_BOARD_EARLY_INIT_F
92 int board_early_init_f(void)
96 speed = get_max_dev_speed();
97 init_pll(&core_pll_config[speed]);
99 init_pll(&pa_pll_config);
101 speed = get_max_arm_speed();
102 init_pll(&tetris_pll_config[speed]);
108 #ifdef CONFIG_SPL_BUILD
109 static struct pll_init_data spl_pll_config[] = {
114 void spl_init_keystone_plls(void)
116 init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config);