2 * K2L 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] = 122880000,
19 [alt_core_clk] = 100000000,
21 [tetris_clk] = 122880000,
22 [ddr3_clk] = 100000000,
23 [pcie_clk] = 100000000,
24 [sgmii_clk] = 156250000,
25 [usb_clk] = 100000000,
28 static struct pll_init_data core_pll_config[NUM_SPDS] = {
29 [SPD800] = CORE_PLL_799,
30 [SPD1000] = CORE_PLL_1000,
31 [SPD800] = CORE_PLL_1198,
35 0, 0, 1, 4, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
38 static struct pll_init_data tetris_pll_config[] = {
39 [SPD800] = TETRIS_PLL_799,
40 [SPD1000] = TETRIS_PLL_1000,
41 [SPD1200] = TETRIS_PLL_1198,
42 [SPD1350] = TETRIS_PLL_1352,
43 [SPD1400] = TETRIS_PLL_1401,
46 static struct pll_init_data pa_pll_config =
49 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
50 struct eth_priv_t eth_priv_cfg[] = {
52 .int_name = "K2L_EMAC",
56 .sgmii_link_type = SGMII_LINK_MAC_PHY,
59 .int_name = "K2L_EMAC1",
63 .sgmii_link_type = SGMII_LINK_MAC_PHY,
66 .int_name = "K2L_EMAC2",
70 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
73 .int_name = "K2L_EMAC3",
77 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
81 int get_num_eth_ports(void)
83 return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t);
87 #ifdef CONFIG_BOARD_EARLY_INIT_F
88 int board_early_init_f(void)
92 speed = get_max_dev_speed();
93 init_pll(&core_pll_config[speed]);
95 init_pll(&pa_pll_config);
97 speed = get_max_arm_speed();
98 init_pll(&tetris_pll_config[speed]);
104 #ifdef CONFIG_SPL_BUILD
105 static struct pll_init_data spl_pll_config[] = {
110 void spl_init_keystone_plls(void)
112 init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config);