1 // SPDX-License-Identifier: GPL-2.0+
3 * K2E 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
;
39 static struct pll_init_data core_pll_config
[NUM_SPDS
] = {
40 [SPD800
] = CORE_PLL_800
,
41 [SPD850
] = CORE_PLL_850
,
42 [SPD1000
] = CORE_PLL_1000
,
43 [SPD1250
] = CORE_PLL_1250
,
44 [SPD1350
] = CORE_PLL_1350
,
45 [SPD1400
] = CORE_PLL_1400
,
46 [SPD1500
] = CORE_PLL_1500
,
49 /* DEV and ARM speed definitions as specified in DEVSPEED register */
50 int speeds
[DEVSPEED_NUMSPDS
] = {
66 0, 0, 1, 4, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
69 static struct pll_init_data pa_pll_config
=
72 struct pll_init_data
*get_pll_init_data(int pll
)
75 struct pll_init_data
*data
;
79 speed
= get_max_dev_speed(speeds
);
80 data
= &core_pll_config
[speed
];
83 data
= &pa_pll_config
;
92 #ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
93 struct eth_priv_t eth_priv_cfg
[] = {
95 .int_name
= "K2E_EMAC0",
99 .sgmii_link_type
= SGMII_LINK_MAC_PHY
,
100 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
103 .int_name
= "K2E_EMAC1",
107 .sgmii_link_type
= SGMII_LINK_MAC_PHY
,
108 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
111 .int_name
= "K2E_EMAC2",
115 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
116 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
119 .int_name
= "K2E_EMAC3",
123 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
124 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
127 .int_name
= "K2E_EMAC4",
131 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
132 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
135 .int_name
= "K2E_EMAC5",
139 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
140 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
143 .int_name
= "K2E_EMAC6",
147 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
148 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
151 .int_name
= "K2E_EMAC7",
155 .sgmii_link_type
= SGMII_LINK_MAC_MAC_FORCED
,
156 .phy_if
= PHY_INTERFACE_MODE_SGMII
,
160 int get_num_eth_ports(void)
162 return sizeof(eth_priv_cfg
) / sizeof(struct eth_priv_t
);
166 #if defined(CONFIG_MULTI_DTB_FIT)
167 int board_fit_config_name_match(const char *name
)
169 if (!strcmp(name
, "keystone-k2e-evm"))
176 #if defined(CONFIG_BOARD_EARLY_INIT_F)
177 int board_early_init_f(void)
185 #ifdef CONFIG_SPL_BUILD
186 void spl_init_keystone_plls(void)