1 // SPDX-License-Identifier: GPL-2.0+
3 * K2L EVM : Board initialization
6 * Texas Instruments Incorporated, <www.ti.com>
10 #include <asm/arch/ddr3.h>
11 #include <asm/arch/hardware.h>
12 #include <asm/ti-common/keystone_net.h>
14 unsigned int get_external_clk(u32 clk)
16 unsigned int clk_freq;
42 static struct pll_init_data core_pll_config[NUM_SPDS] = {
43 [SPD800] = CORE_PLL_799,
44 [SPD1000] = CORE_PLL_1000,
45 [SPD1200] = CORE_PLL_1198,
49 0, 0, 1, 4, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
52 static struct pll_init_data tetris_pll_config[] = {
53 [SPD800] = TETRIS_PLL_799,
54 [SPD1000] = TETRIS_PLL_1000,
55 [SPD1200] = TETRIS_PLL_1198,
56 [SPD1350] = TETRIS_PLL_1352,
57 [SPD1400] = TETRIS_PLL_1401,
60 static struct pll_init_data pa_pll_config =
63 struct pll_init_data *get_pll_init_data(int pll)
66 struct pll_init_data *data;
70 speed = get_max_dev_speed(speeds);
71 data = &core_pll_config[speed];
74 speed = get_max_arm_speed(speeds);
75 data = &tetris_pll_config[speed];
78 data = &pa_pll_config;
87 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
88 struct eth_priv_t eth_priv_cfg[] = {
90 .int_name = "K2L_EMAC",
94 .sgmii_link_type = SGMII_LINK_MAC_PHY,
95 .phy_if = PHY_INTERFACE_MODE_SGMII,
98 .int_name = "K2L_EMAC1",
102 .sgmii_link_type = SGMII_LINK_MAC_PHY,
103 .phy_if = PHY_INTERFACE_MODE_SGMII,
106 .int_name = "K2L_EMAC2",
110 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
111 .phy_if = PHY_INTERFACE_MODE_SGMII,
114 .int_name = "K2L_EMAC3",
118 .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
119 .phy_if = PHY_INTERFACE_MODE_SGMII,
123 int get_num_eth_ports(void)
125 return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t);
129 #ifdef CONFIG_BOARD_EARLY_INIT_F
130 int board_early_init_f(void)
138 #if defined(CONFIG_MULTI_DTB_FIT)
139 int board_fit_config_name_match(const char *name)
141 if (!strcmp(name, "keystone-k2l-evm"))
148 #ifdef CONFIG_SPL_BUILD
149 void spl_init_keystone_plls(void)