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 struct pll_init_data *get_pll_init_data(int pll)
65 struct pll_init_data *data;
69 speed = get_max_dev_speed();
70 data = &core_pll_config[speed];
73 data = &pa_pll_config;
82 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
83 struct eth_priv_t eth_priv_cfg[] = {
85 .int_name = "K2E_EMAC0",
89 .sgmii_link_type = SGMII_LINK_MAC_PHY,
92 .int_name = "K2E_EMAC1",
96 .sgmii_link_type = SGMII_LINK_MAC_PHY,
99 .int_name = "K2E_EMAC2",
103 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
106 .int_name = "K2E_EMAC3",
110 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
113 .int_name = "K2E_EMAC4",
117 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
120 .int_name = "K2E_EMAC5",
124 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
127 .int_name = "K2E_EMAC6",
131 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
134 .int_name = "K2E_EMAC7",
138 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
142 int get_num_eth_ports(void)
144 return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t);
148 #if defined(CONFIG_BOARD_EARLY_INIT_F)
149 int board_early_init_f(void)
157 #ifdef CONFIG_SPL_BUILD
158 void spl_init_keystone_plls(void)