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 get_external_clk(u32 clk)
19 unsigned int clk_freq;
45 static struct pll_init_data core_pll_config[NUM_SPDS] = {
46 [SPD800] = CORE_PLL_799,
47 [SPD1000] = CORE_PLL_1000,
48 [SPD1200] = CORE_PLL_1198,
52 0, 0, 1, 4, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
55 static struct pll_init_data tetris_pll_config[] = {
56 [SPD800] = TETRIS_PLL_799,
57 [SPD1000] = TETRIS_PLL_1000,
58 [SPD1200] = TETRIS_PLL_1198,
59 [SPD1350] = TETRIS_PLL_1352,
60 [SPD1400] = TETRIS_PLL_1401,
63 static struct pll_init_data pa_pll_config =
66 struct pll_init_data *get_pll_init_data(int pll)
69 struct pll_init_data *data;
73 speed = get_max_dev_speed(speeds);
74 data = &core_pll_config[speed];
77 speed = get_max_arm_speed(speeds);
78 data = &tetris_pll_config[speed];
81 data = &pa_pll_config;
90 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
91 struct eth_priv_t eth_priv_cfg[] = {
93 .int_name = "K2L_EMAC",
97 .sgmii_link_type = SGMII_LINK_MAC_PHY,
98 .phy_if = PHY_INTERFACE_MODE_SGMII,
101 .int_name = "K2L_EMAC1",
105 .sgmii_link_type = SGMII_LINK_MAC_PHY,
106 .phy_if = PHY_INTERFACE_MODE_SGMII,
109 .int_name = "K2L_EMAC2",
113 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
114 .phy_if = PHY_INTERFACE_MODE_SGMII,
117 .int_name = "K2L_EMAC3",
121 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
122 .phy_if = PHY_INTERFACE_MODE_SGMII,
126 int get_num_eth_ports(void)
128 return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t);
132 #ifdef CONFIG_BOARD_EARLY_INIT_F
133 int board_early_init_f(void)
141 #if defined(CONFIG_MULTI_DTB_FIT)
142 int board_fit_config_name_match(const char *name)
144 if (!strcmp(name, "keystone-k2l-evm"))
151 #ifdef CONFIG_SPL_BUILD
152 void spl_init_keystone_plls(void)