2 * K2E EVM : Board initialization
5 * Texas Instruments Incorporated, <www.ti.com>
7 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/arch/ddr3.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] = 100000000,
19 [alt_core_clk] = 100000000,
21 [ddr3_clk] = 100000000,
22 [mcm_clk] = 312500000,
23 [pcie_clk] = 100000000,
24 [sgmii_clk] = 156250000,
25 [xgmii_clk] = 156250000,
26 [usb_clk] = 100000000,
29 static struct pll_init_data core_pll_config[NUM_SPDS] = {
30 [SPD800] = CORE_PLL_800,
31 [SPD850] = CORE_PLL_850,
32 [SPD1000] = CORE_PLL_1000,
33 [SPD1250] = CORE_PLL_1250,
34 [SPD1350] = CORE_PLL_1350,
35 [SPD1400] = CORE_PLL_1400,
36 [SPD1500] = CORE_PLL_1500,
39 /* DEV and ARM speed definitions as specified in DEVSPEED register */
40 int speeds[DEVSPEED_NUMSPDS] = {
56 0, 0, 1, 4, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
59 static struct pll_init_data pa_pll_config =
62 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
63 struct eth_priv_t eth_priv_cfg[] = {
65 .int_name = "K2E_EMAC0",
69 .sgmii_link_type = SGMII_LINK_MAC_PHY,
72 .int_name = "K2E_EMAC1",
76 .sgmii_link_type = SGMII_LINK_MAC_PHY,
79 .int_name = "K2E_EMAC2",
83 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
86 .int_name = "K2E_EMAC3",
90 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
93 .int_name = "K2E_EMAC4",
97 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
100 .int_name = "K2E_EMAC5",
104 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
107 .int_name = "K2E_EMAC6",
111 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
114 .int_name = "K2E_EMAC7",
118 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
122 int get_num_eth_ports(void)
124 return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t);
128 #if defined(CONFIG_BOARD_EARLY_INIT_F)
129 int board_early_init_f(void)
133 speed = get_max_dev_speed();
134 init_pll(&core_pll_config[speed]);
136 init_pll(&pa_pll_config);
142 #ifdef CONFIG_SPL_BUILD
143 static struct pll_init_data spl_pll_config[] = {
147 void spl_init_keystone_plls(void)
149 init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config);